Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Accept units for 'smpi/host-speed' config element
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Wed, 10 Jun 2020 23:24:35 +0000 (01:24 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Wed, 10 Jun 2020 23:24:35 +0000 (01:24 +0200)
docs/source/Configuring_SimGrid.rst
examples/smpi/gemm/gemm.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_coll1.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_empty2.tesh
examples/smpi/trace/trace.tesh
examples/smpi/trace_call_location/trace_call_location.tesh
src/smpi/include/smpi_config.hpp
src/smpi/internals/smpi_config.cpp
teshsuite/smpi/timers/timers.tesh

index 70fbf7e..f581710 100644 (file)
@@ -963,10 +963,11 @@ a ``MPI_Send()``, SMPI will automatically benchmark the duration of
 this code, and create an execution task within the simulator to take
 this into account. For that, the actual duration is measured on the
 host machine and then scaled to the power of the corresponding
-simulated machine. The variable ``smpi/host-speed`` allows one to specify
-the computational speed of the host machine (in flop/s) to use when
-scaling the execution times. It defaults to 20000, but you really want
-to adjust it to get accurate simulation results.
+simulated machine. The variable ``smpi/host-speed`` allows one to
+specify the computational speed of the host machine (in flop/s by
+default) to use when scaling the execution times. It defaults to 20kf
+(i.e., 20000 flop/s), but you really want to adjust it to get accurate
+simulation results.
 
 When the code consists of numerous consecutive MPI calls, the
 previous mechanism feeds the simulation kernel with numerous tiny
index 173f8bc..3978602 100644 (file)
@@ -4,13 +4,13 @@
 
 p Test instrumentation of SMPI
 
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/../hostfile -platform ${platfdir:=.}/small_platform.xml --cfg=path:${srcdir:=.}/../msg --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/host-speed:1 -np 8 ${bindir:=.}/smpi_gemm 1000 native
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/../hostfile -platform ${platfdir:=.}/small_platform.xml --cfg=path:${srcdir:=.}/../msg --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/host-speed:1f -np 8 ${bindir:=.}/smpi_gemm 1000 native
 > You requested to use 8 ranks, but there is only 5 processes in your hostfile...
 > Matrix Size : 1000x1000
 > Native mode
 > Performance= 227.29 GFlop/s, Time= 8.799 sec, Size= 2000000000 Ops
 
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/../hostfile -platform ${platfdir:=.}/small_platform.xml --cfg=path:${srcdir:=.}/../msg --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/host-speed:1 -np 8 ${bindir:=.}/smpi_gemm 1000 sampling
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/../hostfile -platform ${platfdir:=.}/small_platform.xml --cfg=path:${srcdir:=.}/../msg --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/host-speed:1f -np 8 ${bindir:=.}/smpi_gemm 1000 sampling
 > You requested to use 8 ranks, but there is only 5 processes in your hostfile...
 > Matrix Size : 1000x1000
 > Sampling mode
index 4137fe6..9452b3e 100644 (file)
@@ -6,8 +6,8 @@ $ mkfile ${srcdir:=.}/workload_coll1
 
 ! timeout 120
 ! output sort 25
-$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml  ${srcdir:=.}/workload_coll1 --log=smpi.:info --cfg=smpi/host-speed:100 "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 0 0
-> [   0.000000] (maestro@) Configuration change: Set 'smpi/host-speed' to '100'
+$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_coll1 --log=smpi.:info --cfg=smpi/host-speed:100f "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 0 0
+> [   0.000000] (maestro@) Configuration change: Set 'smpi/host-speed' to '100f'
 > [   0.000000] (maestro@) Job read: app='alone', file='coll.txt', size=2, start=0, alloc='0,1'
 > [   0.000000] (workload@Bourassa) Launching the job executor of job 0 (app 'alone')
 > [   0.000000] (job_0000@Bourassa) Executing job 0 (smpi_app 'alone')
@@ -22,8 +22,8 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml  ${srcdir
 p Workload with one coll job (with noise)
 ! timeout 120
 ! output sort 25
-$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml  ${srcdir:=.}/workload_coll1 --log=smpi.:info --cfg=smpi/host-speed:100 "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 7 13
-> [   0.000000] (maestro@) Configuration change: Set 'smpi/host-speed' to '100'
+$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_coll1 --log=smpi.:info --cfg=smpi/host-speed:100f "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 7 13
+> [   0.000000] (maestro@) Configuration change: Set 'smpi/host-speed' to '100f'
 > [   0.000000] (maestro@) Job read: app='alone', file='coll.txt', size=2, start=0, alloc='0,1'
 > [   0.000000] (workload@Bourassa) Launching the job executor of job 0 (app 'alone')
 > [   0.000000] (job_0000@Bourassa) Executing job 0 (smpi_app 'alone')
index eb0d0a8..b53caaa 100644 (file)
@@ -7,7 +7,7 @@ $ mkfile ${srcdir:=.}/workload_empty2
 
 ! timeout 120
 ! output sort 25
-$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2 --log=smpi.:info --cfg=smpi/host-speed:100 "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 0 0
+$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2 --log=smpi.:info --cfg=smpi/host-speed:100f "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 0 0
 > [   0.000000] (maestro@) Configuration change: Set 'smpi/host-speed' to '100'
 > [   0.000000] (maestro@) Job read: app='job0', file='empty.txt', size=2, start=0, alloc='0,1'
 > [   0.000000] (maestro@) Job read: app='job1', file='empty.txt', size=2, start=1000, alloc='2,3'
@@ -35,7 +35,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:
 p Workload with two empty jobs (not at the same time, not on the same resources, with noise)
 ! timeout 120
 ! output sort 25
-$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2 --log=smpi.:info --cfg=smpi/host-speed:100 "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 7 13
+$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2 --log=smpi.:info --cfg=smpi/host-speed:100f "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 7 13
 > [   0.000000] (maestro@) Configuration change: Set 'smpi/host-speed' to '100'
 > [   0.000000] (maestro@) Job read: app='job0', file='empty.txt', size=2, start=0, alloc='0,1'
 > [   0.000000] (maestro@) Job read: app='job1', file='empty.txt', size=2, start=1000, alloc='2,3'
@@ -71,7 +71,7 @@ $ mkfile ${srcdir:=.}/workload_empty2_same_resources
 
 ! timeout 120
 ! output sort 25
-$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2_same_resources --log=smpi.:info --cfg=smpi/host-speed:100 "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 0 0
+$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2_same_resources --log=smpi.:info --cfg=smpi/host-speed:100f "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 0 0
 > [   0.000000] (maestro@) Configuration change: Set 'smpi/host-speed' to '100'
 > [   0.000000] (maestro@) Job read: app='job0', file='empty.txt', size=2, start=0, alloc='0,1'
 > [   0.000000] (maestro@) Job read: app='job1', file='empty.txt', size=2, start=1000, alloc='0,1'
@@ -99,7 +99,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:
 p Workload with two empty jobs (not at the same time, but on the same resources, with noise)
 ! timeout 120
 ! output sort 25
-$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2_same_resources --log=smpi.:info --cfg=smpi/host-speed:100 "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 7 13
+$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2_same_resources --log=smpi.:info --cfg=smpi/host-speed:100f "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 7 13
 > [   0.000000] (maestro@) Configuration change: Set 'smpi/host-speed' to '100'
 > [   0.000000] (maestro@) Job read: app='job0', file='empty.txt', size=2, start=0, alloc='0,1'
 > [   0.000000] (maestro@) Job read: app='job1', file='empty.txt', size=2, start=1000, alloc='0,1'
@@ -135,7 +135,7 @@ $ mkfile ${srcdir:=.}/workload_empty2_same_time
 
 ! timeout 120
 ! output sort 25
-$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2_same_time --log=smpi.:info --cfg=smpi/host-speed:100 "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 0 0
+$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2_same_time --log=smpi.:info --cfg=smpi/host-speed:100f "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 0 0
 > [   0.000000] (maestro@) Configuration change: Set 'smpi/host-speed' to '100'
 > [   0.000000] (maestro@) Job read: app='job0', file='empty.txt', size=2, start=0, alloc='0,1'
 > [   0.000000] (maestro@) Job read: app='job1', file='empty.txt', size=2, start=0, alloc='2,3'
@@ -162,7 +162,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:
 p Workload with two empty jobs (at the same time but not on the same resources, with noise)
 ! timeout 120
 ! output sort 25
-$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2_same_time --log=smpi.:info --cfg=smpi/host-speed:100 "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 7 13
+$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2_same_time --log=smpi.:info --cfg=smpi/host-speed:100f "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 7 13
 > [   0.000000] (maestro@) Configuration change: Set 'smpi/host-speed' to '100'
 > [   0.000000] (maestro@) Job read: app='job0', file='empty.txt', size=2, start=0, alloc='0,1'
 > [   0.000000] (maestro@) Job read: app='job1', file='empty.txt', size=2, start=0, alloc='2,3'
@@ -198,7 +198,7 @@ $ mkfile ${srcdir:=.}/workload_empty2_same_time_and_resources
 
 ! timeout 120
 ! output sort 25
-$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2_same_time_and_resources --log=smpi.:info --cfg=smpi/host-speed:100 "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 0 0
+$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2_same_time_and_resources --log=smpi.:info --cfg=smpi/host-speed:100f "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 0 0
 > [   0.000000] (maestro@) Configuration change: Set 'smpi/host-speed' to '100'
 > [   0.000000] (maestro@) Job read: app='job0', file='empty.txt', size=2, start=0, alloc='0,1'
 > [   0.000000] (maestro@) Job read: app='job1', file='empty.txt', size=2, start=0, alloc='0,1'
@@ -226,7 +226,7 @@ p Workload with two empty jobs (at the same time and on the same resources, with
 
 ! timeout 120
 ! output sort 25
-$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2_same_time_and_resources --log=smpi.:info --cfg=smpi/host-speed:100 "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 7 13
+$ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:=.}/workload_empty2_same_time_and_resources --log=smpi.:info --cfg=smpi/host-speed:100f "--log=root.fmt:[%11.6r]%e(%P@%h)%e%m%n" 7 13
 > [   0.000000] (maestro@) Configuration change: Set 'smpi/host-speed' to '100'
 > [   0.000000] (maestro@) Job read: app='job0', file='empty.txt', size=2, start=0, alloc='0,1'
 > [   0.000000] (maestro@) Job read: app='job1', file='empty.txt', size=2, start=0, alloc='0,1'
index ad4d92f..2103ff5 100644 (file)
@@ -1345,10 +1345,10 @@ $ tail -n +3 ${bindir:=.}/smpi_trace.trace
 
 $ rm -f ${bindir:=.}/smpi_trace.trace
 
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace -trace-resource -trace-file ${bindir:=.}/smpi_trace.trace -hostfile ${srcdir:=.}/../hostfile -platform ${platfdir:=.}/small_platform.xml --cfg=path:${srcdir:=.}/../msg --cfg=smpi/host-speed:1 -np 3 ${bindir:=.}/smpi_trace --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace -trace-resource -trace-file ${bindir:=.}/smpi_trace.trace -hostfile ${srcdir:=.}/../hostfile -platform ${platfdir:=.}/small_platform.xml --cfg=path:${srcdir:=.}/../msg --cfg=smpi/host-speed:1f -np 3 ${bindir:=.}/smpi_trace --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning
 
 $ rm -f ${bindir:=.}/smpi_trace.trace
 
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace --cfg=tracing/smpi/display-sizes:yes --cfg=tracing/smpi/computing:yes --cfg=tracing/smpi/internals:yes -trace-file ${bindir:=.}/smpi_trace.trace -hostfile ${srcdir:=.}/../hostfile -platform ${platfdir:=.}/small_platform.xml --cfg=path:${srcdir:=.}/../msg --cfg=smpi/host-speed:1 -np 3 ${bindir:=.}/smpi_trace --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace --cfg=tracing/smpi/display-sizes:yes --cfg=tracing/smpi/computing:yes --cfg=tracing/smpi/internals:yes -trace-file ${bindir:=.}/smpi_trace.trace -hostfile ${srcdir:=.}/../hostfile -platform ${platfdir:=.}/small_platform.xml --cfg=path:${srcdir:=.}/../msg --cfg=smpi/host-speed:1f -np 3 ${bindir:=.}/smpi_trace --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning
 
 $ rm -f ${bindir:=.}/smpi_trace.trace
index d75dfc2..cfa3993 100644 (file)
@@ -4,22 +4,22 @@
 
 p Test SMPI with call-location tracing. This means that the binary must have
 p already been compiled with the -trace-call-location switch.
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace -trace-file ${bindir:=.}/smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml --cfg=smpi/trace-call-location:1 -np 3 ${bindir:=.}/smpi_trace_call_location --cfg=smpi/trace-call-use-absolute-path:1 --cfg=smpi/host-speed:1 --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace -trace-file ${bindir:=.}/smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml --cfg=smpi/trace-call-location:1 -np 3 ${bindir:=.}/smpi_trace_call_location --cfg=smpi/trace-call-use-absolute-path:1 --cfg=smpi/host-speed:1f --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning
 
 $ grep -q "12 0.* 2 1 7 .*trace_call_location\.c\" 14$" ${bindir:=.}/smpi_trace.trace 
 
 $ rm -f ${bindir:=.}/smpi_trace.trace 
 
 #the same, but with trace-ti
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace-ti -trace-file ${bindir:=.}/smpi_trace.txt --cfg=tracing/smpi/sleeping:1 -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml --cfg=smpi/trace-call-location:1 -np 3 ${bindir:=.}/smpi_trace_call_location --cfg=smpi/host-speed:1 --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/cpu-threshold:0
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace-ti -trace-file ${bindir:=.}/smpi_trace.txt --cfg=tracing/smpi/sleeping:1 -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml --cfg=smpi/trace-call-location:1 -np 3 ${bindir:=.}/smpi_trace_call_location --cfg=smpi/host-speed:1f --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/cpu-threshold:0
 
 #Test replaying the trace, without altering the time.
 #We disable computation, but leave the sleep.
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml -np 3 -replay ${bindir:=.}/smpi_trace.txt ${bindir:=.}/../replay/smpi_replay --cfg=smpi/host-speed:1 --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml -np 3 -replay ${bindir:=.}/smpi_trace.txt ${bindir:=.}/../replay/smpi_replay --cfg=smpi/host-speed:1f --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
 > [Fafard:2:(3) 1000.007967] [smpi_replay/INFO] Simulation time 1000.007967
 
 #Test replaying the trace, altering the time to have the sleep much faster (1 instead of 1000).
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml --cfg=smpi/comp-adjustment-file:${srcdir:=.}/trace_call_location/adjust -np 3 -replay ${bindir:=.}/smpi_trace.txt ${bindir:=.}/../replay/smpi_replay  --cfg=smpi/host-speed:1 --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml --cfg=smpi/comp-adjustment-file:${srcdir:=.}/trace_call_location/adjust -np 3 -replay ${bindir:=.}/smpi_trace.txt ${bindir:=.}/../replay/smpi_replay  --cfg=smpi/host-speed:1f --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
 > [Fafard:2:(3) 1.007967] [smpi_replay/INFO] Simulation time 1.007967
 
 $ rm -f ${bindir:=.}/smpi_trace.tx*
index e934e39..4161434 100644 (file)
@@ -11,7 +11,7 @@
 
 XBT_PRIVATE void smpi_check_options();
 /********************************** Configuration of SMPI **************************************/
-extern XBT_PRIVATE simgrid::config::Flag<double> _smpi_cfg_host_speed;
+extern XBT_PRIVATE simgrid::config::Flag<std::string> _smpi_cfg_host_speed_string;
 extern XBT_PRIVATE simgrid::config::Flag<bool> _smpi_cfg_simulate_computation;
 extern XBT_PRIVATE simgrid::config::Flag<std::string> _smpi_cfg_shared_malloc_string;
 extern XBT_PRIVATE simgrid::config::Flag<double> _smpi_cfg_cpu_thresh;
index 7bd5640..f24680c 100644 (file)
@@ -2,12 +2,14 @@
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
-#include "mc/mc.h"
+#include "smpi_config.hpp"
 #include "include/xbt/config.hpp"
+#include "mc/mc.h"
 #include "private.hpp"
 #include "smpi_coll.hpp"
-#include "smpi_config.hpp"
 #include "src/simix/smx_private.hpp"
+#include "xbt/parse_units.hpp"
+
 #include <cfloat> /* DBL_MAX */
 #include <boost/algorithm/string.hpp> /* trim */
 #include <boost/tokenizer.hpp>
@@ -31,13 +33,19 @@ constexpr bool HAVE_WORKING_MMAP = true;
 bool _smpi_options_initialized=false;
 SharedMallocType _smpi_cfg_shared_malloc = SharedMallocType::GLOBAL;
 SmpiPrivStrategies _smpi_cfg_privatization = SmpiPrivStrategies::NONE;
+double _smpi_cfg_host_speed;
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_config, smpi, "Logging specific to SMPI (config)");
 
-simgrid::config::Flag<double> _smpi_cfg_host_speed{
-  "smpi/host-speed", "Speed of the host running the simulation (in flop/s). "
-  "Used to bench the operations.",  20000.0,
-  [](const double& val) { xbt_assert(val > 0.0, "Invalid value (%f) for 'smpi/host-speed': it must be positive.", val); }};
+simgrid::config::Flag<std::string> _smpi_cfg_host_speed_string{
+    "smpi/host-speed",
+    "Speed of the host running the simulation (in flop/s). "
+    "Used to bench the operations.",
+    "20000f", [](const std::string& str) {
+      _smpi_cfg_host_speed = xbt_parse_get_speed("smpi/host-speed", 1, str.c_str(), "option", "smpi/host-speed");
+      xbt_assert(_smpi_cfg_host_speed > 0.0, "Invalid value (%s) for 'smpi/host-speed': it must be positive.",
+                 _smpi_cfg_host_speed_string.get().c_str());
+    }};
 
 simgrid::config::Flag<bool> _smpi_cfg_simulate_computation{
   "smpi/simulate-computation", "Whether the computational part of the simulated application should be simulated.",
index 8e0283b..26429aa 100644 (file)
@@ -1,4 +1,4 @@
 p Test timers
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 1 ${bindir:=.}/timers -q --log=smpi_config.thres:warning --cfg=smpi/simulate-computation:no --cfg=smpi/host-speed:100000 --log=xbt_cfg.thres:warning --cfg=smpi/wtime:0
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 1 ${bindir:=.}/timers -q --log=smpi_config.thres:warning --cfg=smpi/simulate-computation:no --cfg=smpi/host-speed:100Gf --log=xbt_cfg.thres:warning --cfg=smpi/wtime:0
 > [rank 0] -> Tremblay