const std::string name_;
unsigned int size_;
- std::vector<simgrid::s4u::ActorPtr> present_processes_;
unsigned int finalized_ranks_ = 0;
MPI_Comm comm_world_;
};
if (code != nullptr) // When started with smpirun, we will not execute a function
simgrid::s4u::Engine::get_instance()->register_function(name, code);
- static bool already_called = false;
- if (not already_called) {
- already_called = true;
- for (auto const& host : simgrid::s4u::Engine::get_instance()->get_all_hosts())
- host->extension_set(new simgrid::smpi::Host(host));
- }
-
Instance instance(std::string(name), num_processes, MPI_COMM_NULL);
smpi_instances.insert(std::pair<std::string, Instance>(name, instance));
}
-void smpi_deployment_register_process(const std::string& instance_id, int rank, simgrid::s4u::ActorPtr actor)
+void smpi_deployment_register_process(const std::string& instance_id, int rank, simgrid::s4u::Actor* actor)
{
Instance& instance = smpi_instances.at(instance_id);
- instance.present_processes_.push_back(actor);
instance.comm_world_->group()->set_mapping(actor, rank);
}
instance.finalized_ranks_++;
if (instance.finalized_ranks_ == instance.size_) {
- instance.present_processes_.clear();
simgrid::smpi::Comm::destroy(instance.comm_world_);
smpi_instances.erase(instance_id);
}
for (auto const& item : smpi_instances) {
XBT_CINFO(smpi, "Stalling SMPI instance: %s. Do all your MPI ranks call MPI_Finalize()?", item.first.c_str());
Instance instance = item.second;
- instance.present_processes_.clear();
simgrid::smpi::Comm::destroy(instance.comm_world_);
}
smpi_instances.clear();