[Mpi-forum] Clarification on MPI communicator semantics

Scott Pakin pakin at lanl.gov
Fri Oct 11 19:56:22 CDT 2013


Is it valid or invalid to compare MPI communicators with "==" (in C)?

I didn't see anything in the MPI 3.0 standard that addressed that
question.  I know I can use MPI_Comm_compare() and check for
MPI_IDENT, but "==" sure is a lot more convenient.  If the answer is
that an "==" comparison of two MPI_Comm types isn't guaranteed to
compile or to return correct results, then how should I compare a
communicator to MPI_COMM_NULL, which the Argonne MPI page claims is
not a valid argument to MPI_Comm_compare() (cf.
http://www.mcs.anl.gov/research/projects/mpi/www/www3/MPI_Comm_compare.html)?

Thanks,
-- Scott



More information about the mpi-forum mailing list