1
1
openmpi/orte/runtime/orte_finalize.c
Ralph Castain ea35e47228 Fat SMPs (i.e., systems with nodes containing large numbers of cpus) were failing to start due to connection failures of the opal/pmix support. Root cause was that (a) we were setting the client socket to non-blocking before calling connect, and (b) the server was using the event library to harvest the accepts, and also did the handshake while in that event. So the server would backup beyond the connection backlog limit, and we would fail.
Changing the client to leave its socket as blocking during the connect doesn't solve the problem by itself - you also have to introduce a sleep delay once the backlog is hit to avoid simply machine-gunning your way thru retries. This gets somewhat difficult to adjust as you don't want to unnecessarily prolong startup time.

We've solved this before by adding a listening thread that simply reaps accepts and shoves them into the event library for subsequent processing. This would resolve the problem, but meant yet another daemon-level thread. So I centralized the listening thread support and let multiple elements register listeners on it. Thus, each daemon now has a single listening thread that reaps accepts from multiple sources - for now, the orte/pmix server and the oob/usock support are using it. I'll add in the oob/tcp component later.

This still didn't fully resolve the SMP problem, especially on coprocessor cards (e.g., KNC). Removing the shared memory dstore support helped further improve the behavior - it looks like there is some kind of memory paging issue there that needs further understanding. Given that the shared memory support was about to be lost when I bring over the PMIx integration (until it is restored in that library), it seemed like a reasonable thing to just remove it at this point.
2015-05-29 14:37:14 -07:00

90 строки
2.6 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-2015 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/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);
/* 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;
}