Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2005-11-04 14:58:04

Brian and I just noticed something -- a long time ago, I thought I was
being clever and forward-thinking by ensuring to define MPI_REPLACE as
a valid reduction operator for MPI_REDUCE (and friends). The careful
reader will remember that MPI_REPLACE is the MPI-2 MPI_Op added for
MPI_ACCUMULATE (the one-sided, non-collective operation). All MPI-2
says that is MPI_REPLACE is a new MPI_Op -- MPI-2 does not limit its
use to MPI_ACCUMULATE. So I merrily added MPI_REPLACE to the general
reduction tables, and bingo -- you can use MPI_REPLACE in MPI_REDUCE.
Woo hoo!

But thinking about this today, I have no idea what MPI_REPLACE is
supposed to do in a collective reduction. Specifically -- what value
should end up in the target buffer? It doesn't make sense.

I think that this is a grey area in the MPI standard -- MPI_REPLACE is
an MPI_Op, but it should *only* be used with MPI_ACCUMULATE, and not
with the collective reduction functions.

Any comments on this MPI interpretation? Agree / disagree?

{+} Jeff Squyres
{+} The Open MPI Project