diff --git a/benchmarks/GraphBLAS-sharp.Benchmarks/Configs/Context.txt b/benchmarks/GraphBLAS-sharp.Benchmarks/Configs/Context.txt index 04f1c08e..dc8e8842 100644 --- a/benchmarks/GraphBLAS-sharp.Benchmarks/Configs/Context.txt +++ b/benchmarks/GraphBLAS-sharp.Benchmarks/Configs/Context.txt @@ -1,3 +1,3 @@ -NVIDIA* +AMD* Gpu -32 +64 diff --git a/benchmarks/GraphBLAS-sharp.Benchmarks/Configs/WorkflowTargets.txt b/benchmarks/GraphBLAS-sharp.Benchmarks/Configs/WorkflowTargets.txt index 6161abd9..708032bc 100644 --- a/benchmarks/GraphBLAS-sharp.Benchmarks/Configs/WorkflowTargets.txt +++ b/benchmarks/GraphBLAS-sharp.Benchmarks/Configs/WorkflowTargets.txt @@ -1 +1 @@ -BFSBenchmark \ No newline at end of file +BFSWithoutTransfer diff --git a/benchmarks/GraphBLAS-sharp.Benchmarks/Scripts/Benchmark.py b/benchmarks/GraphBLAS-sharp.Benchmarks/Scripts/Benchmark.py index d3bf7559..a67cdbe6 100644 --- a/benchmarks/GraphBLAS-sharp.Benchmarks/Scripts/Benchmark.py +++ b/benchmarks/GraphBLAS-sharp.Benchmarks/Scripts/Benchmark.py @@ -7,8 +7,8 @@ from dataclasses import dataclass -ROOT = pathlib.Path(__file__).parent.parent.parent.parent -BENCHMARKS = pathlib.Path(__file__).parent.parent +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent.parent +BENCHMARKS = pathlib.Path(__file__).resolve().parent.parent CONFIGS = BENCHMARKS / "Configs" BINARIES = BENCHMARKS / "bin" / "Release" / "net7.0" RESULTS = ROOT / "BenchmarkDotNet.Artifacts" / "results" diff --git a/src/GraphBLAS-sharp/IO/MtxReader.fs b/src/GraphBLAS-sharp/IO/MtxReader.fs index f25ce8c0..fc68be31 100644 --- a/src/GraphBLAS-sharp/IO/MtxReader.fs +++ b/src/GraphBLAS-sharp/IO/MtxReader.fs @@ -68,40 +68,46 @@ type MtxReader(pathToFile: string) = let sortedData = match this.Symmetry with | General -> - [ 0 .. nnz - 1 ] - |> List.map (fun _ -> streamReader.ReadLine().Split(' ')) - |> Array.ofList - |> Array.Parallel.map - (fun line -> - let i = int line.[0] - let j = int line.[1] - - let v = - converter - <| if line.Length > 2 then line.[2] else "" - - struct (pack i j, v)) - |> Array.sortBy (fun struct (packedIndex, _) -> packedIndex) + let result = + [| 0 .. nnz - 1 |] + |> Array.map + (fun _ -> + let line = streamReader.ReadLine().Split(' ') + + let i = int line.[0] + let j = int line.[1] + + let v = + converter + <| if line.Length > 2 then line.[2] else "" + + struct (pack i j, v)) + + Array.sortInPlaceBy (fun struct (packedIndex, _) -> packedIndex) result + result | Symmetric -> - [ 0 .. nnz - 1 ] - |> List.map (fun _ -> streamReader.ReadLine().Split(' ')) - |> Array.ofList - |> Array.Parallel.map - (fun line -> - let i = int line.[0] - let j = int line.[1] - - let v = - converter - <| if line.Length > 2 then line.[2] else "" - - if i = j then - [| struct (pack i j, v) |] - else - [| struct (pack i j, v) - struct (pack j i, v) |]) - |> Array.concat - |> Array.sortBy (fun struct (packedIndex, _) -> packedIndex) + let result = + [| 0 .. nnz - 1 |] + |> Array.map + (fun _ -> + let line = streamReader.ReadLine().Split(' ') + + let i = int line.[0] + let j = int line.[1] + + let v = + converter + <| if line.Length > 2 then line.[2] else "" + + if i = j then + [| struct (pack i j, v) |] + else + [| struct (pack i j, v) + struct (pack j i, v) |]) + |> Array.concat + + Array.sortInPlaceBy (fun struct (packedIndex, _) -> packedIndex) result + result | _ -> failwith <| sprintf "This symmetry processing is not implemented: %A" this.Symmetry