From: Christian Heinrich Date: Wed, 28 Mar 2018 11:37:59 +0000 (+0200) Subject: [SMPI] Prohibit execution of negative flops X-Git-Tag: v3.20~600^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f84aecd6adbd11b2e31a6cd47016bc03aa778a6e?ds=sidebyside [SMPI] Prohibit execution of negative flops 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 . --- diff --git a/examples/smpi/trace_call_location/trace_call_location.tesh b/examples/smpi/trace_call_location/trace_call_location.tesh index fd5ff1a417..b8cf961816 100644 --- a/examples/smpi/trace_call_location/trace_call_location.tesh +++ b/examples/smpi/trace_call_location/trace_call_location.tesh @@ -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 diff --git a/src/smpi/internals/smpi_bench.cpp b/src/smpi/internals/smpi_bench.cpp index 1a64671de0..ea22f3afa1 100644 --- a/src/smpi/internals/smpi_bench.cpp +++ b/src/smpi/internals/smpi_bench.cpp @@ -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()); diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 30c5bee12b..069b7f2f2b 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -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; diff --git a/teshsuite/smpi/mpich3-test/perf/CMakeLists.txt b/teshsuite/smpi/mpich3-test/perf/CMakeLists.txt index e92bcd188c..b00a3f7be3 100644 --- a/teshsuite/smpi/mpich3-test/perf/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/perf/CMakeLists.txt @@ -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