[mpich-discuss] Using MPI_Put/Get correctly?

James Dinan dinan at mcs.anl.gov
Tue Dec 28 10:45:25 CST 2010


Hi Pavan,

You're correct, in both examples there is a bug in type creation:
MPI_Type_indexed expects an array of blocklengths but a scalar is being
passed.

Matt, I think the function you're looking for is
MPI_Type_create_indexed_block which expects all blocks to be of the same
length and takes a scalar block length.  Could you substitute this for
MPI_Type_indexed in your program and let us know if it fixes your problem?

Thanks,
 ~Jim.

On 12/27/2010 07:25 PM, Pavan Balaji wrote:
> 
> On 12/27/2010 04:29 PM, Grismer, Matthew J Civ USAF AFMC AFRL/RBAT wrote:
>> I've created two example test programs that appear to highlight the issue
>> with MPICH2; both die when I run them on 2 processors.  I am pretty
>> certain
>> the first (putoneway.f90) should work, as I am only doing a single put
>> from
>> one processor to a second processor; the target processor is doing
>> nothing
>> with the window'ed array that is receiving the data. My guess is the
>> problem
>> lies in the indexed datatypes that I am using for both the origin and
>> target.
> 
> Thanks. Example programs that show the problem are always helpful.
> 
> The first example doesn't die for me. It dumps some output and returns
> correctly (return code 0).
> 
>> The second case (putbothways.f90) closely mirrors what I am actually
>> trying
>> to do in my code, that is have each processor put into the other
>> processors
>> window'ed array at the same time.  So, each process is sending from and
>> receiving into the same array at the same time, with no overlap in the
>> sent
>> and received data.  Once again I'm using indexed data types for both the
>> origin and target.
> 
> The second example segfaults for me, but I don't know enough Fortran to
> know if the code is correct or not. However, it looks like the usage of
> MPI_Type_indexed is incorrect (block lengths needs to be an array).
> Here's the prototype:
> http://www.mcs.anl.gov/research/projects/mpi/www/www3/MPI_Type_indexed.html
> 
> If you don't think this is an error in the code, maybe someone know
> knowledgeable in Fortran on the mailing list can comment.
> 
>  -- Pavan
> 



More information about the mpich-discuss mailing list