Open MPI logo

MPI_Comm_disconnect(3) man page (version 5.0.0rc2)

  |   Home   |   Support   |   FAQ   |  

« Return to documentation listing

Table of Contents


C]MPI_Comm_disconnectR] - Deallocates communicator object and sets handle to C]MPI_COMM_NULL.R]


C Syntax

C]#include <mpi.h>int MPI_Comm_disconnect(MPI_Comm *comm)R]Fortran Syntax

C]USE MPI! or the older form: INCLUDE [aq]mpif.h[aq]MPI_COMM_DISCONNECT(COMM, IERROR) INTEGER COMM, IERROR R]Fortran 2008 Syntax

C]USE mpi_f08MPI_Comm_disconnect(comm, ierror) TYPE(MPI_Comm), INTENT(INOUT) :: comm INTEGER, OPTIONAL, INTENT(OUT) :: ierrorR]Input/Output Parameter

C]commR] : Communicator (handle).

Output Parameter

C]IERRORR] : Fortran only: Error status (integer).


C]MPI_Comm_disconnectR] waits for all pending communication on C]commR] to complete internally, deallocates the communicator object, and sets the handle to C]MPI_COMM_NULLR]. It is a collective operation. It may not be called with the communicator C]MPI_COMM_WORLDR] or C]MPI_COMM_SELF.R] C]MPI_Comm_disconnectR] may be called only if all communication is complete and matched, so that buffered data can be delivered to its destination. This requirement is the same as for C]MPI_Finalize.R] C]MPI_Comm_disconnectR] has the same action as C]MPI_Comm_freeR], except that it waits for pending communication to finish internally and enables the guarantee about the behavior of disconnected processes.


To disconnect two processes you may need to call C]MPI_Comm_disconnect,R] C]MPI_Win_freeR], and C]MPI_File_closeR] to remove all communication paths between the two processes. Note that it may be necessary to disconnect several communicators (or to free several windows or files) before two processes are completely independent.


Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with C]MPI_Comm_set_errhandlerR]; the predefined error handler C]MPI_ERRORS_RETURNR] may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error.

See Also

C]MPI_Comm_connectR](3) C]MPI_Comm_acceptR](3)

Table of Contents

« Return to documentation listing