From: Augustin Degomme Date: Thu, 3 Oct 2019 14:26:50 +0000 (+0200) Subject: add test for call location with ti traces/replay/adjustment/sleep/computing=0. X-Git-Tag: v3.24~45 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4849fa629964546d58d402ad78be3419e7c5c367 add test for call location with ti traces/replay/adjustment/sleep/computing=0. Idea is to replay twice a trace with an adjustment file meant to speedup the sleep (and only it, to avoid variability). It's clearly not realistic, but timings should be reproducible (or not..). --- diff --git a/examples/smpi/CMakeLists.txt b/examples/smpi/CMakeLists.txt index 313a577c60..b72db9af8c 100644 --- a/examples/smpi/CMakeLists.txt +++ b/examples/smpi/CMakeLists.txt @@ -68,7 +68,8 @@ set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions0.t ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_reducescatter.txt ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_waitall.txt ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_with_isend.txt - ${CMAKE_CURRENT_SOURCE_DIR}/replay/split_traces PARENT_SCOPE) + ${CMAKE_CURRENT_SOURCE_DIR}/replay/split_traces + ${CMAKE_CURRENT_SOURCE_DIR}/trace_call_location/adjust PARENT_SCOPE) if(enable_smpi) # MC is currently broken with threads (deadlock => timeout) diff --git a/examples/smpi/trace_call_location/adjust b/examples/smpi/trace_call_location/adjust new file mode 100644 index 0000000000..03b309fd22 --- /dev/null +++ b/examples/smpi/trace_call_location/adjust @@ -0,0 +1,2 @@ +"start:stop","ratio" +"trace_call_location.c:15:trace_call_location.c:15","1000" diff --git a/examples/smpi/trace_call_location/trace_call_location.c b/examples/smpi/trace_call_location/trace_call_location.c index 4397aaf18c..f2c508156e 100644 --- a/examples/smpi/trace_call_location/trace_call_location.c +++ b/examples/smpi/trace_call_location/trace_call_location.c @@ -12,6 +12,7 @@ int main(int argc, char *argv[]) { MPI_Init(&argc, &argv); MPI_Barrier (MPI_COMM_WORLD); + sleep(1000); MPI_Finalize(); return 0; } diff --git a/examples/smpi/trace_call_location/trace_call_location.tesh b/examples/smpi/trace_call_location/trace_call_location.tesh index e6231df9a7..fa8df47a4c 100644 --- a/examples/smpi/trace_call_location/trace_call_location.tesh +++ b/examples/smpi/trace_call_location/trace_call_location.tesh @@ -4,8 +4,23 @@ 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/trace-call-use-absolute-path:1 --cfg=smpi/host-speed:1 --log=smpi_kernel.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_kernel.thres:warning --log=xbt_cfg.thres:warning + +#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_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no +> [Fafard:2:(3) 1000.003952] [smpi_replay/INFO] Simulation time 1000.003952 + +#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_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no +> [Fafard:2:(3) 1.003952] [smpi_replay/INFO] Simulation time 1.003952 + +$ rm -f ${bindir:=.}/smpi_trace.tx* +