[MPICH] MPI_REDUCE with MPI_IN_PLACE fails with memory error
Martin Kleinschmidt
mk at theochem.uni-duesseldorf.de
Wed Mar 14 09:48:50 CDT 2007
On Mi, 14 M?r 2007, Rajeev Thakur wrote:
>> And there is really no way to force MPI to use a user-supplied buffer?
>> It will always allocate its own buffer?
>
>Well, there is no way to pass a user-supplied buffer. On non-root nodes,
>what is passed in the recvbuf argument cannot be trusted. To do a reduction
I eventually found it in the standard...
>like a = a + b, you need to store the incoming b and the new result a
>somewhere. So, non-root nodes need to allocate *two* buffers. The root node
>needs to allocate only one buffer as it can use its recvbuf.
Ah, ok. Thanks again to all of you for you patience with a relative beginner!
>As Ashley said, an implementation can do a pipelined operation in smaller
>chunks, but we are not doing that yet (we probably should), so you will need
>to do it in your code for now.
ok, not a big problem.
I was happy to read your "we probably should", because I think this is
something that should be done by the library - maybe with some parameter
for configuring the chunk-size...
One more question:
wouldn't it have been clearer for the MPI_IN_PLACE argument to be placed
in the rcvbuf on the root process? This would eliminate the need to do
different calls on the root and "other" processes...?
Thanks again for you time
...martin
More information about the mpich-discuss
mailing list