[Mpi-forum] SENDRECV + MPI_TYPE_CREATE_STRUCT
Wesley Bland
wbland at anl.gov
Thu Oct 2 10:40:15 CDT 2014
Diego,
This mailing list isn’t for questions about using MPI so you won’t get answers to your questions here. It’s for the group working on writing the MPI Standard. I would encourage you to post your question on the mailing list for whichever MPI implementation you are using:
MPICH: discuss at mpich.org <mailto:discuss at mpich.org>
Open MPI: users at open-mpi.org <mailto:users at open-mpi.org>
Others have their own support system available through their websites.
Thanks,
Wesley
> On Oct 2, 2014, at 10:20 AM, Diego Avesani <diego.avesani at gmail.com> wrote:
>
> Dear all.
> I have some problem with MPI_TYPE_CREATE_STRUCT and as a consequence with SENDRECV.
>
> I have this variable type
>
> type particle
> integer :: ip
> real :: RP(2)
> real :: QQ(4)
> end type particle
>
> When I compile in double precision with:
>
> mpif90 -r8 -fpp -DPARALLEL *.f90
>
> So when I create my own variable type for MPI, I have
>
> TYPES(1)=MPI_INTEGER !We have three variables type in the new varible
> TYPES(2)=MPI_DOUBLE_PRECISION !Integer and Real and Real
> TYPES(3)=MPI_DOUBLE_PRECISION !Integer and Real and Real
> nBLOCKS(1)=1 !number of element in each block
> nBLOCKS(2)=2
> nBLOCKS(3)=4
> !
> DISPLACEMENTS(1)=0
> DISPLACEMENTS(2)=sizeof(dummy%ip)
> DISPLACEMENTS(3)=sizeof(dummy%ip)+sizeof(dummy%RP(1))+sizeof(dummy%RP(2))
> !
> CALL MPI_TYPE_CREATE_STRUCT(3,nBLOCKS,DISPLACEMENTS,TYPES,MPI_PARTICLE_TYPE, PI%ierr)
> CALL MPI_TYPE_COMMIT(MPI_PARTICLE_TYPE,MPI%ierr)
>
>
> Am I right?
> Thanks, in advance, for any kind of help
>
>
> Diego
>
> _______________________________________________
> mpi-forum mailing list
> mpi-forum at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpi-forum.org/pipermail/mpi-forum/attachments/20141002/73014f72/attachment-0001.html>
More information about the mpi-forum
mailing list