[mpich-discuss] MPI derived types in one-sided memory

Robert Kubrick robertkubrick at gmail.com
Tue Jul 22 12:03:22 CDT 2008


Lets say I want to transfer a custom data structure through MPI_Get()/ 
MPI_Put. I want the data to be portable across a number of different  
architectures, so I have to create a derived data type:

MPI_Type_struct(..., &MYTYPE);
MPI_Type_commit(&MYTYPE);

int elements = 10;
MPI_Alloc_mem(elements* MPI_Type_size(MYTYPE), ...);
MPI_Win_create(...);



Then I want to put an element in the RMA memory:

MYTYPE myvar;
some work on myvar...
MPI_Put(&myvar, 0, MYTYPE, homeRank, 2, 1, MYTYPE, mywin);

Is this the correct way to place the contents of myvar at index 2 in  
an RMA array of size 'elements'?




More information about the mpich-discuss mailing list