From 9b6d927cf164e8fe1c857e5a6cbc826d1c0db1be Mon Sep 17 00:00:00 2001 From: Johannes Pekkila Date: Tue, 31 Mar 2020 12:37:54 +0200 Subject: [PATCH] It might be better to benchmark MPI codes without synchronization because of overhead of timing individual steps --- samples/benchmark/main.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/samples/benchmark/main.cc b/samples/benchmark/main.cc index 847e872..4b50bfb 100644 --- a/samples/benchmark/main.cc +++ b/samples/benchmark/main.cc @@ -96,6 +96,20 @@ main(void) // Benchmark Timer t; const AcReal dt = FLT_EPSILON; + + acGridSynchronizeStream(STREAM_ALL); + timer_reset(&t); + acGridSynchronizeStream(STREAM_ALL); + + const size_t num_iters = 50; + for (size_t i = 0; i < num_iters; ++i) + acGridIntegrate(STREAM_DEFAULT, dt); + + acGridSynchronizeStream(STREAM_ALL); + if (!pid) + timer_diff_print(t); + acGridSynchronizeStream(STREAM_ALL); + /* const size_t num_iters = 100; const double nth_percentile = 0.90; @@ -135,7 +149,7 @@ main(void) fprintf(fp, "%d, %g\n", nprocs, results[nth_percentile * num_iters]); fclose(fp); - } + }*/ acGridQuit(); MPI_Finalize();