1
1
openmpi/opal/runtime/opal_finalize.c
Jeff Squyres 2ba10c37fe Per RFC, bring in the following changes:
* Remove paffinity, maffinity, and carto frameworks -- they've been
   wholly replaced by hwloc.
 * Move ompi_mpi_init() affinity-setting/checking code down to ORTE.
 * Update sm, smcuda, wv, and openib components to no longer use carto.
   Instead, use hwloc data.  There are still optimizations possible in
   the sm/smcuda BTLs (i.e., making multiple mpools).  Also, the old
   carto-based code found out how many NUMA nodes were ''available''
   -- not how many were used ''in this job''.  The new hwloc-using
   code computes the same value -- it was not updated to calculate how
   many NUMA nodes are used ''by this job.''
   * Note that I cannot compile the smcuda and wv BTLs -- I ''think''
     they're right, but they need to be verified by their owners.
 * The openib component now does a bunch of stuff to figure out where
   "near" OpenFabrics devices are.  '''THIS IS A CHANGE IN DEFAULT
   BEHAVIOR!!''' and still needs to be verified by OpenFabrics vendors
   (I do not have a NUMA machine with an OpenFabrics device that is a
   non-uniform distance from multiple different NUMA nodes).
 * Completely rewrite the OMPI_Affinity_str() routine from the
   "affinity" mpiext extension.  This extension now understands
   hyperthreads; the output format of it has changed a bit to reflect
   this new information.
 * Bunches of minor changes around the code base to update names/types
   from maffinity/paffinity-based names to hwloc-based names.
 * Add some helper functions into the hwloc base, mainly having to do
   with the fact that we have the hwloc data reporting ''all''
   topology information, but sometimes you really only want the
   (online | available) data.

This commit was SVN r26391.
2012-05-07 14:52:54 +00:00

159 строки
4.2 KiB
C

/*
* Copyright (c) 2004-2010 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.
* 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) 2008-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2012 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file **/
#include "opal_config.h"
#include "opal/class/opal_object.h"
#include "opal/dss/dss.h"
#include "opal/util/trace.h"
#include "opal/util/output.h"
#include "opal/util/malloc.h"
#include "opal/util/net.h"
#include "opal/util/keyval_parse.h"
#include "opal/util/show_help.h"
#include "opal/memoryhooks/memory.h"
#include "opal/mca/base/base.h"
#include "opal/runtime/opal.h"
#include "opal/constants.h"
#include "opal/mca/if/base/base.h"
#include "opal/mca/installdirs/base/base.h"
#include "opal/mca/memcpy/base/base.h"
#include "opal/mca/memory/base/base.h"
#include "opal/mca/backtrace/base/base.h"
#include "opal/mca/timer/base/base.h"
#include "opal/mca/hwloc/base/base.h"
#include "opal/mca/event/base/base.h"
#include "opal/runtime/opal_progress.h"
#include "opal/mca/shmem/base/base.h"
#if OPAL_ENABLE_FT_CR == 1
#include "opal/mca/compress/base/base.h"
#endif
#include "opal/runtime/opal_cr.h"
#include "opal/mca/crs/base/base.h"
extern int opal_initialized;
extern int opal_util_initialized;
int
opal_finalize_util(void)
{
if( --opal_util_initialized != 0 ) {
if( opal_util_initialized < 0 ) {
return OPAL_ERROR;
}
return OPAL_SUCCESS;
}
/* Clear out all the registered MCA params */
mca_base_param_finalize();
/* close interfaces code. */
opal_if_base_close();
opal_net_finalize();
/* keyval lex-based parser */
opal_util_keyval_parse_finalize();
opal_installdirs_base_close();
/* finalize the memory allocator */
opal_malloc_finalize();
/* finalize the trace system */
opal_trace_finalize();
/* finalize the show_help system */
opal_show_help_finalize();
/* finalize the output system. This has to come *after* the
malloc code, as the malloc code needs to call into this, but
the malloc code turning off doesn't affect opal_output that
much */
opal_output_finalize();
/* close the dss */
opal_dss_close();
/* finalize the class/object system */
opal_class_finalize();
return OPAL_SUCCESS;
}
int
opal_finalize(void)
{
if( --opal_initialized != 0 ) {
if( opal_initialized < 0 ) {
return OPAL_ERROR;
}
return OPAL_SUCCESS;
}
/* close the checkpoint and restart service */
opal_cr_finalize();
#if OPAL_ENABLE_FT_CR == 1
opal_compress_base_close();
#endif
opal_progress_finalize();
opal_event_base_close();
/* close high resolution timers */
opal_timer_base_close();
opal_backtrace_base_close();
/* close the memory manager components. Registered hooks can
still be fired any time between now and the call to
opal_mem_free_finalize(), and callbacks from the memory manager
hooks to the bowels of the mem_free code can still occur any
time between now and end of application (even post main()!) */
opal_memory_base_close();
/* finalize the memory manager / tracker */
opal_mem_hooks_finalize();
/* close the shmem framework */
opal_shmem_base_close();
/* close the hwloc framework */
opal_hwloc_base_close();
/* close the memcpy base */
opal_memcpy_base_close();
/* finalize the mca */
mca_base_close();
/* finalize util code */
opal_finalize_util();
return OPAL_SUCCESS;
}