root/opal/mca/pmix/pmix4x/pmix/src/mca/gds/base/gds_base_frame.c

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

DEFINITIONS

This source file includes following definitions.
  1. pmix_gds_close
  2. pmix_gds_open

   1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
   2 /*
   3  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2009 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2005 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2012-2013 Los Alamos National Security, Inc.  All rights reserved.
  14  * Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
  15  * Copyright (c) 2015-2016 Research Organization for Information Science
  16  *                         and Technology (RIST). All rights reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  */
  23 /** @file:
  24  *
  25  */
  26 #include <src/include/pmix_config.h>
  27 
  28 #include <pmix_common.h>
  29 
  30 #ifdef HAVE_STRING_H
  31 #include <string.h>
  32 #endif
  33 
  34 #include "src/class/pmix_list.h"
  35 #include "src/util/argv.h"
  36 
  37 #include "src/mca/base/base.h"
  38 #include "src/mca/gds/base/base.h"
  39 
  40 /*
  41  * The following file was created by configure.  It contains extern
  42  * statements and the definition of an array of pointers to each
  43  * component's public mca_base_component_t struct.
  44  */
  45 
  46 #include "src/mca/gds/base/static-components.h"
  47 
  48 /* Instantiate the global vars */
  49 pmix_gds_globals_t pmix_gds_globals = {{{0}}};
  50 int pmix_gds_base_output = -1;
  51 
  52 static pmix_status_t pmix_gds_close(void)
  53 {
  54   pmix_gds_base_active_module_t *active, *prev;
  55 
  56     if (!pmix_gds_globals.initialized) {
  57         return PMIX_SUCCESS;
  58     }
  59     pmix_gds_globals.initialized = false;
  60 
  61     PMIX_LIST_FOREACH_SAFE(active, prev, &pmix_gds_globals.actives, pmix_gds_base_active_module_t) {
  62       pmix_list_remove_item(&pmix_gds_globals.actives, &active->super);
  63       if (NULL != active->module->finalize) {
  64         active->module->finalize();
  65       }
  66       PMIX_RELEASE(active);
  67     }
  68     PMIX_DESTRUCT(&pmix_gds_globals.actives);
  69 
  70     if (NULL != pmix_gds_globals.all_mods) {
  71         free(pmix_gds_globals.all_mods);
  72     }
  73     return pmix_mca_base_framework_components_close(&pmix_gds_base_framework, NULL);
  74 }
  75 
  76 static pmix_status_t pmix_gds_open(pmix_mca_base_open_flag_t flags)
  77 {
  78     pmix_status_t rc;
  79 
  80     /* initialize globals */
  81     pmix_gds_globals.initialized = true;
  82     pmix_gds_globals.all_mods = NULL;
  83     PMIX_CONSTRUCT(&pmix_gds_globals.actives, pmix_list_t);
  84 
  85     /* Open up all available components */
  86     rc = pmix_mca_base_framework_components_open(&pmix_gds_base_framework, flags);
  87     pmix_gds_base_output = pmix_gds_base_framework.framework_output;
  88     return rc;
  89 }
  90 
  91 PMIX_MCA_BASE_FRAMEWORK_DECLARE(pmix, gds, "PMIx Generalized Data Store",
  92                                 NULL, pmix_gds_open, pmix_gds_close,
  93                                 mca_gds_base_static_components, 0);
  94 
  95 PMIX_CLASS_INSTANCE(pmix_gds_base_active_module_t,
  96                     pmix_list_item_t,
  97                     NULL, NULL);

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