* 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. */
* 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. */
- Instance(const char* name, int max_no_processes, int process_count, MPI_Comm comm, msg_bar_t finalization_barrier)
+ Instance(const std::string name, int max_no_processes, int process_count, MPI_Comm comm,
+ msg_bar_t finalization_barrier)
}
using simgrid::smpi::app::Instance;
static std::map<std::string, Instance> smpi_instances;
extern int process_count; // How many processes have been allocated over all instances?
}
using simgrid::smpi::app::Instance;
static std::map<std::string, Instance> smpi_instances;
extern int process_count; // How many processes have been allocated over all instances?
- for (auto const& item : simgrid::s4u::host_list) {
- simgrid::s4u::Host* host = item.second;
- host->extension_set(new simgrid::smpi::SmpiHost(host));
+ std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::get_instance()->get_all_hosts();
+ for (auto const& host : list) {
+ host->extension_set(new simgrid::smpi::Host(host));
- Instance instance(name, num_processes, process_count, MPI_COMM_NULL, MSG_barrier_init(num_processes));
+ Instance instance(std::string(name), num_processes, process_count, MPI_COMM_NULL, MSG_barrier_init(num_processes));
MPI_Group group = new simgrid::smpi::Group(instance.size);
instance.comm_world = new simgrid::smpi::Comm(group, nullptr);
MPI_Attr_put(instance.comm_world, MPI_UNIVERSE_SIZE, reinterpret_cast<void*>(instance.size));
MPI_Group group = new simgrid::smpi::Group(instance.size);
instance.comm_world = new simgrid::smpi::Comm(group, nullptr);
MPI_Attr_put(instance.comm_world, MPI_UNIVERSE_SIZE, reinterpret_cast<void*>(instance.size));
-//get the index of the process in the process_data array
-void smpi_deployment_register_process(const char* instance_id, int rank, int index)
+void smpi_deployment_register_process(const std::string instance_id, int rank, simgrid::s4u::ActorPtr actor)
- if (smpi_instances.empty()) { // no instance registered, we probably used smpirun.
- index_to_process_data[index]=index;
+ if (smpi_instances.empty()) // no instance registered, we probably used smpirun.