150. Communicator Destructors

PreviousUpNext
Up: Communicator Management Next: Communicator Info Previous: Communicator Constructors

MPI_COMM_FREE(comm)
INOUT comm communicator to be destroyed (handle)

int MPI_Comm_free(MPI_Comm *comm)

MPI_Comm_free(comm, ierror)
TYPE(MPI_Comm), INTENT(INOUT) :: comm
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
MPI_COMM_FREE(COMM, IERROR)
INTEGER COMM, IERROR

This collective operation marks the communication object for deallocation. The handle is set to MPI_COMM_NULL. Any pending operations that use this communicator will complete normally; the object is actually deallocated only if there are no other active references to it. This call applies to intra- and inter-communicators. The delete callback functions for all cached attributes (see Section Caching ) are called in arbitrary order.


Advice to implementors.

A reference-count mechanism may be used: the reference count is incremented by each call to MPI_COMM_DUP or MPI_COMM_IDUP, and decremented by each call to MPI_COMM_FREE. The object is ultimately deallocated when the count reaches zero.

Though collective, it is anticipated that this operation will normally be implemented to be local, though a debugging version of an MPI library might choose to synchronize. ( End of advice to implementors.)


PreviousUpNext
Up: Communicator Management Next: Communicator Info Previous: Communicator Constructors


Return to MPI-3.1 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-3.1 of June 4, 2015
HTML Generated on June 4, 2015