From 7ac777931e588a2a48708ac16caeb50973f2cdf9 Mon Sep 17 00:00:00 2001 From: Tom Cornebize Date: Wed, 19 Jul 2017 15:05:38 +0200 Subject: [PATCH] Fix smpi_execute_benched. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When simulating a target machine T on an host H, you had to give the time as measured on H. This time was then “converted” to the time that would be spent on T by using the host speed and the target speed. Now, you directly give the time that should be spent on T. This is better, since the relative duration of different pieces of code may differ from H to T (and thus you really want to give the time spent on T). --- src/smpi/internals/smpi_bench.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/smpi/internals/smpi_bench.cpp b/src/smpi/internals/smpi_bench.cpp index b570e7b1ea..0b68ed98c3 100644 --- a/src/smpi/internals/smpi_bench.cpp +++ b/src/smpi/internals/smpi_bench.cpp @@ -10,6 +10,7 @@ #include "src/mc/mc_replay.h" #include "smpi_process.hpp" #include "smpi_comm.hpp" +#include "simgrid/host.h" #ifndef WIN32 #include @@ -81,7 +82,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(); } -- 2.20.1