From: Christian Heinrich Date: Thu, 2 Aug 2018 15:29:30 +0000 (+0200) Subject: [SAMPI] Move ampi signals to simgrid::smpi::plugin::ampi X-Git-Tag: v3_21~321 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3a3154dd12267caf08d76df3f9c5458c9489b3a3?hp=61084fdc1e2f405d26e40050355ddbe063c0f404 [SAMPI] Move ampi signals to simgrid::smpi::plugin::ampi This will still not build, but it is simpler to to see the changes with smaller commits --- diff --git a/src/smpi/plugins/ampi/ampi.cpp b/src/smpi/plugins/ampi/ampi.cpp index e743c3b3a5..80fa3d58d6 100644 --- a/src/smpi/plugins/ampi/ampi.cpp +++ b/src/smpi/plugins/ampi/ampi.cpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(plugin_pampi, smpi, "Logging specific to the AMPI functions"); @@ -30,6 +32,17 @@ extern "C" void _sampi_free(void* ptr) __libc_free(ptr); } +namespace simgrid { +namespace smpi { +namespace plugin { +namespace ampi { + simgrid::xbt::signal on_iteration_in; + simgrid::xbt::signal on_iteration_out; +} +} +} +} + /* FIXME The following contains several times "rank() + 1". This works for one * instance, but we need to find a way to deal with this for several instances and * for daemons: If we just replace this with the process id, we will get id's that diff --git a/src/smpi/plugins/ampi/ampi.hpp b/src/smpi/plugins/ampi/ampi.hpp new file mode 100644 index 0000000000..0685cee29f --- /dev/null +++ b/src/smpi/plugins/ampi/ampi.hpp @@ -0,0 +1,18 @@ +/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + +#include + +namespace simgrid { +namespace smpi { +namespace plugin { +namespace ampi { + extern simgrid::xbt::signal on_iteration_out; + extern simgrid::xbt::signal on_iteration_in; +} +} +} +} + diff --git a/src/smpi/plugins/sampi_loadbalancer.cpp b/src/smpi/plugins/sampi_loadbalancer.cpp index 926ad87ff0..1450a6f652 100644 --- a/src/smpi/plugins/sampi_loadbalancer.cpp +++ b/src/smpi/plugins/sampi_loadbalancer.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include "src/kernel/activity/ExecImpl.hpp" @@ -109,14 +111,15 @@ void action_iteration_in(simgrid::xbt::ReplayAction& action) { CHECK_ACTION_PARAMS(action, 0, 0) TRACE_Iteration_in(simgrid::s4u::this_actor::get_pid(), nullptr); + simgrid::smpi::plugin::ampi::on_iteration_in(MPI_COMM_WORLD->group()->actor(std::stol(action[0]))); } -// FIXME Move declaration XBT_PRIVATE void action_iteration_out(simgrid::xbt::ReplayAction& action); void action_iteration_out(simgrid::xbt::ReplayAction& action) { CHECK_ACTION_PARAMS(action, 0, 0) TRACE_Iteration_out(simgrid::s4u::this_actor::get_pid(), nullptr); + simgrid::smpi::plugin::ampi::on_iteration_out(MPI_COMM_WORLD->group()->actor(std::stol(action[0]))); } } }