} 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;
}
/* Get # of free-to-be-assigned processes and # of free dimensions */
int freeprocs = nnodes;
int freedims = 0;
- int *p = dims;
+ const int* p = dims;
for (int i = 0; i < ndims; ++i) {
if (*p == 0) {
++freedims;