MPI_Win_attach function

Attaches a local memory region for remote access within the given window.

Syntax

int MPIAPI MPI_Win_attach(
   MPI_Win  win,
   void*    base,
   MPI_Aint size
);

Parameters

  • win [in]
    Window object.

  • base [in]
    Initial address of memory to be attached.

  • size [in]
    Size of memory to be attached in bytes.

Return value

Returns MPI_SUCCESS on success. Otherwise, the return value is an error code.

In Fortran, the return value is stored in the IERROR parameter.

Fortran

    MPI_WIN_ATTACH(WIN, BASE, SIZE, IERROR)
        INTEGER WIN, IERROR
        <type> BASE(*)
        INTEGER(KIND=MPI_ADDRESS_KIND) SIZE

Remarks

Attaches a local memory region beginning at base for remote access within the given window. The memory region specified must not contain any part that is already attached to the window win, that is, attaching overlapping memory concurrently within the same window is erroneous. The argument win must be a window that was created with MPI_Win_create_dynamic. The local memory region attached to the window consists of size bytes, starting at address base. In C, base is the starting address of a memory region. In Fortran, one can pass the first element of a memory region or a whole array, which must be simply contiguous. Multiple (but non-overlapping) memory regions may be attached to the same window.

Requirements

Product

HPC Pack 2012 MS-MPI Redistributable Package, HPC Pack 2008 R2 MS-MPI Redistributable Package, HPC Pack 2008 MS-MPI Redistributable Package or HPC Pack 2008 Client Utilities

Header

Mpi.h; Mpif.h

Library

Msmpi.lib

DLL

Msmpi.dll

See also

MPI One-Sided Communications Functions