From cda8a04efa1051a1b1555848b760314068f6e3ba Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Fri, 9 Sep 2016 10:10:35 +0900 Subject: [PATCH] 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 open-mpi/ompi#2061 --- ompi/communicator/comm_cid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ompi/communicator/comm_cid.c b/ompi/communicator/comm_cid.c index f93a89d4f29..65493d73431 100644 --- a/ompi/communicator/comm_cid.c +++ b/ompi/communicator/comm_cid.c @@ -372,7 +372,7 @@ static int ompi_comm_checkcid (ompi_comm_request_t *request) ++context->iter; - ret = context->allreduce_fn (&context->flag, &context->rflag, 1, MPI_MAX, context, &subreq); + ret = context->allreduce_fn (&context->flag, &context->rflag, 1, MPI_MIN, context, &subreq); if (OMPI_SUCCESS == ret) { ompi_comm_request_schedule_append (request, ompi_comm_nextcid_check_flag, &subreq, 1); } @@ -478,7 +478,7 @@ int ompi_comm_activate_nb (ompi_communicator_t **newcomm, ompi_communicator_t *c /* Step 1: the barrier, after which it is allowed to * send messages over the new communicator */ - ret = context->allreduce_fn (&context->ok, &context->ok, 1, MPI_MAX, context, + ret = context->allreduce_fn (&context->ok, &context->ok, 1, MPI_MIN, context, &subreq); if (OMPI_SUCCESS != ret) { ompi_comm_request_return (request);