From b82fe6887e01d3d0e22da5e87d31d16f29bd92c8 Mon Sep 17 00:00:00 2001 From: kirillgarbar Date: Sun, 17 Dec 2023 19:30:22 +0300 Subject: [PATCH] Block after setup and cleanup in benchmarks --- benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/BFS.fs | 4 ++++ benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/PageRank.fs | 2 ++ benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/Map2/Map2.fs | 2 ++ benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Expand.fs | 2 ++ benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Masked.fs | 4 ++++ benchmarks/GraphBLAS-sharp.Benchmarks/Vector/Map2.fs | 3 +++ 6 files changed, 17 insertions(+) diff --git a/benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/BFS.fs b/benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/BFS.fs index 773cece7..9cb5ab3d 100644 --- a/benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/BFS.fs +++ b/benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/BFS.fs @@ -113,10 +113,12 @@ type WithoutTransferBenchmark<'elem when 'elem : struct>( override this.GlobalSetup() = this.ReadMatrix() this.LoadMatrixToGPU() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.IterationCleanup() = this.ClearResult() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.GlobalCleanup() = @@ -180,6 +182,7 @@ type WithTransferBenchmark<'elem when 'elem : struct>( [] override this.GlobalSetup() = this.ReadMatrix() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.GlobalCleanup() = @@ -189,6 +192,7 @@ type WithTransferBenchmark<'elem when 'elem : struct>( override this.IterationCleanup() = this.ClearInputMatrix() this.ClearResult() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.Benchmark() = diff --git a/benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/PageRank.fs b/benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/PageRank.fs index 9e6a3f38..d60415b8 100644 --- a/benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/PageRank.fs +++ b/benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/PageRank.fs @@ -117,10 +117,12 @@ type PageRankWithoutTransferBenchmarkFloat32() = this.Processor.PostAndReply(Msg.MsgNotifyMe) this.PrepareMatrix() this.ClearInputMatrix() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.IterationCleanup() = this.ClearResult() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.GlobalCleanup() = diff --git a/benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/Map2/Map2.fs b/benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/Map2/Map2.fs index ab54db75..bcd04eb8 100644 --- a/benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/Map2/Map2.fs +++ b/benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/Map2/Map2.fs @@ -251,6 +251,7 @@ module WithTransfer = [] override this.GlobalSetup() = this.ReadMatrices() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.GlobalCleanup() = () @@ -259,6 +260,7 @@ module WithTransfer = override this.IterationCleanup() = this.ClearInputMatrices() this.ClearResult() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.Benchmark() = diff --git a/benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Expand.fs b/benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Expand.fs index e8a75071..88e91cb6 100644 --- a/benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Expand.fs +++ b/benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Expand.fs @@ -115,6 +115,7 @@ module WithoutTransfer = override this.GlobalSetup() = this.ReadMatrices() this.LoadMatricesToGPU() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.Benchmark() = @@ -124,6 +125,7 @@ module WithoutTransfer = [] override this.IterationCleanup () = this.ClearResult() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.GlobalCleanup () = diff --git a/benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Masked.fs b/benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Masked.fs index ff0495bf..fcbd13f8 100644 --- a/benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Masked.fs +++ b/benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Masked.fs @@ -152,6 +152,7 @@ type MxmBenchmarksMultiplicationOnly<'elem when 'elem : struct>( this.ReadMatrices () this.LoadMatricesToGPU () this.ConvertSecondMatrixToCSC() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.Benchmark () = @@ -161,6 +162,7 @@ type MxmBenchmarksMultiplicationOnly<'elem when 'elem : struct>( [] override this.IterationCleanup () = this.ClearResult() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.GlobalCleanup () = @@ -182,6 +184,7 @@ type MxmBenchmarksWithTransposing<'elem when 'elem : struct>( override this.GlobalSetup() = this.ReadMatrices() this.LoadMatricesToGPU () + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.Benchmark() = @@ -194,6 +197,7 @@ type MxmBenchmarksWithTransposing<'elem when 'elem : struct>( override this.IterationCleanup() = this.ClearResult() this.ConvertSecondMatrixToCSR() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.GlobalCleanup() = diff --git a/benchmarks/GraphBLAS-sharp.Benchmarks/Vector/Map2.fs b/benchmarks/GraphBLAS-sharp.Benchmarks/Vector/Map2.fs index 5c4871e2..c3e566eb 100644 --- a/benchmarks/GraphBLAS-sharp.Benchmarks/Vector/Map2.fs +++ b/benchmarks/GraphBLAS-sharp.Benchmarks/Vector/Map2.fs @@ -115,6 +115,7 @@ module WithoutTransfer = override this.IterationCleanup() = this.ClearResult() this.ClearInputVectors() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.GlobalCleanup() = () @@ -159,6 +160,7 @@ module WithTransfer = [] override this.IterationSetup() = this.CreateVectors() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.Benchmark () = @@ -175,6 +177,7 @@ module WithTransfer = override this.IterationCleanup () = this.ClearInputVectors() this.ClearResult() + this.Processor.PostAndReply(Msg.MsgNotifyMe) [] override this.GlobalCleanup() = ()