MPI_Finalize - Online Linux Manual PageSection : 3
Updated : Jan 21, 2016
Source : 1.10.2
Note : Open MPI

NAMEMPI_Finalize − Terminates MPI execution environment.

SYNTAX

C Syntax#include <mpi.h> int MPI_Finalize()

Fortran SyntaxINCLUDE 'mpif.h' MPI_FINALIZE(IERROR) INTEGER IERROR

C++ Syntax#include <mpi.h> void Finalize()

OUTPUT PARAMETERIERROR  Fortran only: Error status (integer).

DESCRIPTIONThis routine cleans up all MPI states. Once this routine is called, no MPI routine (not even MPI_Init) may be called, except for MPI_Get_version, MPI_Initialized, and MPI_Finalized. Unless there has been a call to MPI_Abort, you must ensure that all pending communications involving a process are complete before the process calls MPI_Finalize. If the call returns, each process may either continue local computations or exit without participating in further communication with other processes. At the moment when the last process calls MPI_Finalize, all pending sends must be matched by a receive, and all pending receives must be matched by a send. MPI_Finalize is collective over all connected processes. If no processes were spawned, accepted, or connected, then this means it is collective over MPI_COMM_WORLD. Otherwise, it is collective over the union of all processes that have been and continue to be connected.

NOTESAll processes must call this routine before exiting. All processes will still exist but may not make any further MPI calls. MPI_Finalize guarantees that all local actions required by communications the user has completed will, in fact, occur before it returns. However, MPI_Finalize guarantees nothing about pending communications that have not been completed; completion is ensured only by MPI_Wait, MPI_Test, or MPI_Request_free combined with some other verification of completion. For example, a successful return from a blocking communication operation or from MPI_Wait or MPI_Test means that the communication is completed by the user and the buffer can be reused, but does not guarantee that the local process has no more work to do. Similarly, a successful return from MPI_Request_free with a request handle generated by an MPI_Isend nullifies the handle but does not guarantee that the operation has completed. The MPI_Isend is complete only when a matching receive has completed. If you would like to cause actions to happen when a process finishes, attach an attribute to MPI_COMM_SELF with a callback function. Then, when MPI_Finalize is called, it will first execute the equivalent of an MPI_Comm_free on MPI_COMM_SELF. This will cause the delete callback function to be executed on all keys associated with MPI_COMM_SELF in an arbitrary order. If no key has been attached to MPI_COMM_SELF, then no callback is invoked. This freeing of MPI_COMM_SELF happens before any other parts of MPI are affected. Calling MPI_Finalized will thus return "false" in any of these callback functions. Once you have done this with MPI_COMM_SELF, the results of MPI_Finalize are not specified.

ERRORSAlmost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ functions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI::Exception object. 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 MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN 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.
0
Johanes Gumabo
Data Size   :   7,770 byte
man-MPI_Finalize.3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 171,602
Visitor ID   :     :  
Visitor IP   :   52.14.125.137   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.