X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/79affec61e2c9af35fc9d5c5f34c977dde041283..4a4884ead9a3d55f9247a3facc7b310f1a0fe942:/src/smpi/mpi/smpi_topo.cpp diff --git a/src/smpi/mpi/smpi_topo.cpp b/src/smpi/mpi/smpi_topo.cpp index 058b4bd42e..b79cefc5d3 100644 --- a/src/smpi/mpi/smpi_topo.cpp +++ b/src/smpi/mpi/smpi_topo.cpp @@ -19,6 +19,14 @@ static int getfactors(int num, int *nfators, int **factors); namespace simgrid{ namespace smpi{ +void Topo::setComm(MPI_Comm comm) +{ + xbt_assert(not comm_); + comm_ = comm; + if (comm_) + comm_->topo_ = this; +} + /******************************************************************************* * Cartesian topologies ******************************************************************************/ @@ -72,7 +80,8 @@ Topo_Cart::Topo_Cart(MPI_Comm comm_old, int ndims, const int dims[], const int p } else { if(comm_cart != nullptr){ if (rank == 0) { - *comm_cart = new Comm(new Group(MPI_COMM_SELF->group()), this); + MPI_Group group = new Group(MPI_COMM_SELF->group()); + *comm_cart = new Comm(group, this); } else { *comm_cart = MPI_COMM_NULL; }