Edit

Share via


MPI_Comm_free function

Frees a communicator that is allocated with the MPI_Comm_dup, MPI_Comm_create, or MPI_Comm_split functions.

Syntax

int MPIAPI MPI_Comm_free(
   _Inout_ MPI_Comm *comm
);

Parameters

  • comm
    The pointer to a communicator handle to free.

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

Remarks

This collective operation marks the communication object for deallocation. The handle is set to MPI_COMM_NULL. Any pending operations that use this communicator finish normally. The object is not deallocated until there are no active references to it.

This function applies to both intracommunicators and intercommunicators.

The delete callback functions for all cached attributes are called in an indeterminate order.

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

MPI_Comm_create

MPI_Comm_split

MPI_Comm_dup