Edit

Share via


MPI_Win_lock function

Begins an RMA access epoch at the target process.

Syntax

int MPIAPI MPI_Win_lock(
   int     lock_type,
   int     rank,
   int     assert,
   MPI_Win win
);

Parameters

  • lock_type
    Indicates whether other processes may access the target window at the same time (if MPI_LOCK_SHARED) or not (MPI_LOCK_EXCLUSIVE).

  • rank
    Rank of locked window.

  • assert
    Used to optimize this call; zero may be used as a default.

  • win
    Window object.

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_LOCK(LOCK_TYPE, RANK, ASSERT, WIN, IERROR)
        INTEGER LOCK_TYPE, RANK, ASSERT, WIN, IERROR

Remarks

The name of this routine is misleading. In particular, this routine need not block, except when the target process is the calling process.

Implementations may restrict the use of RMA communication that is synchronized by lock calls to windows in memory allocated by MPI_Alloc_mem. Locks can be used portably only in such memory.

The assert argument is used to indicate special conditions for the fence that an implementation may use to optimize the MPI_Win_fence operation. The value zero is always correct. Other assertion values may be ORed together. Assertions that are valid for MPI_Win_fence are:

  • MPI_MODE_NOCHECK - no other process holds, or will attempt to acquire a conflicting lock, while the caller holds the window lock. This is useful when mutual exclusion is achieved by other means, but the coherence operations that may be attached to the lock and unlock calls are still required.

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