root/opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/preg_base_frame.c

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

DEFINITIONS

This source file includes following definitions.
  1. pmix_preg_close
  2. pmix_preg_open
  3. rcon
  4. rvcon
  5. rvdes

   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 (c) 2019      IBM Corporation.  All rights reserved.
  18  * $COPYRIGHT$
  19  *
  20  * Additional copyrights may follow
  21  *
  22  * $HEADER$
  23  */
  24 /** @file:
  25  *
  26  */
  27 #include <src/include/pmix_config.h>
  28 
  29 #include <pmix_common.h>
  30 
  31 #ifdef HAVE_STRING_H
  32 #include <string.h>
  33 #endif
  34 
  35 #include "src/class/pmix_list.h"
  36 #include "src/mca/base/base.h"
  37 #include "src/mca/preg/base/base.h"
  38 
  39 /*
  40  * The following file was created by configure.  It contains extern
  41  * statements and the definition of an array of pointers to each
  42  * component's public mca_base_component_t struct.
  43  */
  44 
  45 #include "src/mca/preg/base/static-components.h"
  46 
  47 /* Instantiate the global vars */
  48 pmix_preg_globals_t pmix_preg_globals = {{{0}}};
  49 pmix_preg_module_t pmix_preg = {
  50     .generate_node_regex = pmix_preg_base_generate_node_regex,
  51     .generate_ppn = pmix_preg_base_generate_ppn,
  52     .parse_nodes = pmix_preg_base_parse_nodes,
  53     .parse_procs = pmix_preg_base_parse_procs,
  54     .resolve_peers = pmix_preg_base_resolve_peers,
  55     .resolve_nodes = pmix_preg_base_resolve_nodes
  56 };
  57 
  58 static pmix_status_t pmix_preg_close(void)
  59 {
  60     if (!pmix_preg_globals.initialized) {
  61         return PMIX_SUCCESS;
  62     }
  63     pmix_preg_globals.initialized = false;
  64 
  65     PMIX_LIST_DESTRUCT(&pmix_preg_globals.actives);
  66 
  67     return pmix_mca_base_framework_components_close(&pmix_preg_base_framework, NULL);
  68 }
  69 
  70 static pmix_status_t pmix_preg_open(pmix_mca_base_open_flag_t flags)
  71 {
  72     /* initialize globals */
  73     pmix_preg_globals.initialized = true;
  74     PMIX_CONSTRUCT(&pmix_preg_globals.actives, pmix_list_t);
  75 
  76     /* Open up all available components */
  77     return pmix_mca_base_framework_components_open(&pmix_preg_base_framework, flags);
  78 }
  79 
  80 PMIX_MCA_BASE_FRAMEWORK_DECLARE(pmix, preg, "PMIx Regex Operations",
  81                                 NULL, pmix_preg_open, pmix_preg_close,
  82                                 mca_preg_base_static_components, 0);
  83 
  84 PMIX_CLASS_INSTANCE(pmix_preg_base_active_module_t,
  85                     pmix_list_item_t,
  86                     NULL, NULL);
  87 
  88 static void rcon(pmix_regex_range_t *p)
  89 {
  90     p->start = 0;
  91     p->cnt = 0;
  92 }
  93 PMIX_CLASS_INSTANCE(pmix_regex_range_t,
  94                     pmix_list_item_t,
  95                     rcon, NULL);
  96 
  97 static void rvcon(pmix_regex_value_t *p)
  98 {
  99     p->prefix = NULL;
 100     p->suffix = NULL;
 101     p->num_digits = 0;
 102     p->skip = false;
 103     PMIX_CONSTRUCT(&p->ranges, pmix_list_t);
 104 }
 105 static void rvdes(pmix_regex_value_t *p)
 106 {
 107     if (NULL != p->prefix) {
 108         free(p->prefix);
 109     }
 110     if (NULL != p->suffix) {
 111         free(p->suffix);
 112     }
 113     PMIX_LIST_DESTRUCT(&p->ranges);
 114 }
 115 PMIX_CLASS_INSTANCE(pmix_regex_value_t,
 116                     pmix_list_item_t,
 117                     rvcon, rvdes);

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