Definition
MPI_Finalize shuts down the MPI library. It must be called by each process at the end of the MPI program.
int MPI_Finalize();
Miscellaneous
C | Fortran-2008 | Fortran-90
MPI_Finalize shuts down the MPI library. It must be called by each process at the end of the MPI program.
int MPI_Finalize();
The error code returned from the finalisation.
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
/**
* @brief Illustrate how to finalise the MPI environment.
**/
int main(int argc, char* argv[])
{
MPI_Init(&argc, &argv);
// Tell MPI to shut down and that we no longer need it.
MPI_Finalize();
return EXIT_SUCCESS;
}