From 181823a28f9e67fec70e2e24dd45b92449808e4b Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Wed, 18 Apr 2018 18:49:58 +0200 Subject: [PATCH 1/1] [SMPI] Instr: Add MIGRATE states for SMPI/LB. This will probably need to move elsewhere as well. --- examples/smpi/replay/replay.tesh | 54 ++++++++++--------- .../trace_call_location.tesh | 2 +- src/surf/instr_routing.cpp | 12 ++++- 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/examples/smpi/replay/replay.tesh b/examples/smpi/replay/replay.tesh index 6fd2182d2b..56caba581a 100644 --- a/examples/smpi/replay/replay.tesh +++ b/examples/smpi/replay/replay.tesh @@ -150,53 +150,55 @@ $ tail -n +3 ./simgrid.trace > 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 4 2 computing "0 1 1" -> 5 5 2 smpi_replay_run_init "0 1 0" +> 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" -> 12 0.000000 2 1 5 +> 12 0.000000 2 1 7 > 13 0.000000 2 1 -> 12 0.000000 2 2 5 +> 12 0.000000 2 2 7 > 13 0.000000 2 2 -> 12 0.000000 2 3 5 +> 12 0.000000 2 3 7 > 13 0.000000 2 3 -> 5 6 2 action_bcast "0 0.78 0.39" -> 12 0.000000 2 1 6 -> 12 0.000000 2 2 6 -> 12 0.000000 2 3 6 +> 5 8 2 action_bcast "0 0.78 0.39" +> 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 4 +> 12 0.000000 2 1 6 > 13 0.015036 2 2 -> 12 0.015036 2 2 4 +> 12 0.015036 2 2 6 > 13 0.015676 2 3 -> 12 0.015676 2 3 4 +> 12 0.015676 2 3 6 > 13 2.636405 2 2 -> 12 2.636405 2 2 6 +> 12 2.636405 2 2 8 > 13 5.097100 2 1 -> 12 5.097100 2 1 6 +> 12 5.097100 2 1 8 > 13 5.097100 2 1 -> 12 5.097100 2 1 4 -> 5 7 2 action_reduce "0 1 0" +> 12 5.097100 2 1 6 +> 5 9 2 action_reduce "0 1 0" > 13 5.112136 2 2 -> 12 5.112136 2 2 4 +> 12 5.112136 2 2 6 > 13 6.569099 2 3 -> 12 6.569099 2 3 6 +> 12 6.569099 2 3 8 > 13 6.584775 2 3 -> 12 6.584775 2 3 4 +> 12 6.584775 2 3 6 > 13 7.733505 2 2 -> 12 7.733505 2 2 7 +> 12 7.733505 2 2 9 > 13 10.194200 2 1 -> 12 10.194200 2 1 7 +> 12 10.194200 2 1 9 > 13 13.138198 2 3 -> 12 13.138198 2 3 7 -> 5 8 2 smpi_replay_run_finalize "0 1 0" +> 12 13.138198 2 3 9 +> 5 10 2 smpi_replay_run_finalize "0 1 0" > 13 14.286929 2 2 -> 12 14.286929 2 2 8 +> 12 14.286929 2 2 10 > 13 18.250974 2 1 -> 12 18.250974 2 1 8 +> 12 18.250974 2 1 10 > 13 19.691622 2 3 -> 12 19.691622 2 3 8 +> 12 19.691622 2 3 10 > 13 19.691622 2 3 > 7 19.691622 1 3 > 13 19.691622 2 2 diff --git a/examples/smpi/trace_call_location/trace_call_location.tesh b/examples/smpi/trace_call_location/trace_call_location.tesh index b8cf961816..dc392a20f1 100644 --- a/examples/smpi/trace_call_location/trace_call_location.tesh +++ b/examples/smpi/trace_call_location/trace_call_location.tesh @@ -6,6 +6,6 @@ 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 -$ grep --quiet "12 0.* 2 1 5 .*trace_call_location\.c\" 14$" ${bindir:=.}/smpi_trace.trace +$ grep --quiet "12 0.* 2 1 7 .*trace_call_location\.c\" 14$" ${bindir:=.}/smpi_trace.trace $ rm -f ${bindir:=.}/smpi_trace.trace diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index a3070cb6db..835aee20f9 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -162,6 +162,9 @@ static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone) if (not TRACE_smpi_is_grouped()) mpi->getOrCreateStateType("MPI_STATE"); root->type_->getOrCreateLinkType("MPI_LINK", mpi, mpi); + // TODO See if we can move this to the LoadBalancer plugin + root->type_->getOrCreateLinkType("MIGRATE_LINK", mpi, mpi); + mpi->getOrCreateStateType("MIGRATE_STATE"); } if (TRACE_needs_platform()){ @@ -219,8 +222,13 @@ static void sg_instr_new_host(simgrid::s4u::Host& host) if (TRACE_uncategorized()) container->type_->getOrCreateVariableType("power_used", "0.5 0.5 0.5"); - if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()) - container->type_->getOrCreateContainerType("MPI")->getOrCreateStateType("MPI_STATE"); + if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()) { + simgrid::instr::ContainerType* mpi = container->type_->getOrCreateContainerType("MPI"); + mpi->getOrCreateStateType("MPI_STATE"); + // TODO See if we can move this to the LoadBalancer plugin + root->type_->getOrCreateLinkType("MIGRATE_LINK", mpi, mpi); + mpi->getOrCreateStateType("MIGRATE_STATE"); + } if (TRACE_actor_is_enabled()) { simgrid::instr::ContainerType* actor = container->type_->getOrCreateContainerType("ACTOR"); -- 2.20.1