Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Prohibit execution of negative flops
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 28 Mar 2018 11:37:59 +0000 (13:37 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 28 Mar 2018 15:33:55 +0000 (17:33 +0200)
This was often caused by smpi/host-speed:-1 because
in some cases, flops = duration * host-speed

I replaced one smpi/host-speed:-1 with smpi/simulate-computation:0
due to a brief conversation with Augustin Degomme today:

14:22 < degomme> host-speed -1 c'est une convention qu'on utilisait
14:22 < degomme> c'est synonyme de simulate_computation=0
14:22 < degomme> ou un truc du genre
14:22 < degomme> quand l'option n'existait pas .

examples/smpi/trace_call_location/trace_call_location.tesh
src/smpi/internals/smpi_bench.cpp
src/smpi/internals/smpi_global.cpp
teshsuite/smpi/mpich3-test/perf/CMakeLists.txt

index fd5ff1a..b8cf961 100644 (file)
@@ -4,7 +4,7 @@
 
 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/host-speed:-1 --log=smpi_kernel.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/host-speed:1 --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
 $ grep --quiet "12 0.* 2 1 5 .*trace_call_location\.c\" 14$" ${bindir:=.}/smpi_trace.trace 
 
index 1a64671..ea22f3a 100644 (file)
@@ -43,6 +43,7 @@ void smpi_execute_(double *duration)
 }
 
 void smpi_execute_flops(double flops) {
+  xbt_assert(flops >= 0, "You're trying to execute a negative amount of flops (%f)!", flops);
   XBT_DEBUG("Handle real computation time: %f flops", flops);
   smx_activity_t action = simcall_execution_start("computation", flops, 1, 0, smpi_process()->process()->getHost());
   simcall_set_category (action, TRACE_internal_smpi_get_category());
index 30c5bee..069b7f2 100644 (file)
@@ -368,6 +368,7 @@ static void smpi_init_options(){
   simgrid::smpi::Colls::smpi_coll_cleanup_callback = nullptr;
   smpi_cpu_threshold                               = xbt_cfg_get_double("smpi/cpu-threshold");
   smpi_host_speed                                  = xbt_cfg_get_double("smpi/host-speed");
+  xbt_assert(smpi_host_speed >= 0, "You're trying to set the host_speed to a negative value (%f)", smpi_host_speed);
   std::string smpi_privatize_option                = xbt_cfg_get_string("smpi/privatization");
   if (smpi_privatize_option == "no" || smpi_privatize_option == "0")
     smpi_privatize_global_variables = SMPI_PRIVATIZE_NONE;
index e92bcd1..b00a3f7 100644 (file)
@@ -17,7 +17,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
 endif()
 
 if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS)
-  ADD_TEST(test-smpi-mpich3-perf-raw       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/perf ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -tests=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/perf/testlist -execarg=-platform\ ${CMAKE_HOME_DIRECTORY}/examples/platforms/cluster.xml -execarg=--log=root.thr:critical -execarg=--cfg=smpi/async-small-thresh:65536 -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/host-speed:-1)
+  ADD_TEST(test-smpi-mpich3-perf-raw       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/perf ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -tests=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/perf/testlist -execarg=-platform\ ${CMAKE_HOME_DIRECTORY}/examples/platforms/cluster.xml -execarg=--log=root.thr:critical -execarg=--cfg=smpi/async-small-thresh:65536 -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/simulate-computation:0)
 endif()
 
 foreach(file allredtrace commcreatep non_zero_root sendrecvl timer transp-datatype twovec dtpack indexperf manyrma