2005-03-14 23:57:21 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-03-14 23:57:21 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2005-03-14 23:57:21 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte_config.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/constants.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/base.h"
|
2005-07-04 03:31:27 +04:00
|
|
|
#include "opal/util/output.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-10-02 04:46:31 +04:00
|
|
|
#include "orte/util/proc_info.h"
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/mca/plm/base/plm_private.h"
|
|
|
|
#include "orte/mca/plm/base/base.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
int orte_plm_base_finalize(void)
|
2005-03-14 23:57:21 +03:00
|
|
|
{
|
2006-10-02 04:46:31 +04:00
|
|
|
int rc;
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
/* Finalize the selected module */
|
2008-02-28 04:57:57 +03:00
|
|
|
orte_plm.finalize();
|
2006-10-02 04:46:31 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* if we are the HNP, then stop our receive */
|
|
|
|
if (orte_process_info.hnp) {
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_plm_base_comm_stop())) {
|
2006-10-02 04:46:31 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
}
|
2006-09-15 01:29:51 +04:00
|
|
|
|
2005-04-15 21:19:01 +04:00
|
|
|
return ORTE_SUCCESS;
|
2005-04-15 21:04:57 +04:00
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
int orte_plm_base_close(void)
|
2005-04-15 21:04:57 +04:00
|
|
|
{
|
2006-09-29 16:45:50 +04:00
|
|
|
/* finalize selected module */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (orte_plm_base.selected) {
|
|
|
|
orte_plm.finalize();
|
2006-09-29 16:45:50 +04:00
|
|
|
}
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
/* Close all open components */
|
2008-02-28 04:57:57 +03:00
|
|
|
mca_base_components_close(orte_plm_globals.output,
|
|
|
|
&orte_plm_base.available_components, NULL);
|
|
|
|
OBJ_DESTRUCT(&orte_plm_base.available_components);
|
2006-09-15 01:29:51 +04:00
|
|
|
|
2006-11-14 00:51:34 +03:00
|
|
|
/* clearout the orted cmd locks */
|
2008-02-28 04:57:57 +03:00
|
|
|
OBJ_DESTRUCT(&orte_plm_globals.orted_cmd_lock);
|
|
|
|
OBJ_DESTRUCT(&orte_plm_globals.orted_cmd_cond);
|
2006-11-14 00:51:34 +03:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|