Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a small allocations counter in SMPI.
[simgrid.git] / src / smpi / internals / smpi_bench.cpp
index 8eac4e7..0e4e852 100644 (file)
@@ -9,6 +9,7 @@
 #include "simgrid/modelchecker.h"
 #include "simgrid/s4u/Exec.hpp"
 #include "smpi_comm.hpp"
+#include "smpi_utils.hpp"
 #include "src/internal_config.h"
 #include "src/mc/mc_replay.hpp"
 #include "xbt/config.hpp"
@@ -34,8 +35,6 @@ static simgrid::config::Flag<double>
                      "Minimum time to inject inside a call to MPI_Wtime(), gettimeofday() and clock_gettime()",
                      1e-8 /* Documented to be 10 ns */);
 
-double smpi_total_benched_time = 0;
-
 // Private execute_flops used by smpi_execute and smpi_execute_benched
 void private_execute_flops(double flops) {
   xbt_assert(flops >= 0, "You're trying to execute a negative amount of flops (%f)!", flops);
@@ -162,7 +161,7 @@ void smpi_bench_end()
   }
 #endif
 
-  smpi_total_benched_time += xbt_os_timer_elapsed(timer);
+  simgrid::smpi::utils::add_benched_time(xbt_os_timer_elapsed(timer));
 }
 
 /* Private sleep function used by smpi_sleep(), smpi_usleep() and friends */