[mpich-discuss] MPICH2 with MPI-1 code

Dave Goodell goodell at mcs.anl.gov
Wed Apr 14 14:44:27 CDT 2010


On Apr 14, 2010, at 2:19 PM, Mark Williamson wrote:

> Looking closer into the fail, it pertained to this error message  
> from a recent MPICH2 release:
>
> Assertion failed in file helper_fns.c at line 335: 0
> memcpy argument memory ranges overlap, dst_=0x6e51a4 src_=0x6e51a0  
> len_=100
>
> Having researched this, it was related to an "Incorrect call to  
> MPI_Gatherv"; the root process aliased the send buffer and the  
> receive buffer alias to each other. This of course, can be resolved  
> by using MPI_IN_PLACE. Interestingly, mpich2-1.0.7, with which we  
> had used in the past, never complained about this.

We improve our error checking constantly; this is an example of such  
error checking.  Error checking like this is typically helpful both to  
applications and to us when supporting applications.

The error message in this particular case is not helpful enough, but  
that has already been rectified in the current code and a much clearer  
error message will be elicited by similarly incorrect calls in future  
releases.

> So, this brings me to my question. My understanding is that  
> MPI_IN_PLACE is a MPI-2 specific argument value.

Correct.  My copy of the MPI-1.3 standard does not mention MPI_IN_PLACE.

> The piece of AMBER code that I refer to in this discussion written  
> within the a MPI-1 standard. As stated on the MPICH2 home page,  
> "MPICH2 is a high-performance and widely portable implementation of  
> the Message Passing Interface (MPI) standard (*BOTH* MPI-1 and  
> MPI-2)". If I use MPI_IN_PLACE, the code will not be MPI-1 standard,  
> so how to I specific instruct MPICH2's mpif90 or mpirun that one is  
> using a MPI-1 code, hence avoiding this error?


This was not valid MPI code in the MPI-1 standard either.  Section  
2.2, page 7 of the MPI-1.3 standard [1] disallows argument aliasing.   
You have at least three options:

1) As another poster suggested, disable assertions and keep your code  
as-is.  Your code isn't strictly portable MPI, so you might have  
trouble with it on other MPI implementations, including later versions  
of MPICH2.

2) Use separate input and output buffers.  This is the only valid way  
to fix this in strict MPI-1.

3) Make the jump to modest usage of MPI-2 features, specifically  
MPI_IN_PLACE.  Basic MPI-2 support isn't hard to come by at this  
point, so I consider this to be a reasonable option.  Your specific  
circumstances (access to machines, need to use particular MPI  
implementations, etc) will dictate whether this is practical for you.

-Dave

[1] http://www.mpi-forum.org/docs/mpi-1.3/mpi-report-1.3-2008-05-30.pdf



More information about the mpich-discuss mailing list