Skip to content

Commit 65be935

Browse files
committed
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 <[email protected]>
1 parent c2a02ab commit 65be935

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ompi/communicator/comm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,15 +853,15 @@ ompi_comm_split_type(ompi_communicator_t *comm,
853853

854854
/* check that all processors have been called with the same value */
855855
for (int i = 0 ; i < size ; ++i) {
856-
if ( results[2*i] != split_type ) {
856+
if ( results[2*i] != split_type && MPI_UNDEFINED != results[2*i] && MPI_UNDEFINED != split_type) {
857857
rc = OMPI_ERR_BAD_PARAM;
858858
goto exit;
859859
}
860860
}
861861

862862
/* how many are participating and on my node? */
863863
rc = ompi_comm_split_type_get_part (comm->c_local_group, results, &lranks, &my_size);
864-
if (0 == my_size) {
864+
if (0 == my_size && MPI_UNDEFINED != split_type) {
865865
/* should never happen */
866866
rc = OMPI_ERR_BAD_PARAM;
867867
}

0 commit comments

Comments
 (0)