[Mpi-forum] Ask for detail about MPI_Type_create_struct specification

George Bosilca bosilca at icl.utk.edu
Thu Jul 18 07:54:05 CDT 2013


The MPI standard is pretty clear about this. 1) MPI_Type_create is a local function, each process is freely allowed to call it with it's arguments. 2) the matching in MPI must have the same type signature (and not type map), thus the local displacement on the datatype is not significant. Feel free to read the Datatype chapter in MPI 3.0 for further information.

  George.

On Jul 18, 2013, at 14:11 , Minh Quan HO <hmquan89 at gmail.com> wrote:

> Hello, 
> I'm working on HPL (High Performance Linpack) and I have a question about
> MPI_Type_create_struct : 
> 
> int MPI_Type_struct(
>     int count, 
>     int *array_of_blocklengths, 
>     MPI_Aint *array_of_displacements, 
>     MPI_Datatype *array_of_types, 
>     MPI_Datatype *newtype
> )
> 
> - Two processes A and B calls MPI_Type_create_struct with the same content of 
> 'count', 'array_of_blocklengths' and 'array_of_types', but maybe
> *not* the same 'array_of_displacements' (due to private memory or 
> custom stride of send/recv buffer)
> 
> - Example : 
> On process A : 
> count = 3
> dispA[0] = 0      - blen[0] = 1 - type[0] = MPI_INT    => block0
> dispA[1] = 16     - blen[1] = 2 - type[1] = MPI_DOUBLE => block1
> dispA[2] = 2014   - blen[2] = 4 - type[2] = MPI_DOUBLE => block2
> 
> On process B : 
> count = 3
> dispB[0] = 8      - blen[0] = 1 - type[0] = MPI_INT
> dispB[1] = 24     - blen[1] = 2 - type[1] = MPI_DOUBLE
> dispB[2] = 128    - blen[2] = 4 - type[2] = MPI_DOUBLE
> 
> - The question is : According to MPI, is this possible that two
> processes calls this MPI routine with their own different 
> displacements ? (like example above - and also what HPL does)
> 
> - If yes, at Receiver side, I suppose that further send/recv with 
> this type will do :
>     block0 from A at dispA[0] must be written to B on dispB[0]
>     block1 from A at dispA[1] must be written to B on dispB[1] 
> and block2 from A at dispA[2] must be written to B on dispB[2], 
> aren't they ?  
> 
> Thank you for any response,
> 
> Quan
> _______________________________________________
> 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/20130718/f725cf18/attachment-0001.html>


More information about the mpi-forum mailing list