*comm_cart = MPI_COMM_NULL;
return;
}
- oldGroup = comm_old->group();
- newGroup = new Group(newSize);
- for (int i = 0 ; i < newSize ; i++) {
- newGroup->set_mapping(oldGroup->actor(i), i);
- }
nnodes_ = newSize;
position_[i] = rank / nranks;
rank = rank % nranks;
}
- if(comm_cart != nullptr)
+
+ if(comm_cart != nullptr){
+ oldGroup = comm_old->group();
+ newGroup = new Group(newSize);
+ for (int i = 0 ; i < newSize ; i++) {
+ newGroup->set_mapping(oldGroup->actor(i), i);
+ }
*comm_cart = new Comm(newGroup, this);
+ }
} else {
if(comm_cart != nullptr){
if (rank == 0) {