2004-01-15 09:08:25 +03:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "ompi_config.h"
|
2004-01-15 09:08:25 +03:00
|
|
|
|
2004-03-19 00:35:28 +03:00
|
|
|
#include "include/constants.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "runtime/runtime.h"
|
2004-01-15 09:08:25 +03:00
|
|
|
#include "mpi.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "group/group.h"
|
2004-03-19 09:12:43 +03:00
|
|
|
#include "errhandler/errhandler.h"
|
2004-04-21 02:38:22 +04:00
|
|
|
#include "communicator/communicator.h"
|
|
|
|
#include "datatype/datatype.h"
|
|
|
|
#include "op/op.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "runtime/runtime.h"
|
|
|
|
#include "mca/base/base.h"
|
|
|
|
#include "mca/ptl/ptl.h"
|
|
|
|
#include "mca/ptl/base/base.h"
|
|
|
|
#include "mca/pml/pml.h"
|
|
|
|
#include "mca/pml/base/base.h"
|
|
|
|
#include "mca/coll/coll.h"
|
|
|
|
#include "mca/coll/base/base.h"
|
2004-01-29 22:40:22 +03:00
|
|
|
|
2004-01-15 09:08:25 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
int ompi_mpi_finalize(void)
|
2004-01-15 09:08:25 +03:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_mpi_finalized = true;
|
2004-01-29 22:40:22 +03:00
|
|
|
|
2004-06-29 04:02:25 +04:00
|
|
|
/* Shut down any bindings-specific issues: C++, F77, F90 (may or
|
|
|
|
may not be necessary...?) */
|
2004-01-29 22:40:22 +03:00
|
|
|
|
2004-06-29 04:02:25 +04:00
|
|
|
/* Free communication objects */
|
|
|
|
|
|
|
|
/* free communicator resources */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_comm_finalize())) {
|
|
|
|
return ret;
|
2004-01-29 22:40:22 +03:00
|
|
|
}
|
|
|
|
|
2004-06-29 04:02:25 +04:00
|
|
|
/* free window resources */
|
2004-01-29 22:40:22 +03:00
|
|
|
|
2004-06-29 04:02:25 +04:00
|
|
|
/* free file resources */
|
2004-01-29 22:40:22 +03:00
|
|
|
|
2004-06-29 04:02:25 +04:00
|
|
|
/* Free secondary resources */
|
2004-01-30 06:56:21 +03:00
|
|
|
|
2004-06-29 04:02:25 +04:00
|
|
|
/* free group resources */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_group_finalize())) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* free errhandler resources */
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_errhandler_finalize())) {
|
|
|
|
return ret;
|
2004-01-30 06:56:21 +03:00
|
|
|
}
|
|
|
|
|
2004-06-29 04:02:25 +04:00
|
|
|
/* free request resources */
|
|
|
|
|
|
|
|
/* Free all other resources */
|
2004-01-29 22:40:22 +03:00
|
|
|
|
2004-04-21 02:38:22 +04:00
|
|
|
/* free op resources */
|
2004-06-07 19:33:53 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = ompi_op_finalize())) {
|
2004-04-21 02:38:22 +04:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* free ddt resources */
|
2004-06-07 19:33:53 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = ompi_ddt_finalize())) {
|
2004-04-21 02:38:22 +04:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2004-06-29 04:02:25 +04:00
|
|
|
/* free info resources */
|
2004-04-21 02:38:22 +04:00
|
|
|
|
2004-06-29 04:02:25 +04:00
|
|
|
/* Close down MCA modules */
|
|
|
|
|
|
|
|
if (OMPI_SUCCESS != (ret = mca_coll_base_close())) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
if (OMPI_SUCCESS != (ret = mca_ptl_base_close())) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
if (OMPI_SUCCESS != (ret = mca_pml_base_close())) {
|
|
|
|
return ret;
|
2004-02-18 09:07:06 +03:00
|
|
|
}
|
|
|
|
|
2004-06-29 04:02:25 +04:00
|
|
|
/* Leave the RTE */
|
|
|
|
|
|
|
|
if (OMPI_SUCCESS != (ret = ompi_rte_finalize())) {
|
|
|
|
return ret;
|
2004-03-19 09:12:43 +03:00
|
|
|
}
|
|
|
|
|
2004-06-29 04:02:25 +04:00
|
|
|
/* Close down the MCA */
|
|
|
|
|
|
|
|
if (OMPI_SUCCESS != (ret = mca_base_close())) {
|
2004-01-15 09:08:25 +03:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* All done */
|
|
|
|
|
|
|
|
return MPI_SUCCESS;
|
|
|
|
}
|