[MPICH] MPI_REDUCE with MPI_IN_PLACE fails with memory error

Rajeev Thakur thakur at mcs.anl.gov
Tue Mar 13 15:34:41 CDT 2007


> Does this mean that mpich will allocate its own buffer regardless of
> what is passed as recvbuf?

There is no recvbuf on non-root nodes (that argument is ignored), so
allocation is necessary. 

> I rewrote my code by identifying a vector  which can easily be swapped
> to disk, and using this vector as the recvbuf argument, then rereading
> this vector from disk:

You don't need to do that. Just split the one big reduce into 5 smaller
reduces. As an example for a 100 element buffer, you could do:

call MPI_Reduce(buf(1), count=20,...)
call MPI_Reduce(buf(21), count=20,...)
call MPI_Reduce(buf(41), count=20,...)
call MPI_Reduce(buf(61), count=20,...)
call MPI_Reduce(buf(81), count=20,...)

You can continue using MPI_IN_PLACE as before. 

Rajeev




More information about the mpich-discuss mailing list