- process_data[i] = new simgrid::smpi::Process(i, finalization_barrier);
- }
- //if the process was launched through smpirun script we generate a global mpi_comm_world
- //if not, we let MPI_COMM_NULL, and the comm world will be private to each mpi instance
- if (smpirun) {
- group = new simgrid::smpi::Group(process_count);
- MPI_COMM_WORLD = new simgrid::smpi::Comm(group, nullptr);
- MPI_Attr_put(MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, reinterpret_cast<void *>(process_count));
-
- for (int i = 0; i < process_count; i++)
- group->set_mapping(i, i);
+ if (smpirun) {
+ process_data[i] = new simgrid::smpi::Process(i, smpi_deployment_finalization_barrier(smpi_default_instance_name));
+ smpi_deployment_register_process(smpi_default_instance_name, i, i);
+ } else {
+ // TODO We can pass a nullptr here because Process::set_data() assigns the
+ // barrier from the instance anyway. This is ugly and should be changed
+ process_data[i] = new simgrid::smpi::Process(i, nullptr);
+ }