Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Program against s4u::Actor and not smx_actor_t
[simgrid.git] / src / smpi / internals / smpi_bench.cpp
index 795521e..c067ad9 100644 (file)
@@ -4,11 +4,13 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "private.hpp"
+#include "simgrid/host.h"
 #include "simgrid/modelchecker.h"
 #include "smpi_comm.hpp"
 #include "smpi_process.hpp"
 #include "src/internal_config.h"
 #include "src/mc/mc_replay.hpp"
+#include "src/simix/ActorImpl.hpp"
 #include <unordered_map>
 
 #ifndef WIN32
@@ -42,7 +44,7 @@ void smpi_execute_(double *duration)
 
 void smpi_execute_flops(double flops) {
   XBT_DEBUG("Handle real computation time: %f flops", flops);
-  smx_activity_t action = simcall_execution_start("computation", flops, 1, 0);
+  smx_activity_t action = simcall_execution_start("computation", flops, 1, 0, smpi_process()->process()->getImpl()->host);
   simcall_set_category (action, TRACE_internal_smpi_get_category());
   simcall_execution_wait(action);
   smpi_switch_data_segment(smpi_process()->index());
@@ -69,7 +71,8 @@ void smpi_execute(double duration)
 void smpi_execute_benched(double duration)
 {
   smpi_bench_end();
-  smpi_execute(duration);
+  double speed = sg_host_speed(sg_host_self());
+  smpi_execute_flops(duration*speed);
   smpi_bench_begin();
 }