Discussion:
Using MPI_Sendrecv_replace with derived types?
(too old to reply)
v***@mail.ru
2008-08-02 07:11:14 UTC
Permalink
Hi, I wonder is it legal to use MPI_Sendrecv_replace with derived data
types like MPI_TYPE_INDEXED and suchs? That is, if both sides have
equal number of blocks in MPI_TYPE_INDEXED with corresponding block
lengths, but possibly different displacements. The goal was to
exchange array of structures between two processes in the process
shuffling the order of structures in some order.
Michael Hofmann
2008-08-04 07:29:12 UTC
Permalink
Post by v***@mail.ru
Hi, I wonder is it legal to use MPI_Sendrecv_replace with derived data
types like MPI_TYPE_INDEXED and suchs? That is, if both sides have
equal number of blocks in MPI_TYPE_INDEXED with corresponding block
lengths, but possibly different displacements. The goal was to
exchange array of structures between two processes in the process
shuffling the order of structures in some order.
Yes, it is all legal as long as "the sequence of basic type components"
you send is equal to the one that you try to receive.

http://www.mpi-forum.org/docs/mpi-11-html/node59.html

"Type matching is defined according to the type signature of the
corresponding datatypes, that is, the sequence of basic type components.
Type matching does not depend on some aspects of the datatype definition,
such as the displacements (layout in memory) or the intermediate types
used."


Michael

Loading...