@@ -148,7 +148,7 @@ int ompi_comm_set_nb ( ompi_communicator_t **ncomm,
148
148
local_size = ompi_group_size (local_group );
149
149
}
150
150
151
- if (NULL != remote_group ) {
151
+ if ( ( NULL != remote_group ) && ( & ompi_mpi_group_null . group != remote_group ) ) {
152
152
remote_size = ompi_group_size (remote_group );
153
153
}
154
154
@@ -177,10 +177,10 @@ int ompi_comm_set_nb ( ompi_communicator_t **ncomm,
177
177
newcomm -> c_my_rank = newcomm -> c_local_group -> grp_my_rank ;
178
178
179
179
/* Set remote group and duplicate the local comm, if applicable */
180
- if (0 < remote_size ) {
180
+ if ( NULL != remote_group ) {
181
181
ompi_communicator_t * old_localcomm ;
182
182
183
- if (NULL == remote_group ) {
183
+ if (& ompi_mpi_group_null . group == remote_group ) {
184
184
ret = ompi_group_incl (oldcomm -> c_remote_group , remote_size ,
185
185
remote_ranks , & newcomm -> c_remote_group );
186
186
if (OPAL_UNLIKELY (OMPI_SUCCESS != ret )) {
@@ -432,7 +432,7 @@ int ompi_comm_split( ompi_communicator_t* comm, int color, int key,
432
432
int rc = OMPI_SUCCESS ;
433
433
ompi_communicator_t * newcomp = NULL ;
434
434
int * lranks = NULL , * rranks = NULL ;
435
- ompi_group_t * local_group = NULL ;
435
+ ompi_group_t * local_group = NULL , * remote_group = NULL ;
436
436
437
437
ompi_comm_allgatherfct * allgatherfct = NULL ;
438
438
@@ -508,6 +508,7 @@ int ompi_comm_split( ompi_communicator_t* comm, int color, int key,
508
508
/* Step 2: determine all the information for the remote group */
509
509
/* --------------------------------------------------------- */
510
510
if ( inter ) {
511
+ remote_group = & ompi_mpi_group_null .group ;
511
512
rsize = comm -> c_remote_group -> grp_proc_count ;
512
513
rresults = (int * ) malloc ( rsize * 2 * sizeof (int ));
513
514
if ( NULL == rresults ) {
@@ -591,7 +592,7 @@ int ompi_comm_split( ompi_communicator_t* comm, int color, int key,
591
592
comm -> error_handler ,/* error handler */
592
593
pass_on_topo ,
593
594
local_group , /* local group */
594
- NULL ); /* remote group */
595
+ remote_group ); /* remote group */
595
596
596
597
if ( NULL == newcomp ) {
597
598
rc = MPI_ERR_INTERN ;
0 commit comments