Skip to content

Commit 3b968ec

Browse files
committed
ompi/communicator: fix typos in CID generation
use MPI_MIN instead of MPI_MAX when appropriate, otherwise a currently used CID can be reused, and bad things will likely happen. Refs #2061
1 parent 745872e commit 3b968ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ompi/communicator/comm_cid.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static int ompi_comm_checkcid (ompi_comm_request_t *request)
372372

373373
++context->iter;
374374

375-
ret = context->allreduce_fn (&context->flag, &context->rflag, 1, MPI_MAX, context, &subreq);
375+
ret = context->allreduce_fn (&context->flag, &context->rflag, 1, MPI_MIN, context, &subreq);
376376
if (OMPI_SUCCESS == ret) {
377377
ompi_comm_request_schedule_append (request, ompi_comm_nextcid_check_flag, &subreq, 1);
378378
}
@@ -478,7 +478,7 @@ int ompi_comm_activate_nb (ompi_communicator_t **newcomm, ompi_communicator_t *c
478478
/* Step 1: the barrier, after which it is allowed to
479479
* send messages over the new communicator
480480
*/
481-
ret = context->allreduce_fn (&context->ok, &context->ok, 1, MPI_MAX, context,
481+
ret = context->allreduce_fn (&context->ok, &context->ok, 1, MPI_MIN, context,
482482
&subreq);
483483
if (OMPI_SUCCESS != ret) {
484484
ompi_comm_request_return (request);

0 commit comments

Comments
 (0)