Edit

Share via


MPI_Barrier function

Initiates barrier synchronization across all members of a group.

Syntax

int MPIAPI MPI_Barrier(
  _In_ MPI_Comm comm
);

Parameters

  • comm [in]
    The communicator to synchronize.

    If this is an intracommunicator, the MPI_Barrier function blocks the caller until all group members have called it. The function does not return on any process until all group processes have called the function.

    If this is an intercommunicator, the MPI_Barrier function involves two groups. The function returns on processes in one group, group A, only after all members of the other group, group B, have called the function, and vice versa. The function can return for a process before all processes in its own group have called the function.

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_BARRIER(COMM, IERROR)
        INTEGER COMM, IERROR

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 Collective Functions