From: Martin Quinson <624847+mquinson@users.noreply.github.com> Date: Thu, 22 Nov 2018 13:22:52 +0000 (+0100) Subject: Merge pull request #315 from simgrid/smpirun-replay X-Git-Tag: v3_22~781^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0013d87d603e2eb33f659d09ae64e35aaeb880ab?hp=df24d1f9b8d85ff3f81c5d4f816310303d7186ab Merge pull request #315 from simgrid/smpirun-replay replay from smpirun (without a dedicated replayer program) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index bd1bca7bd0..3d9417b9e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -426,7 +426,7 @@ if(CMAKE_USE_PTHREADS_INIT) RUN_OUTPUT_VARIABLE semopen_runmsg) if(semopen_compilable) - if(NOT semopen_retval) # error if not 0 + if(NOT semopen_retval) # error if not 0 message(STATUS "sem_open is compilable and executable") set(HAVE_SEM_OPEN 1) else() @@ -458,7 +458,7 @@ if(CMAKE_USE_PTHREADS_INIT) RUN_OUTPUT_VARIABLE seminit_runmsg) if(seminit_compilable) - if(NOT seminit_retval) # error if not 0 + if(NOT seminit_retval) # error if not 0 message(STATUS "sem_init is compilable and executable") set(HAVE_SEM_INIT 1) else() @@ -617,6 +617,7 @@ if(NS3_LIBRARY_PATH) endif() set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"") set(SMPIMAIN ${libdir}/simgrid/smpimain) +set(SMPIREPLAYMAIN ${libdir}/simgrid/smpireplaymain) configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/mpif.h.in ${CMAKE_BINARY_DIR}/include/smpi/mpif.h @ONLY) #configure mpif.f90 to build mpi.mod @@ -645,6 +646,7 @@ if(NS3_LIBRARY_PATH) endif() set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"") set(SMPIMAIN ${CMAKE_BINARY_DIR}/lib/simgrid/smpimain) +set(SMPIREPLAYMAIN ${CMAKE_BINARY_DIR}/lib/simgrid/smpireplaymain) foreach(script cc cxx ff f90 run) configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpi${script}.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpi${script} @ONLY) diff --git a/examples/smpi/CMakeLists.txt b/examples/smpi/CMakeLists.txt index 03580f0e00..947e376afc 100644 --- a/examples/smpi/CMakeLists.txt +++ b/examples/smpi/CMakeLists.txt @@ -40,6 +40,7 @@ set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/energy/energy.tes ${CMAKE_CURRENT_SOURCE_DIR}/trace_simple/trace_simple.tesh ${CMAKE_CURRENT_SOURCE_DIR}/trace_call_location/trace_call_location.tesh ${CMAKE_CURRENT_SOURCE_DIR}/ampi/ampi.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/replay/replay-override-replayer.tesh ${CMAKE_CURRENT_SOURCE_DIR}/replay/replay.tesh PARENT_SCOPE) set(bin_files ${bin_files} ${CMAKE_CURRENT_SOURCE_DIR}/hostfile ${CMAKE_CURRENT_SOURCE_DIR}/energy/hostfile @@ -74,6 +75,7 @@ if(enable_smpi) ADD_TESH(smpi-tracing-simple --setenv bindir=${CMAKE_BINARY_DIR}/examples/smpi/trace_simple --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_simple --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi/trace_simple ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_simple/trace_simple.tesh) ADD_TESH(smpi-tracing-call-location --setenv bindir=${CMAKE_BINARY_DIR}/examples/smpi/trace_call_location --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi/trace_call_location ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_call_location/trace_call_location.tesh) ADD_TESH(smpi-replay --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/replay.tesh) + ADD_TESH(smpi-replay-override-replayer --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/replay-override-replayer.tesh) ADD_TESH_FACTORIES(smpi-energy "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/smpi/energy --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/energy.tesh) ADD_TESH(smpi-ampi --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/ampi/ampi.tesh) diff --git a/examples/smpi/ampi/ampi.tesh b/examples/smpi/ampi/ampi.tesh index bc3d78fb80..3cb405a15a 100644 --- a/examples/smpi/ampi/ampi.tesh +++ b/examples/smpi/ampi/ampi.tesh @@ -5,7 +5,7 @@ p Test if the load balancing code gets traced correctly ! timeout 60 -$ ../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename:${bindir:=.}/smpi_trace.trace --cfg=tracing/smpi/format/ti-one-file:yes -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./ampi/smpi_ampi ${srcdir:=.}/replay/actions_bcast.txt --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/wtime:0 +$ ../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename:${bindir:=.}/smpi_trace.trace --cfg=tracing/smpi/format/ti-one-file:yes -no-privatize -replay ${srcdir:=.}/replay/actions_bcast.txt --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./ampi/smpi_ampi --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/wtime:0 $ bash -c "cat ${bindir:=.}/smpi_trace.trace_files/*" > 0 init @@ -30,5 +30,5 @@ $ bash -c "cat ${bindir:=.}/smpi_trace.trace_files/*" > 2 migrate 400 > 2 finalize -$ rm -rf ${bindir:=.}/smpi_trace.trace +$ rm -rf ${bindir:=.}/smpi_trace.trace $ rm -rf ${bindir:=.}/smpi_trace.trace_files diff --git a/examples/smpi/replay/replay-override-replayer.tesh b/examples/smpi/replay/replay-override-replayer.tesh new file mode 100644 index 0000000000..ba2986b199 --- /dev/null +++ b/examples/smpi/replay/replay-override-replayer.tesh @@ -0,0 +1,352 @@ +# use the tested library, not the installed one +# (since we want to pass it to the child, it has to be redefined before each command) +# Go for the first test + +p Test of trace replay with SMPI (one trace for all processes) + +< replay/actions_bcast.txt +$ mkfile replay/one_trace_override +! timeout 60 + +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +> [Tremblay:0:(1) 0.000000] [smpi_replay/VERBOSE] 0 bcast 5e4 0.000000 +> [Jupiter:1:(2) 0.015036] [smpi_replay/VERBOSE] 1 bcast 5e4 0.015036 +> [Fafard:2:(3) 0.015676] [smpi_replay/VERBOSE] 2 bcast 5e4 0.015676 +> [Jupiter:1:(2) 2.636405] [smpi_replay/VERBOSE] 1 compute 2e8 2.621369 +> [Tremblay:0:(1) 5.097100] [smpi_replay/VERBOSE] 0 compute 5e8 5.097100 +> [Tremblay:0:(1) 5.097100] [smpi_replay/VERBOSE] 0 bcast 5e4 0.000000 +> [Jupiter:1:(2) 5.112136] [smpi_replay/VERBOSE] 1 bcast 5e4 2.475730 +> [Fafard:2:(3) 6.569099] [smpi_replay/VERBOSE] 2 compute 5e8 6.553424 +> [Fafard:2:(3) 6.584775] [smpi_replay/VERBOSE] 2 bcast 5e4 0.015676 +> [Jupiter:1:(2) 7.733505] [smpi_replay/VERBOSE] 1 compute 2e8 2.621369 +> [Tremblay:0:(1) 10.194200] [smpi_replay/VERBOSE] 0 compute 5e8 5.097100 +> [Fafard:2:(3) 13.138198] [smpi_replay/VERBOSE] 2 compute 5e8 6.553424 +> [Jupiter:1:(2) 14.286929] [smpi_replay/VERBOSE] 1 reduce 5e4 5e8 6.553424 +> [Tremblay:0:(1) 18.250974] [smpi_replay/VERBOSE] 0 reduce 5e4 5e8 8.056774 +> [Fafard:2:(3) 19.691622] [smpi_replay/VERBOSE] 2 reduce 5e4 5e8 6.553424 +> [Fafard:2:(3) 19.691622] [smpi_replay/INFO] Simulation time 19.691622 + +$ rm -f replay/one_trace_override + +p The same with tracing activated + +< replay/actions_bcast.txt +$ mkfile replay/one_trace_override + +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=no_loc --cfg=tracing:yes --cfg=tracing/smpi:yes --cfg=tracing/smpi/computing:yes --cfg=tracing/filename:./simgrid_override.trace --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +> [Fafard:2:(3) 19.691622] [smpi_replay/INFO] Simulation time 19.691622 + +# $ rm -f replay/one_trace_override + +$ tail -n +3 ./simgrid_override.trace +> %EventDef PajeDefineContainerType 0 +> % Alias string +> % Type string +> % Name string +> %EndEventDef +> %EventDef PajeDefineVariableType 1 +> % Alias string +> % Type string +> % Name string +> % Color color +> %EndEventDef +> %EventDef PajeDefineStateType 2 +> % Alias string +> % Type string +> % Name string +> %EndEventDef +> %EventDef PajeDefineEventType 3 +> % Alias string +> % Type string +> % Name string +> %EndEventDef +> %EventDef PajeDefineLinkType 4 +> % Alias string +> % Type string +> % StartContainerType string +> % EndContainerType string +> % Name string +> %EndEventDef +> %EventDef PajeDefineEntityValue 5 +> % Alias string +> % Type string +> % Name string +> % Color color +> %EndEventDef +> %EventDef PajeCreateContainer 6 +> % Time date +> % Alias string +> % Type string +> % Container string +> % Name string +> %EndEventDef +> %EventDef PajeDestroyContainer 7 +> % Time date +> % Type string +> % Name string +> %EndEventDef +> %EventDef PajeSetVariable 8 +> % Time date +> % Type string +> % Container string +> % Value double +> %EndEventDef +> %EventDef PajeAddVariable 9 +> % Time date +> % Type string +> % Container string +> % Value double +> %EndEventDef +> %EventDef PajeSubVariable 10 +> % Time date +> % Type string +> % Container string +> % Value double +> %EndEventDef +> %EventDef PajeSetState 11 +> % Time date +> % Type string +> % Container string +> % Value string +> %EndEventDef +> %EventDef PajePushState 12 +> % Time date +> % Type string +> % Container string +> % Value string +> %EndEventDef +> %EventDef PajePopState 13 +> % Time date +> % Type string +> % Container string +> %EndEventDef +> %EventDef PajeResetState 14 +> % Time date +> % Type string +> % Container string +> %EndEventDef +> %EventDef PajeStartLink 15 +> % Time date +> % Type string +> % Container string +> % Value string +> % StartContainer string +> % Key string +> %EndEventDef +> %EventDef PajeEndLink 16 +> % Time date +> % Type string +> % Container string +> % Value string +> % EndContainer string +> % Key string +> %EndEventDef +> %EventDef PajeNewEvent 17 +> % Time date +> % Type string +> % Container string +> % Value string +> %EndEventDef +> 0 1 0 MPI +> 2 2 1 MPI_STATE +> 4 3 0 1 1 MPI_LINK +> 4 4 0 1 1 MIGRATE_LINK +> 2 5 1 MIGRATE_STATE +> 6 0.000000 1 1 0 "rank-1" +> 5 6 2 computing "0 1 1" +> 5 7 2 smpi_replay_run_init "0 1 0" +> 6 0.000000 2 1 0 "rank-2" +> 6 0.000000 3 1 0 "rank-3" +> 5 8 2 action_bcast "0 0.78 0.39" +> 12 0.000000 2 1 7 +> 13 0.000000 2 1 +> 12 0.000000 2 2 7 +> 13 0.000000 2 2 +> 12 0.000000 2 3 7 +> 13 0.000000 2 3 +> 12 0.000000 2 1 8 +> 12 0.000000 2 2 8 +> 12 0.000000 2 3 8 +> 13 0.000000 2 1 +> 12 0.000000 2 1 6 +> 5 9 2 action_reduce "0 1 0" +> 5 10 2 smpi_replay_run_finalize "0 1 0" +> 13 0.015036 2 2 +> 12 0.015036 2 2 6 +> 13 0.015676 2 3 +> 12 0.015676 2 3 6 +> 13 2.636405 2 2 +> 12 2.636405 2 2 8 +> 13 5.097100 2 1 +> 12 5.097100 2 1 8 +> 13 5.097100 2 1 +> 12 5.097100 2 1 6 +> 13 5.112136 2 2 +> 12 5.112136 2 2 6 +> 13 6.569099 2 3 +> 12 6.569099 2 3 8 +> 13 6.584775 2 3 +> 12 6.584775 2 3 6 +> 13 7.733505 2 2 +> 12 7.733505 2 2 9 +> 13 10.194200 2 1 +> 12 10.194200 2 1 9 +> 13 13.138198 2 3 +> 12 13.138198 2 3 9 +> 13 14.286929 2 2 +> 12 14.286929 2 2 10 +> 13 18.250974 2 1 +> 12 18.250974 2 1 10 +> 13 19.691622 2 3 +> 12 19.691622 2 3 10 +> 13 19.691622 2 3 +> 7 19.691622 1 3 +> 13 19.691622 2 2 +> 7 19.691622 1 2 +> 13 19.691622 2 1 +> 7 19.691622 1 1 + +$ rm -f ./simgrid_override.trace + +p Another test of trace replay with SMPI (one trace per process) + +< replay/actions0.txt +< replay/actions1.txt +$ mkfile ./split_traces_tesh_override + +$ ../../smpi_script/bin/smpirun -no-privatize -replay ./split_traces_tesh_override --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +> [Tremblay:0:(1) 0.167158] [smpi_replay/VERBOSE] 0 send 1 0 1e6 0.167158 +> [Jupiter:1:(2) 0.167158] [smpi_replay/VERBOSE] 1 recv 0 0 1e6 0.167158 +> [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 compute 1e9 13.106847 +> [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 isend 0 1 1e6 0.000000 +> [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 irecv 0 2 1e6 0.000000 +> [Tremblay:0:(1) 13.441162] [smpi_replay/VERBOSE] 0 recv 1 1 1e6 13.274005 +> [Jupiter:1:(2) 13.608320] [smpi_replay/VERBOSE] 1 wait 0 1 2 0.334315 +> [Tremblay:0:(1) 13.608320] [smpi_replay/VERBOSE] 0 send 1 2 1e6 0.167158 +> [Jupiter:1:(2) 13.608320] [smpi_replay/INFO] Simulation time 13.608320 + +$ rm -f ./split_traces_tesh_override + +p Test of barrier replay with SMPI (one trace for all processes) + +< replay/actions_barrier.txt +$ mkfile replay/one_trace_override + +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +> [Tremblay:0:(1) 1.518421] [smpi_replay/VERBOSE] 0 send 1 0 1e7 1.518421 +> [Jupiter:1:(2) 1.518421] [smpi_replay/VERBOSE] 1 recv 0 0 1e7 1.518421 +> [Tremblay:0:(1) 1.520397] [smpi_replay/VERBOSE] 0 barrier 0.001976 +> [Jupiter:1:(2) 1.521858] [smpi_replay/VERBOSE] 1 barrier 0.003438 +> [Fafard:2:(3) 1.522373] [smpi_replay/VERBOSE] 2 barrier 1.522373 +> [Tremblay:0:(1) 2.520397] [smpi_replay/VERBOSE] 0 compute 98095000 1.000000 +> [Jupiter:1:(2) 2.521858] [smpi_replay/VERBOSE] 1 compute 76296000 1.000000 +> [Fafard:2:(3) 2.522373] [smpi_replay/VERBOSE] 2 compute 76296000 1.000000 +> [Fafard:2:(3) 2.522373] [smpi_replay/INFO] Simulation time 2.522373 + +$ rm -f replay/one_trace_override + +p Test of isend replay with SMPI (one trace for all processes) + +< replay/actions_with_isend.txt +$ mkfile replay/one_trace_override + +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +> [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 irecv 0 0 1e6 0.000000 +> [Jupiter:1:(2) 6.553424] [smpi_replay/VERBOSE] 1 compute 5e8 6.553424 +> [Jupiter:1:(2) 6.553524] [smpi_replay/VERBOSE] 1 test 0 1 0 0.000100 +> [Tremblay:0:(1) 10.194200] [smpi_replay/VERBOSE] 0 compute 1e9 10.194200 +> [Tremblay:0:(1) 10.361357] [smpi_replay/VERBOSE] 0 send 1 0 1e6 0.167158 +> [Jupiter:1:(2) 13.106947] [smpi_replay/VERBOSE] 1 compute 5e8 6.553424 +> [Jupiter:1:(2) 13.106947] [smpi_replay/VERBOSE] 1 wait 0 1 0 0.000000 +> [Tremblay:0:(1) 20.555557] [smpi_replay/VERBOSE] 0 compute 1e9 10.194200 +> [Fafard:2:(3) 26.213694] [smpi_replay/VERBOSE] 2 compute 2e9 26.213694 +> [Fafard:2:(3) 26.213694] [smpi_replay/VERBOSE] 2 irecv 1 1 1e6 0.000000 +> [Jupiter:1:(2) 26.403860] [smpi_replay/VERBOSE] 1 send 2 1 1e6 13.296913 +> [Fafard:2:(3) 29.490406] [smpi_replay/VERBOSE] 2 compute 2.5e8 3.276712 +> [Fafard:2:(3) 29.490606] [smpi_replay/VERBOSE] 2 test 1 2 1 0.000200 +> [Fafard:2:(3) 32.767318] [smpi_replay/VERBOSE] 2 compute 2.5e8 3.276712 +> [Fafard:2:(3) 32.767318] [smpi_replay/VERBOSE] 2 wait 1 2 1 0.000000 +> [Fafard:2:(3) 32.767318] [smpi_replay/VERBOSE] 2 isend 0 2 1e6 0.000000 +> [Tremblay:0:(1) 32.923014] [smpi_replay/VERBOSE] 0 recv 2 2 1e6 12.367458 +> [Fafard:2:(3) 39.320741] [smpi_replay/VERBOSE] 2 compute 5e8 6.553424 +> [Fafard:2:(3) 39.320741] [smpi_replay/INFO] Simulation time 39.320741 + +$ rm -f replay/one_trace_override + +p Test of AllReduce replay with SMPI (one trace for all processes) + +< replay/actions_allreduce.txt +$ mkfile replay/one_trace_override + +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +> [Tremblay:0:(1) 5.112775] [smpi_replay/VERBOSE] 0 allreduce 5e4 5e8 5.112775 +> [Jupiter:1:(2) 6.584135] [smpi_replay/VERBOSE] 1 allreduce 5e4 5e8 6.584135 +> [Fafard:2:(3) 6.584775] [smpi_replay/VERBOSE] 2 allreduce 5e4 5e8 6.584775 +> [Tremblay:0:(1) 10.209875] [smpi_replay/VERBOSE] 0 compute 5e8 5.097100 +> [Jupiter:1:(2) 13.137559] [smpi_replay/VERBOSE] 1 compute 5e8 6.553424 +> [Fafard:2:(3) 13.138198] [smpi_replay/VERBOSE] 2 compute 5e8 6.553424 +> [Fafard:2:(3) 13.138198] [smpi_replay/INFO] Simulation time 13.138198 + +$ rm -f replay/one_trace_override + +p Test of AllToAll replay with SMPI (one trace for all processes) + +< replay/actions_alltoall.txt +$ mkfile replay/one_trace_override + +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +> [Tremblay:0:(1) 0.004041] [smpi_replay/VERBOSE] 0 alltoall 500 500 0.004041 +> [Fafard:2:(3) 0.006920] [smpi_replay/VERBOSE] 2 alltoall 500 500 0.006920 +> [Jupiter:1:(2) 0.006920] [smpi_replay/VERBOSE] 1 alltoall 500 500 0.006920 +> [Jupiter:1:(2) 0.006920] [smpi_replay/INFO] Simulation time 0.006920 + + + +$ rm -f replay/one_trace_override + +p Test of AllToAllv replay with SMPI (one trace for all processes) + +< replay/actions_alltoallv.txt +$ mkfile replay/one_trace_override + +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +> [Tremblay:0:(1) 0.004000] [smpi_replay/VERBOSE] 0 alltoallv 100 1 40 30 1000 1 80 100 0.004000 +> [Jupiter:1:(2) 0.006935] [smpi_replay/VERBOSE] 1 alltoallv 1000 80 1 40 1000 40 1 30 0.006935 +> [Fafard:2:(3) 0.006936] [smpi_replay/VERBOSE] 2 alltoallv 1000 100 30 1 1000 30 40 1 0.006936 +> [Fafard:2:(3) 0.006936] [smpi_replay/INFO] Simulation time 0.006936 + +$ rm -f replay/one_trace_override + +p Test of AllGatherv replay with SMPI (one trace for all processes) + +< replay/actions_allgatherv.txt +$ mkfile replay/one_trace_override + +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 4 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +> [Tremblay:0:(1) 1.397261] [smpi_replay/VERBOSE] 0 allgatherv 275427 275427 275427 275427 204020 0 0 1.397261 +> [Ginette:3:(4) 1.760421] [smpi_replay/VERBOSE] 3 allgatherv 204020 275427 275427 275427 204020 0 0 1.760421 +> [Fafard:2:(3) 1.941986] [smpi_replay/VERBOSE] 2 allgatherv 275427 275427 275427 275427 204020 0 0 1.941986 +> [Jupiter:1:(2) 1.941986] [smpi_replay/VERBOSE] 1 allgatherv 275427 275427 275427 275427 204020 0 0 1.941986 +> [Jupiter:1:(2) 1.941986] [smpi_replay/INFO] Simulation time 1.941986 + +$ rm -f replay/one_trace_override + +p Test of waitall replay with SMPI (one trace for all processes) + +< replay/actions_waitall.txt +$ mkfile replay/one_trace_override + +! output sort 19 +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +> [Fafard:2:(3) 0.000000] [smpi_replay/VERBOSE] 2 irecv 1 1 3000 0.000000 +> [Fafard:2:(3) 0.000000] [smpi_replay/VERBOSE] 2 isend 0 2 3000 0.000000 +> [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 isend 0 0 2000 0.000000 +> [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 isend 2 1 3000 0.000000 +> [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 waitall 0.000000 +> [Tremblay:0:(1) 0.000000] [smpi_replay/VERBOSE] 0 irecv 1 0 2000 0.000000 +> [Tremblay:0:(1) 0.000000] [smpi_replay/VERBOSE] 0 irecv 2 2 3000 0.000000 +> [Tremblay:0:(1) 0.003787] [smpi_replay/VERBOSE] 0 waitall 0.003787 +> [Fafard:2:(3) 0.006220] [smpi_replay/VERBOSE] 2 waitall 0.006220 +> [Fafard:2:(3) 0.006220] [smpi_replay/INFO] Simulation time 0.006220 + +$ rm -f replay/one_trace_override diff --git a/examples/smpi/replay/replay.tesh b/examples/smpi/replay/replay.tesh index 49560a8dae..e274b1425e 100644 --- a/examples/smpi/replay/replay.tesh +++ b/examples/smpi/replay/replay.tesh @@ -8,7 +8,7 @@ p Test of trace replay with SMPI (one trace for all processes) $ mkfile replay/one_trace ! timeout 60 -$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [Tremblay:0:(1) 0.000000] [smpi_replay/VERBOSE] 0 bcast 5e4 0.000000 > [Jupiter:1:(2) 0.015036] [smpi_replay/VERBOSE] 1 bcast 5e4 0.015036 > [Fafard:2:(3) 0.015676] [smpi_replay/VERBOSE] 2 bcast 5e4 0.015676 @@ -33,7 +33,7 @@ p The same with tracing activated < replay/actions_bcast.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=no_loc --cfg=tracing:yes --cfg=tracing/smpi:yes --cfg=tracing/smpi/computing:yes --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=no_loc --cfg=tracing:yes --cfg=tracing/smpi:yes --cfg=tracing/smpi/computing:yes --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [Fafard:2:(3) 19.691622] [smpi_replay/INFO] Simulation time 19.691622 $ rm -f replay/one_trace @@ -214,7 +214,7 @@ p Another test of trace replay with SMPI (one trace per process) < replay/actions1.txt $ mkfile ./split_traces_tesh -$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay ./split_traces_tesh --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ../../smpi_script/bin/smpirun -no-privatize -replay ./split_traces_tesh --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [Tremblay:0:(1) 0.167158] [smpi_replay/VERBOSE] 0 send 1 0 1e6 0.167158 > [Jupiter:1:(2) 0.167158] [smpi_replay/VERBOSE] 1 recv 0 0 1e6 0.167158 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 compute 1e9 13.106847 @@ -232,7 +232,7 @@ p Test of barrier replay with SMPI (one trace for all processes) < replay/actions_barrier.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [Tremblay:0:(1) 1.518421] [smpi_replay/VERBOSE] 0 send 1 0 1e7 1.518421 > [Jupiter:1:(2) 1.518421] [smpi_replay/VERBOSE] 1 recv 0 0 1e7 1.518421 > [Tremblay:0:(1) 1.520397] [smpi_replay/VERBOSE] 0 barrier 0.001976 @@ -250,7 +250,7 @@ p Test of isend replay with SMPI (one trace for all processes) < replay/actions_with_isend.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 irecv 0 0 1e6 0.000000 > [Jupiter:1:(2) 6.553424] [smpi_replay/VERBOSE] 1 compute 5e8 6.553424 > [Jupiter:1:(2) 6.553524] [smpi_replay/VERBOSE] 1 test 0 1 0 0.000100 @@ -278,7 +278,7 @@ p Test of AllReduce replay with SMPI (one trace for all processes) < replay/actions_allreduce.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [Tremblay:0:(1) 5.112775] [smpi_replay/VERBOSE] 0 allreduce 5e4 5e8 5.112775 > [Jupiter:1:(2) 6.584135] [smpi_replay/VERBOSE] 1 allreduce 5e4 5e8 6.584135 > [Fafard:2:(3) 6.584775] [smpi_replay/VERBOSE] 2 allreduce 5e4 5e8 6.584775 @@ -294,7 +294,7 @@ p Test of AllToAll replay with SMPI (one trace for all processes) < replay/actions_alltoall.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [Tremblay:0:(1) 0.004041] [smpi_replay/VERBOSE] 0 alltoall 500 500 0.004041 > [Fafard:2:(3) 0.006920] [smpi_replay/VERBOSE] 2 alltoall 500 500 0.006920 > [Jupiter:1:(2) 0.006920] [smpi_replay/VERBOSE] 1 alltoall 500 500 0.006920 @@ -309,7 +309,7 @@ p Test of AllToAllv replay with SMPI (one trace for all processes) < replay/actions_alltoallv.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [Tremblay:0:(1) 0.004000] [smpi_replay/VERBOSE] 0 alltoallv 100 1 40 30 1000 1 80 100 0.004000 > [Jupiter:1:(2) 0.006935] [smpi_replay/VERBOSE] 1 alltoallv 1000 80 1 40 1000 40 1 30 0.006935 > [Fafard:2:(3) 0.006936] [smpi_replay/VERBOSE] 2 alltoallv 1000 100 30 1 1000 30 40 1 0.006936 @@ -322,7 +322,7 @@ p Test of AllGatherv replay with SMPI (one trace for all processes) < replay/actions_allgatherv.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 4 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 4 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [Tremblay:0:(1) 1.397261] [smpi_replay/VERBOSE] 0 allgatherv 275427 275427 275427 275427 204020 0 0 1.397261 > [Ginette:3:(4) 1.760421] [smpi_replay/VERBOSE] 3 allgatherv 204020 275427 275427 275427 204020 0 0 1.760421 > [Fafard:2:(3) 1.941986] [smpi_replay/VERBOSE] 2 allgatherv 275427 275427 275427 275427 204020 0 0 1.941986 @@ -337,7 +337,7 @@ p Test of waitall replay with SMPI (one trace for all processes) $ mkfile replay/one_trace ! output sort 19 -$ ../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [Fafard:2:(3) 0.000000] [smpi_replay/VERBOSE] 2 irecv 1 1 3000 0.000000 > [Fafard:2:(3) 0.000000] [smpi_replay/VERBOSE] 2 isend 0 2 3000 0.000000 > [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 isend 0 0 2000 0.000000 diff --git a/src/smpi/smpi_replay_main.cpp b/src/smpi/smpi_replay_main.cpp new file mode 100644 index 0000000000..72898c5ca7 --- /dev/null +++ b/src/smpi/smpi_replay_main.cpp @@ -0,0 +1,40 @@ +#include "simgrid/s4u.hpp" +#include "smpi/smpi.h" +#include "xbt/asserts.h" +#include "xbt/replay.hpp" +#include "xbt/str.h" + +int main(int argc, char* argv[]) +{ + if (simgrid::s4u::Actor::self().get() == nullptr) { + printf("smpireplaymain should not be called directly. Please use smpirun -replay instead.\n"); + return 1; + } + + auto properties = simgrid::s4u::Actor::self()->get_properties(); + if (properties->find("smpi_replay") == properties->end()) { + printf("invalid smpireplaymain execution. Please use smpirun -replay instead.\n"); + return 1; + } + + const char* instance_id = properties->at("instance_id").c_str(); + const int rank = xbt_str_parse_int(properties->at("rank").c_str(), "Cannot parse rank"); + const char* trace_filename = argv[1]; + double start_delay_flops = 0; + + if (argc > 2) { + start_delay_flops = xbt_str_parse_double(argv[2], "Cannot parse start_delay_flops"); + } + + /* Setup things and register default actions */ + smpi_replay_init(instance_id, rank, start_delay_flops); + + /* A small check, just to make sure SMPI ranks are consistent with input arguments */ + int new_rank; + MPI_Comm_rank(MPI_COMM_WORLD, &new_rank); + xbt_assert(new_rank == rank, "Rank inconsistency. Got %d, expected %d", new_rank, rank); + + /* The regular run of the replayer */ + smpi_replay_main(rank, trace_filename); + return 0; +} diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 5b2b05350a..0cc32e9c1d 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -31,6 +31,7 @@ SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI" usage () { cat < -hostfile program [program-options] + $0 [OPTIONS] -platform -hostfile -replay [program] [program-options] Options: -keep-temps # don't remove the generated files after execution -wrapper # use command to run the program (e.g. "valgrind" or "gdb --args") @@ -45,7 +46,7 @@ Options: -trace-grouped # group MPI processes by location -trace-resource # trace resource utilization -trace-file # name of the tracefile (simgrid_smpi.trace) - -ext # additional parameter (reserved) + -replay # replays a trace instead of actually executing an application -version # Displays the SimGrid version (human readable) -git-version # Displays the git hash of SimGrid @@ -63,7 +64,6 @@ then exit fi -EXTOPT="" WRAPPER="" HOSTFILE="" HOSTFILETMP=0 @@ -153,8 +153,8 @@ while true; do fi shift 2 ;; - "-ext") - EXTOPT="$2" + "-replay") + APP_TRACES="$2" shift 2 ;; "-no-privatize") @@ -232,16 +232,25 @@ while true; do esac done -# check if we still have at least one parameter beyond options -if [ $# -eq 0 ] -then - echo "Error: no program to execute!" - usage - exit -fi +if [ -n "${APP_TRACES}" ] ; then + if [ $# -eq 0 ] ; then + EXEC="@SMPIREPLAYMAIN@" + else + EXEC="$1" + shift + fi +else + # check if we still have at least one parameter beyond options + if [ $# -eq 0 ] + then + echo "Error: no program to execute!" + usage + exit + fi -EXEC="$1" -shift + EXEC="$1" + shift +fi # steel --cfg and --logs options while [ $# -gt 0 ]; do @@ -374,9 +383,8 @@ if [ -n "${HOSTFILE}" ] && [ -f ${HOSTFILE} ]; then hostnames=$(cat ${HOSTFILE} | tr '\n\r' ' ') fi -if [ "${EXTOPT}" = "smpi_replay" ]; then - APP_TRACES=$PROC_ARGS - if [ -n "${APP_TRACES}" ] && [ -f "${APP_TRACES}" ]; then +if [ -n "${APP_TRACES}" ]; then + if [ -f "${APP_TRACES}" ]; then hosttraces=$(cat ${APP_TRACES} | tr '\n\r' ' ' ) NUMTRACES=$(cat ${APP_TRACES} | wc -l) REPLAY=1 @@ -427,6 +435,7 @@ do " >> ${APPLICATIONTMP} if [ ${REPLAY} = 1 ]; then + echo " " >> ${APPLICATIONTMP} if [ ${NUMTRACES} -gt 1 ]; then echo " " >> ${APPLICATIONTMP} else diff --git a/teshsuite/smpi/pt2pt-pingpong/TI_output.tesh b/teshsuite/smpi/pt2pt-pingpong/TI_output.tesh index d7b0e7cbcb..91d3dec6df 100644 --- a/teshsuite/smpi/pt2pt-pingpong/TI_output.tesh +++ b/teshsuite/smpi/pt2pt-pingpong/TI_output.tesh @@ -34,7 +34,7 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename > [rank 2] -> Fafard > [rank 3] -> Ginette -$ ${bindir:=.}/../../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=smpi/simulate-computation:no -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ${bindir:=.}/../../../smpi_script/bin/smpirun -no-privatize -replay ./out_in_ti.txt --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=smpi/simulate-computation:no -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard @@ -125,7 +125,7 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename > [rank 2] -> Fafard > [rank 3] -> Ginette -$ ${bindir:=.}/../../../smpi_script/bin/smpirun -no-privatize -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=tracing/smpi/format/ti-one-file:yes -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +$ ${bindir:=.}/../../../smpi_script/bin/smpirun -no-privatize -replay ./out_in_ti.txt --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=tracing/smpi/format/ti-one-file:yes -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 8b92768ff5..754f638558 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -32,6 +32,8 @@ set(EXTRA_DIST src/smpi/colls/smpi_mvapich2_selector_stampede.hpp src/smpi/include/private.hpp src/smpi/include/smpi_utils.hpp + src/smpi/smpi_main.c + src/smpi/smpi_replay_main.cpp src/surf/cpu_cas01.hpp src/surf/cpu_interface.hpp src/surf/cpu_ti.hpp @@ -90,7 +92,6 @@ set(EXTRA_DIST ) set(SMPI_SRC - src/smpi/smpi_main.c src/smpi/bindings/smpi_mpi.cpp src/smpi/bindings/smpi_pmpi.cpp src/smpi/bindings/smpi_pmpi_coll.cpp diff --git a/tools/cmake/MakeLib.cmake b/tools/cmake/MakeLib.cmake index aa7aeac67f..f937e5ac42 100644 --- a/tools/cmake/MakeLib.cmake +++ b/tools/cmake/MakeLib.cmake @@ -5,8 +5,8 @@ set(CMAKE_MACOSX_RPATH TRUE) if(APPLE) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # When installed, use system path - set(CMAKE_SKIP_BUILD_RPATH FALSE) # When executing from build tree, take the lib from the build path if exists - set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) # When executing from build tree, take the lib from the system path if exists + set(CMAKE_SKIP_BUILD_RPATH FALSE) # When executing from build tree, take the lib from the build path if exists + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) # When executing from build tree, take the lib from the system path if exists # add the current location of libsimgrid-java.dynlib as a location for libsimgrid.dynlib # (useful when unpacking the native libraries from the jarfile) @@ -88,6 +88,7 @@ if(enable_smpi) if(NOT ${DL_LIBRARY} STREQUAL "") set(SIMGRID_DEP "${SIMGRID_DEP} ${DL_LIBRARY}") # for privatization endif() + add_executable(smpimain src/smpi/smpi_main.c) target_link_libraries(smpimain simgrid) set_target_properties(smpimain @@ -95,6 +96,14 @@ if(enable_smpi) install(TARGETS smpimain # install that binary without breaking the rpath on Mac RUNTIME DESTINATION lib/simgrid) + add_executable(smpireplaymain src/smpi/smpi_replay_main.cpp) + target_compile_options(smpireplaymain PRIVATE -fpic) + target_link_libraries(smpireplaymain simgrid -shared) + set_target_properties(smpireplaymain + PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/simgrid) + install(TARGETS smpireplaymain # install that binary without breaking the rpath on Mac + RUNTIME DESTINATION lib/simgrid) + if(SMPI_FORTRAN) if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") SET(SIMGRID_DEP "${SIMGRID_DEP} -lgfortran")