NAME
MMPPIIPPuutt - Copies data from the origin memory to the target.
SSYYNNTTAAXX CC SSyynnttaaxx#include
MPIPut(void *originaddr, int origincount, MPIDatatype origindatatype, int targetrank, MPIAint targetdisp, int targetcount, MPIDatatype targetdatatype, MPIWin win) FFoorrttrraann SSyynnttaaxx ((sseeee FFOORRTTRRAANN 7777 NNOOTTEESS)) INCLUDE 'mpif.h' MPIPUT(ORIGINADDR, ORIGINCOUNT, ORIGINDATATYPE, TARGETRANK,TARGETDISP, TARGETCOUNT, TARGETDATATYPE, WIN, IERROR)
ORIGINADDR(*) INTEGER(KIND=MPIADDRESSKIND) TARGETDISP INTEGER ORIGINCOUNT, ORIGINDATATYPE, TARGETRANK, TARGETCOUNT, TARGETDATATYPE, WIN, IERROR
CC++++ SSyynnttaaxx#include
void MPI::Win::Put(const void* originaddr, int origincount, const MPI::Datatype& origindatatype, int targetrank, MPI::Aint targetdisp, int targetcount, const MPI::Datatype& targetdatatype) const IINNPPUUTT PPAARRAAMMEETTEERRSS originaddr Initial address of origin buffer (choice). origincount Number of entries in origin buffer (nonnegative integer). origindatatype Data type of each entry in origin buffer (handle). targetrank Rank of target (nonnegative integer). targetdispDisplacement from start of window to target buffer (nonnega-
tive integer). targetcount Number of entries in target buffer (nonnegative integer). targetdatatype Data type of each entry in target buffer (handle). win Window object used for communication (handle). OOUUTTPPUUTT PPAARRAAMMEETTEERRIERROR Fortran only: Error status (integer).
DESCRIPTION
MPIPut transfers origincount successive entries of the type specified by origindatatype, starting at address originaddr on the origin node to the target node specified by the win, targetrank pair. The data are written in the target buffer at address targetaddr = windowbase + targetdisp x dispunit, where windowbase and dispunit are the baseaddress and window displacement unit specified at window initializa-
tion, by the target process.The target buffer is specified by the arguments targetcount and tar-
getdatatype. The data transfer is the same as that which would occur if the originprocess executed a send operation with arguments originaddr, ori-
gincount, origindatatype, targetrank, tag, comm, and the targetprocess executed a receive operation with arguments targetaddr, tar-
getcount, targetdatatype, source, tag, comm, where targetaddr is thetarget buffer address computed as explained above, and comm is a commu-
nicator for the group of win. The communication must satisfy the same constraints as for a similarmessage-passing communication. The targetdatatype may not specify
overlapping entries in the target buffer. The message sent must fit, without truncation, in the target buffer. Furthermore, the target buffer must fit in the target window. In addition, only processes within the same buffer can access the target window. The targetdatatype argument is a handle to a datatype object definedat the origin process. However, this object is interpreted at the tar-
get process: The outcome is as if the target datatype object were defined at the target process, by the same sequence of calls used to define it at the origin process. The target data type must contain only relative displacements, not absolute addresses. The same holds for get and accumulate. NNOOTTEESS The targetdatatype argument is a handle to a datatype object that is defined at the origin process, even though it defines a data layout inthe target process memory. This does not cause problems in a homoge-
neous or heterogeneous environment, as long as only portable data typesare used (portable data types are defined in Section 2.4 of the MPI-2
Standard). The performance of a put transfer can be significantly affected, on some systems, from the choice of window location and the shape and location of the origin and target buffer: Transfers to a target windowin memory allocated by MPIAllocmem may be much faster on shared mem-
ory systems; transfers from contiguous buffers will be faster on most, if not all, systems; the alignment of the communication buffers may also impact performance. FFOORRTTRRAANN 7777 NNOOTTEESS The MPI standard prescribes portable Fortran syntax for the TARGETDISPargument only for Fortran 90. FORTRAN 77 users may use the non-portable
syntax INTEGER*MPIADDRESSKIND TARGETDISP where MPIADDRESSKIND is a constant defined in mpif.h and gives the length of the declared integer in bytes. EERRRROORRSS Almost all MPI routines return an error value; C routines as the valueof the function and Fortran routines in the last argument. C++ func-
tions do not return errors. If the default error handler is set toMPI::ERRORSTHROWEXCEPTIONS, then on error the C++ exception mechanism
will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed withMPICommseterrhandler; the predefined error handler MPIERRORSRETURN
may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error.SEE ALSO
MPIGet MPIAccumulate Open MPI 1.2 September 2006 MPIPut(3OpenMPI)