[mpich-discuss] New communicator and MPI_Reduce...

Alejandro Allievi alejandro.allievi at gmail.com
Tue Nov 13 08:31:51 CST 2012


Good morning,

I've created a new communicator "first_row_comm" which is the 1st row
of a mesh of processes contained in MPI_COMM_WORLD.

Everything works fine in the reduction operation involving the
processes in the new communicator if I use:

    MPI_Reduce(&test_newcomm, &sum_newcomm, 1, MPI_INT, MPI_SUM, 0,
MPI_COMM_WORLD);

However, when I want to apply the reduction operation using the new
communicator as

    MPI_Reduce(&test_newcomm, &sum_newcomm, 1, MPI_INT, MPI_SUM, 0,
first_row_comm);

It compiles fine but throws an execution error:

Fatal error in PMPI_Reduce: Invalid communicator, error stack:
PMPI_Reduce(1270): MPI_Reduce(sbuf=000000000022FE38,
rbuf=000000000022FE30, count=1, MPI_INT, MPI_SUM, root=0,
MPI_COMM_NULL) failed
PMPI_Reduce(1160): Null communicator

But communicator " first_row_comm " is properly create. Is this a bug
or I'm doing something wrong with the way I'm passing the
new communicator argument in MPI_Reduce, or...??

Thanks for any hints!!

Alejandro



More information about the discuss mailing list