Also add a variant with s4u::Link, when you don't want to specify the directions
on symmetric routes.
+SMPI:
+ - New SMPI_app_instance_join(): wait for the completion of a started MPI instance
+
Python:
- Make the host_load plugin available from Python. See examples/python/plugin-host-load
SMPI_app_instance_start("alltoall_mpi", alltoall_mpi,
{e.host_by_name_or_null("Ginette"), e.host_by_name_or_null("Bourassa"),
e.host_by_name_or_null("Jupiter"), e.host_by_name_or_null("Fafard")});
+ SMPI_app_instance_join("alltoall_mpi");
+ XBT_INFO("This other alltoall_mpi instance terminated.");
});
+
e.run();
XBT_INFO("Simulation time %g", simgrid::s4u::Engine::get_clock());
> [Ginette:alltoall_mpi#0:(11) 10.036773] [smpi_masterworkers/INFO] after alltoall 0
> [Bourassa:alltoall_mpi#1:(12) 10.046578] [smpi_masterworkers/INFO] after alltoall 1
> [Fafard:alltoall_mpi#3:(14) 10.046865] [smpi_masterworkers/INFO] after alltoall 3
-> [Jupiter:alltoall_mpi#2:(13) 10.046865] [smpi_masterworkers/INFO] after alltoall 2
\ No newline at end of file
+> [Jupiter:alltoall_mpi#2:(13) 10.046865] [smpi_masterworkers/INFO] after alltoall 2
+> [Ginette:launcher:(10) 10.046865] [smpi_masterworkers/INFO] This other alltoall_mpi instance terminated.
\ No newline at end of file
#ifdef __cplusplus
XBT_PUBLIC void SMPI_app_instance_start(const char* name, std::function<void()> const& code,
std::vector<simgrid::s4u::Host*> const& hosts);
+XBT_PUBLIC void SMPI_app_instance_join(const std::string& instance_id);
/* This version without parameter is nice to use with SMPI_app_instance_start() */
XBT_PUBLIC void MPI_Init();
rank++;
}
}
+void SMPI_app_instance_join(const std::string& instance_id)
+{
+ std::vector<simgrid::s4u::ActorPtr> actors =
+ simgrid::s4u::Engine::get_instance()->get_filtered_actors([instance_id](simgrid::s4u::ActorPtr act) {
+ auto* actor_instance = act->get_property("instance_id");
+ return actor_instance != nullptr && strcmp(actor_instance, instance_id.c_str()) == 0;
+ });
+
+ for (auto& act : actors)
+ act->join();
+}
void smpi_deployment_register_process(const std::string& instance_id, int rank, const simgrid::s4u::Actor* actor)
{