From 9ff189df8a0ecca08139c16405fa9e65ebed4e6a Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Thu, 16 Jun 2016 17:42:28 -0600 Subject: [PATCH] comm/split_type: allow MPI_UNDEFINED for split_type It is valid for any rank to deviate on the split_type argument if they specify MPI_UNDEFINED. The code was incorrectly not allowing this condition. Changed the split_type uniformity check and allow local_size to be 0 if the local split_type is MPI_UNDEFINED. Signed-off-by: Nathan Hjelm (cherry picked from commit open-mpi/ompi@65be93567699cc6cf71713984922884f25bd380b) --- ompi/communicator/comm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ompi/communicator/comm.c b/ompi/communicator/comm.c index 1f34701e03..c1997d3841 100644 --- a/ompi/communicator/comm.c +++ b/ompi/communicator/comm.c @@ -853,7 +853,7 @@ ompi_comm_split_type(ompi_communicator_t *comm, /* check that all processors have been called with the same value */ for (int i = 0 ; i < size ; ++i) { - if ( results[2*i] != split_type ) { + if ( results[2*i] != split_type && MPI_UNDEFINED != results[2*i] && MPI_UNDEFINED != split_type) { rc = OMPI_ERR_BAD_PARAM; goto exit; } @@ -861,7 +861,7 @@ ompi_comm_split_type(ompi_communicator_t *comm, /* how many are participating and on my node? */ rc = ompi_comm_split_type_get_part (comm->c_local_group, results, &lranks, &my_size); - if (0 == my_size) { + if (0 == my_size && MPI_UNDEFINED != split_type) { /* should never happen */ rc = OMPI_ERR_BAD_PARAM; }