root/opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_finalize.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. pmix_rte_finalize

   1 /*
   2  * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2005 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2008-2015 Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2010-2015 Los Alamos National Security, LLC.
  14  *                         All rights reserved.
  15  * Copyright (c) 2013-2019 Intel, Inc.  All rights reserved.
  16  * Copyright (c) 2016-2018 Research Organization for Information Science
  17  *                         and Technology (RIST). All rights reserved.
  18  * $COPYRIGHT$
  19  *
  20  * Additional copyrights may follow
  21  *
  22  * $HEADER$
  23  */
  24 
  25 /** @file **/
  26 
  27 #include <src/include/pmix_config.h>
  28 
  29 #include "src/class/pmix_object.h"
  30 #include "src/client/pmix_client_ops.h"
  31 #include "src/common/pmix_attributes.h"
  32 #include "src/util/output.h"
  33 #include "src/util/keyval_parse.h"
  34 #include "src/util/show_help.h"
  35 #include "src/mca/base/base.h"
  36 #include "src/mca/base/pmix_mca_base_var.h"
  37 #include "src/mca/bfrops/base/base.h"
  38 #include "src/mca/pcompress/base/base.h"
  39 #include "src/mca/gds/base/base.h"
  40 #include "src/mca/pif/base/base.h"
  41 #include "src/mca/pinstalldirs/base/base.h"
  42 #include "src/mca/plog/base/base.h"
  43 #include "src/mca/pnet/base/base.h"
  44 #include "src/mca/preg/base/base.h"
  45 #include "src/mca/psec/base/base.h"
  46 #include "src/mca/ptl/base/base.h"
  47 #include PMIX_EVENT_HEADER
  48 
  49 #include "src/runtime/pmix_rte.h"
  50 #include "src/runtime/pmix_progress_threads.h"
  51 
  52 extern int pmix_initialized;
  53 extern bool pmix_init_called;
  54 
  55 void pmix_rte_finalize(void)
  56 {
  57     int i;
  58     pmix_notify_caddy_t *cd;
  59 
  60     if( --pmix_initialized != 0 ) {
  61         if( pmix_initialized < 0 ) {
  62             fprintf(stderr, "PMIx Finalize called too many times\n");
  63             return;
  64         }
  65         return;
  66     }
  67 
  68     /* release the attribute support trackers */
  69     pmix_release_registered_attrs();
  70 
  71     /* close plog */
  72     (void)pmix_mca_base_framework_close(&pmix_plog_base_framework);
  73 
  74     /* close preg */
  75     (void)pmix_mca_base_framework_close(&pmix_preg_base_framework);
  76 
  77     /* cleanup communications */
  78     (void)pmix_mca_base_framework_close(&pmix_ptl_base_framework);
  79 
  80     /* close the security framework */
  81     (void)pmix_mca_base_framework_close(&pmix_psec_base_framework);
  82 
  83     /* close bfrops */
  84     (void)pmix_mca_base_framework_close(&pmix_bfrops_base_framework);
  85 
  86     /* close compress */
  87     (void)pmix_mca_base_framework_close(&pmix_pcompress_base_framework);
  88 
  89     /* close GDS */
  90     (void)pmix_mca_base_framework_close(&pmix_gds_base_framework);
  91 
  92     /* finalize the mca */
  93     /* Clear out all the registered MCA params */
  94     pmix_deregister_params();
  95     pmix_mca_base_var_finalize();
  96 
  97     /* keyval lex-based parser */
  98     pmix_util_keyval_parse_finalize();
  99 
 100     (void)pmix_mca_base_framework_close(&pmix_pinstalldirs_base_framework);
 101     (void)pmix_mca_base_framework_close(&pmix_pif_base_framework);
 102     (void)pmix_mca_base_close();
 103 
 104     /* finalize the show_help system */
 105     pmix_show_help_finalize();
 106 
 107     /* finalize the output system.  This has to come *after* the
 108        malloc code, as the malloc code needs to call into this, but
 109        the malloc code turning off doesn't affect pmix_output that
 110        much */
 111     pmix_output_finalize();
 112 
 113     /* clean out the globals */
 114     PMIX_RELEASE(pmix_globals.mypeer);
 115     PMIX_DESTRUCT(&pmix_globals.events);
 116     PMIX_LIST_DESTRUCT(&pmix_globals.cached_events);
 117     /* clear any notifications */
 118     for (i=0; i < pmix_globals.max_events; i++) {
 119         pmix_hotel_checkout_and_return_occupant(&pmix_globals.notifications, i, (void**)&cd);
 120         if (NULL != cd) {
 121             PMIX_RELEASE(cd);
 122         }
 123     }
 124     PMIX_DESTRUCT(&pmix_globals.notifications);
 125     PMIX_LIST_DESTRUCT(&pmix_globals.iof_requests);
 126     PMIX_LIST_DESTRUCT(&pmix_globals.stdin_targets);
 127 
 128     /* now safe to release the event base */
 129     if (!pmix_globals.external_evbase) {
 130         (void)pmix_progress_thread_stop(NULL);
 131     }
 132 
 133 }

/* [<][>][^][v][top][bottom][index][help] */