root/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdlopen/pdl_pdlopen_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. pdlopen_component_register
  2. pdlopen_component_open
  3. pdlopen_component_close
  4. pdlopen_component_query

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2015 Cisco Systems, Inc.  All rights reserved.
   4  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   5  *                         reserved.
   6  * $COPYRIGHT$
   7  *
   8  * Additional copyrights may follow
   9  *
  10  * $HEADER$
  11  */
  12 
  13 #include <src/include/pmix_config.h>
  14 
  15 #include "pmix_common.h"
  16 #include "src/mca/pdl/pdl.h"
  17 #include "src/util/argv.h"
  18 
  19 #include "pdl_pdlopen.h"
  20 
  21 
  22 /*
  23  * Public string showing the sysinfo ompi_linux component version number
  24  */
  25 const char *pmix_pdl_pdlopen_component_version_string =
  26     "PMIX pdl pdlopen MCA component version " PMIX_VERSION;
  27 
  28 
  29 /*
  30  * Local functions
  31  */
  32 static int pdlopen_component_register(void);
  33 static int pdlopen_component_open(void);
  34 static int pdlopen_component_close(void);
  35 static int pdlopen_component_query(pmix_mca_base_module_t **module, int *priority);
  36 
  37 /*
  38  * Instantiate the public struct with all of our public information
  39  * and pointers to our public functions in it
  40  */
  41 
  42 pmix_pdl_pdlopen_component_t mca_pdl_pdlopen_component = {
  43 
  44     /* Fill in the mca_pdl_base_component_t */
  45     .base = {
  46 
  47         /* First, the mca_component_t struct containing meta information
  48            about the component itself */
  49         .base_version = {
  50             PMIX_PDL_BASE_VERSION_1_0_0,
  51 
  52             /* Component name and version */
  53             .pmix_mca_component_name = "pdlopen",
  54             PMIX_MCA_BASE_MAKE_VERSION(component, PMIX_MAJOR_VERSION, PMIX_MINOR_VERSION,
  55                                        PMIX_RELEASE_VERSION),
  56 
  57             /* Component functions */
  58             .pmix_mca_register_component_params = pdlopen_component_register,
  59             .pmix_mca_open_component = pdlopen_component_open,
  60             .pmix_mca_close_component = pdlopen_component_close,
  61             .pmix_mca_query_component = pdlopen_component_query,
  62         },
  63 
  64         .base_data = {
  65             /* The component is checkpoint ready */
  66             PMIX_MCA_BASE_METADATA_PARAM_CHECKPOINT
  67         },
  68 
  69         /* The pdl framework members */
  70         .priority = 80
  71     },
  72 };
  73 
  74 
  75 static int pdlopen_component_register(void)
  76 {
  77     int ret;
  78 
  79     mca_pdl_pdlopen_component.filename_suffixes_mca_storage = ".so,.dylib,.dll,.sl";
  80     ret =
  81         pmix_mca_base_component_var_register(&mca_pdl_pdlopen_component.base.base_version,
  82                                              "filename_suffixes",
  83                                              "Comma-delimited list of filename suffixes that the pdlopen component will try",
  84                                              PMIX_MCA_BASE_VAR_TYPE_STRING,
  85                                              NULL,
  86                                              0,
  87                                              PMIX_MCA_BASE_VAR_FLAG_SETTABLE,
  88                                              PMIX_INFO_LVL_5,
  89                                              PMIX_MCA_BASE_VAR_SCOPE_LOCAL,
  90                                              &mca_pdl_pdlopen_component.filename_suffixes_mca_storage);
  91     if (ret < 0) {
  92         return ret;
  93     }
  94     mca_pdl_pdlopen_component.filename_suffixes =
  95         pmix_argv_split(mca_pdl_pdlopen_component.filename_suffixes_mca_storage,
  96                         ',');
  97 
  98     return PMIX_SUCCESS;
  99 }
 100 
 101 static int pdlopen_component_open(void)
 102 {
 103     return PMIX_SUCCESS;
 104 }
 105 
 106 
 107 static int pdlopen_component_close(void)
 108 {
 109     if (NULL != mca_pdl_pdlopen_component.filename_suffixes) {
 110         pmix_argv_free(mca_pdl_pdlopen_component.filename_suffixes);
 111         mca_pdl_pdlopen_component.filename_suffixes = NULL;
 112     }
 113 
 114     return PMIX_SUCCESS;
 115 }
 116 
 117 
 118 static int pdlopen_component_query(pmix_mca_base_module_t **module, int *priority)
 119 {
 120     /* The priority value is somewhat meaningless here; by
 121        pmix/mca/pdl/configure.m4, there's at most one component
 122        available. */
 123     *priority = mca_pdl_pdlopen_component.base.priority;
 124     *module = &pmix_pdl_pdlopen_module.super;
 125 
 126     return PMIX_SUCCESS;
 127 }

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