1
1
openmpi/orte/runtime/orte_finalize.c
Ralph Castain 011403c04a Fix a number of issues, some of which have lingered for a long time:
* provide a more reliable way of determining that a process is a singleton by leveraging the schizo framework. Add new components for slurm, alps, and orte to detect when we are in a managed environment, and if we have been launched by mpirun or a native launcher. Set the correct envars to control ess and pmix selection in each case.

* change the relative priority of the pmix120 and pmix112 components to make pmix120 the default

* fix singleton comm-spawn by correctly setting the num_apps field of the orte_job_t created by the daemon - this fixes a segfault in register_nspace on newly created daemons

* ensure orterun doesn't propagate any ess or pmix directives in its environment

* Cleanup a few valgrind issues and memory leaks

* Fix a race condition that prevented the client from completing notification registrations (missing thread shift)

* Ensure the shizo/alps component detects launch by mpirun
2016-03-01 06:53:00 -08:00

95 строки
2.7 KiB
C

/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file **/
#include "orte_config.h"
#include "orte/constants.h"
#include "opal/runtime/opal.h"
#include "opal/util/output.h"
#include "orte/mca/ess/ess.h"
#include "orte/mca/ess/base/base.h"
#include "orte/mca/schizo/base/base.h"
#include "orte/runtime/orte_globals.h"
#include "orte/runtime/runtime.h"
#include "orte/runtime/orte_locks.h"
#include "orte/util/listener.h"
#include "orte/util/name_fns.h"
#include "orte/util/show_help.h"
int orte_finalize(void)
{
int rc;
--orte_initialized;
if (0 != orte_initialized) {
/* check for mismatched calls */
if (0 > orte_initialized) {
opal_output(0, "%s MISMATCHED CALLS TO ORTE FINALIZE",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
}
return ORTE_ERROR;
}
/* protect against multiple calls */
if (opal_atomic_trylock(&orte_finalize_lock)) {
return ORTE_SUCCESS;
}
/* flag that we are finalizing */
orte_finalizing = true;
if (ORTE_PROC_IS_HNP || ORTE_PROC_IS_DAEMON) {
/* stop listening for connections - will
* be ignored if no listeners were registered */
orte_stop_listening();
}
/* flush the show_help system */
orte_show_help_finalize();
/* call the finalize function for this environment */
if (ORTE_SUCCESS != (rc = orte_ess.finalize())) {
return rc;
}
/* close the ess itself */
(void) mca_base_framework_close(&orte_ess_base_framework);
/* finalize and close schizo */
orte_schizo.finalize();
(void) mca_base_framework_close(&orte_schizo_base_framework);
/* cleanup the process info */
orte_proc_info_finalize();
/* Close the general debug stream */
opal_output_close(orte_debug_output);
/* finalize the opal utilities */
rc = opal_finalize();
return rc;
}