I guess MPI_Type_Vector is the natural way to send and receive Fortran90
array sections (e.g. your QQMLS(:,50:100,:)).
I used that before and it works just fine.
I think that is pretty standard MPI programming style.
I guess MPI_Type_Struct tries to emulate Fortran90 and C structures
(as you did in your previous code, with all the surprises regarding
alignment, etc), not array sections.
Also, MPI type vector should be more easy going (and probably more
efficient) than MPI type struct, with less memory alignment problems.
I hope this helps,
PS - These books have a quite complete description and several examples
of all MPI objects and functions, including MPI types (native and user
[They cover MPI 1 and 2. I guess there is a new/upcoming book
with MPI 3, but for what you're doing 1 and 2 are more than enough.]
On 01/13/2015 09:22 AM, Diego Avesani wrote:
I had some wonderful talking about MPI_type_create_struct adn
Gilles, Gustavo, George, Gus, Tom and Jeff. Now all is more clear and my
Now I have another question. In may program I have matrix:
/QQMLS(:,:,:) /that is allocate as
/ALLOCATE(QQMLS(9,npt,18)/), where npt is the number of particles
QQMLS is double precision.
I would like to sent form a CPU to another part of it, for example,
sending QQMLS(:,50:100,:). I mean sending the QQMLS of the particles
between 50 to 100.
I suppose that i could use MPI_Type_vector but I am not sure. The
particle that I want to sent could be from 25 to 50 ecc.. ecc..so
blocklength changes everytime.
Do I have to use MPI_type_create_struct?
Do I have correctly understood MPI_Type_vector?
Thanks a lot
users mailing list
Link to this post: