<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">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.<div><br></div><div> George.</div><div><br><div><div>On Jul 18, 2013, at 14:11 , Minh Quan HO <<a href="mailto:hmquan89@gmail.com">hmquan89@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hello, <div style="">I'm working on HPL (High Performance Linpack) and I have a question about</div><div style="">MPI_Type_create_struct : </div><div style=""><br></div><div style=""><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)">int MPI_Type_struct(</span></div>
<div style=""><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)"> int count, </span></div><div style=""><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)"> int *array_of_blocklengths, </span></div>
<div style=""><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)"> MPI_Aint</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)"> *</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)">array_of_displacements, </span></div>
<div style=""><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)"> MPI_Datatype *array_of_types, </span></div><div style=""><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)"> MPI_Datatype</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)"> </span><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)">*newtype</span></div>
<div style=""><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)">)</span><br></div><div style=""><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)"><br>
</span></div><div style="">- Two processes A and B calls MPI_Type_create_struct with the same content of </div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">'count', '</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)">array_of_blocklengths' and '</span><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">array_of_types', but maybe</span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">*not*</span><span style="background-color:rgb(253,253,253)"> </span><span style="font-size:13px;background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace">the same '</span><span style="font-size:13px;background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace">array_of_displacements</span><span style="font-size:13px;background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace">' (due to private memory or </span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">custom stride of send/recv buffer)</span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px"><br>
</span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">- Example : </span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">On process A : </span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">count = 3</span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">dispA[0] = 0 - blen[0] = 1 - type[0] = MPI_INT => block0</span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">dispA[1] = 16 - blen[1] = 2 - type[1] = MPI_DOUBLE => block1</span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">dispA[2] = 2014 - blen[2] = 4 - type[2] = MPI_DOUBLE => block2</span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px"><br></span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">On process B : </span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">count = 3</span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">dispB[0] = 8 </span><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">- blen[0] = 1 - type[0] = MPI_INT</span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">dispB[1] = 24 </span><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">- blen[1] = 2 - type[1] = MPI_DOUBLE</span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">dispB[2] = 128 </span><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">- blen[2] = 4 - type[2] = MPI_DOUBLE</span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px"><br></span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">- The question is : According to MPI, is this possible that two</span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">processes calls this MPI </span><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">routine with their own different </span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">displacements ? </span><span style="font-size:13px;background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace">(like example above - and also </span><span style="font-size:13px;background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace">what HPL </span><span style="font-size:13px;background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace">does)</span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px"><br></span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">- If yes, at Receiver side, I suppose that further send/recv with </span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">this type will do :</span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px"> block0 from A at dispA[0] must be written to B on dispB[0]</span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px"> block1 from A at dispA[1] must be written to B on dispB[1] </span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">and block2 from A at dispA[2] must be written to B on dispB[2], </span></div>
<div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">aren't they ? </span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px"><br>
</span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">Thank you for any response,</span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px"><br>
</span></div><div style=""><span style="background-color:rgb(253,253,253);color:rgb(51,51,51);font-family:monospace;font-size:13px">Quan</span></div></div>
_______________________________________________<br>mpi-forum mailing list<br><a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a><br>http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum</blockquote></div><br></div></body></html>