Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SAMPI] Move ampi signals to simgrid::smpi::plugin::ampi
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 2 Aug 2018 15:29:30 +0000 (17:29 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 2 Aug 2018 19:55:54 +0000 (21:55 +0200)
This will still not build, but it is simpler to to see the changes with smaller commits

src/smpi/plugins/ampi/ampi.cpp
src/smpi/plugins/ampi/ampi.hpp [new file with mode: 0644]
src/smpi/plugins/sampi_loadbalancer.cpp

index e743c3b..80fa3d5 100644 (file)
@@ -3,6 +3,8 @@
 #include <smpi/sampi.h>
 #include <src/smpi/include/smpi_comm.hpp>
 #include <src/smpi/include/smpi_actor.hpp>
+#include <src/smpi/plugins/ampi/instr_ampi.hpp>
+#include <src/instr/instr_smpi.hpp>
 #include <xbt/replay.hpp>
 
 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<void(simgrid::s4u::ActorPtr)> on_iteration_in;
+  simgrid::xbt::signal<void(simgrid::s4u::ActorPtr)> 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 (file)
index 0000000..0685cee
--- /dev/null
@@ -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 <simgrid/s4u.hpp>
+
+namespace simgrid {
+namespace smpi {
+namespace plugin {
+namespace ampi {
+  extern simgrid::xbt::signal<void(simgrid::s4u::ActorPtr)> on_iteration_out;
+  extern simgrid::xbt::signal<void(simgrid::s4u::ActorPtr)> on_iteration_in;
+}
+}
+}
+}
+
index 926ad87..1450a6f 100644 (file)
@@ -9,6 +9,8 @@
 #include <smpi/smpi.h>
 #include <src/smpi/include/smpi_comm.hpp>
 #include <src/smpi/include/smpi_actor.hpp>
+#include <src/smpi/plugins/ampi/instr_ampi.hpp>
+#include <src/smpi/plugins/ampi/ampi.hpp>
 #include <xbt/replay.hpp>
 
 #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])));
 }
 }
 }