2005-03-14 20:57:21 +00:00
|
|
|
/*
|
2005-11-05 19:57:48 +00: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 20:57:21 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2005-03-14 20:57:21 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte_config.h"
|
2008-02-28 01:57:57 +00:00
|
|
|
#include "orte/constants.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/base.h"
|
2009-02-09 20:44:44 +00:00
|
|
|
#include "opal/util/argv.h"
|
2009-04-29 00:11:19 +00:00
|
|
|
#include "opal/class/opal_list.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2006-10-02 00:46:31 +00:00
|
|
|
#include "orte/util/proc_info.h"
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
#include "orte/mca/plm/base/base.h"
|
2008-06-18 03:15:56 +00:00
|
|
|
#include "orte/mca/plm/base/plm_private.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
int orte_plm_base_finalize(void)
|
2005-03-14 20:57:21 +00:00
|
|
|
{
|
2006-10-02 00:46:31 +00:00
|
|
|
int rc;
|
|
|
|
|
2006-09-14 21:29:51 +00:00
|
|
|
/* Finalize the selected module */
|
2008-02-28 01:57:57 +00:00
|
|
|
orte_plm.finalize();
|
2006-10-02 00:46:31 +00:00
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
/* if we are the HNP, then stop our receive */
|
2009-03-05 21:56:03 +00:00
|
|
|
if (orte_process_info.hnp) {
|
2008-02-28 01:57:57 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_plm_base_comm_stop())) {
|
2006-10-02 00:46:31 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
}
|
2006-09-14 21:29:51 +00:00
|
|
|
|
2005-04-15 17:19:01 +00:00
|
|
|
return ORTE_SUCCESS;
|
2005-04-15 17:04:57 +00:00
|
|
|
}
|
2005-03-14 20:57:21 +00:00
|
|
|
|
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
int orte_plm_base_close(void)
|
2005-04-15 17:04:57 +00:00
|
|
|
{
|
2006-09-29 12:45:50 +00:00
|
|
|
/* finalize selected module */
|
2008-02-28 01:57:57 +00:00
|
|
|
if (orte_plm_base.selected) {
|
|
|
|
orte_plm.finalize();
|
2006-09-29 12:45:50 +00:00
|
|
|
}
|
|
|
|
|
2006-11-13 21:51:34 +00:00
|
|
|
/* clearout the orted cmd locks */
|
2008-02-28 01:57:57 +00:00
|
|
|
OBJ_DESTRUCT(&orte_plm_globals.orted_cmd_lock);
|
|
|
|
OBJ_DESTRUCT(&orte_plm_globals.orted_cmd_cond);
|
2006-11-13 21:51:34 +00:00
|
|
|
|
2009-02-09 20:44:44 +00:00
|
|
|
/* clearout the rsh support */
|
2009-04-29 00:11:19 +00:00
|
|
|
orte_plm_base_local_slave_finalize();
|
|
|
|
|
|
|
|
/* remove the rsh agent info */
|
2009-02-09 20:44:44 +00:00
|
|
|
if (NULL != orte_plm_globals.rsh_agent_argv) {
|
|
|
|
opal_argv_free(orte_plm_globals.rsh_agent_argv);
|
|
|
|
}
|
|
|
|
if (NULL != orte_plm_globals.rsh_agent_path) {
|
|
|
|
free(orte_plm_globals.rsh_agent_path);
|
|
|
|
}
|
|
|
|
|
2009-04-29 00:11:19 +00:00
|
|
|
OBJ_DESTRUCT(&orte_plm_globals.slave_files);
|
|
|
|
|
|
|
|
/* Close all open components */
|
|
|
|
mca_base_components_close(orte_plm_globals.output,
|
|
|
|
&orte_plm_base.available_components, NULL);
|
|
|
|
OBJ_DESTRUCT(&orte_plm_base.available_components);
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|