root/orte/mca/ess/pmi/ess_pmi_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. pmi_component_open
  2. pmi_component_query
  3. pmi_component_close

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2011      Cisco Systems, Inc.  All rights reserved.
   4  * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All
   5  *                         rights reserved.
   6  * Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  *
  13  * These symbols are in a file by themselves to provide nice linker
  14  * semantics.  Since linkers generally pull in symbols by object
  15  * files, keeping these symbols as the only symbols in this file
  16  * prevents utility programs such as "ompi_info" from having to import
  17  * entire components just to query their version and parameters.
  18  */
  19 
  20 #include "orte_config.h"
  21 #include "orte/constants.h"
  22 
  23 #include "opal/runtime/opal_params.h"
  24 #include "opal/mca/pmix/pmix.h"
  25 #include "opal/mca/pmix/base/base.h"
  26 
  27 #include "orte/util/proc_info.h"
  28 #include "orte/mca/schizo/schizo.h"
  29 
  30 #include "orte/mca/ess/ess.h"
  31 #include "orte/mca/ess/pmi/ess_pmi.h"
  32 
  33 extern orte_ess_base_module_t orte_ess_pmi_module;
  34 
  35 static int pmi_component_open(void);
  36 static int pmi_component_close(void);
  37 static int pmi_component_query(mca_base_module_t **module, int *priority);
  38 
  39 /*
  40  * Instantiate the public struct with all of our public information
  41  * and pointers to our public functions in it
  42  */
  43 orte_ess_base_component_t mca_ess_pmi_component = {
  44     .base_version = {
  45         ORTE_ESS_BASE_VERSION_3_0_0,
  46 
  47         /* Component name and version */
  48         .mca_component_name = "pmi",
  49         MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
  50                               ORTE_RELEASE_VERSION),
  51 
  52         /* Component open and close functions */
  53         .mca_open_component = pmi_component_open,
  54         .mca_close_component = pmi_component_close,
  55         .mca_query_component = pmi_component_query,
  56     },
  57     .base_data = {
  58         /* The component is checkpoint ready */
  59         MCA_BASE_METADATA_PARAM_CHECKPOINT
  60     },
  61 };
  62 
  63 static int pmi_component_open(void)
  64 {
  65     return ORTE_SUCCESS;
  66 }
  67 
  68 static int pmi_component_query(mca_base_module_t **module, int *priority)
  69 {
  70     orte_schizo_launch_environ_t ret;
  71 
  72     if (!ORTE_PROC_IS_APP) {
  73         *module = NULL;
  74         *priority = 0;
  75         return ORTE_ERROR;
  76     }
  77 
  78     /* find out what our environment looks like */
  79     ret = orte_schizo.check_launch_environment();
  80     if (ORTE_SCHIZO_UNMANAGED_SINGLETON == ret ||
  81         ORTE_SCHIZO_MANAGED_SINGLETON == ret) {
  82         /* not us */
  83         *module = NULL;
  84         *priority = 0;
  85         return ORTE_ERROR;
  86     }
  87 
  88     *priority = 35;
  89     *module = (mca_base_module_t *)&orte_ess_pmi_module;
  90     return ORTE_SUCCESS;
  91 }
  92 
  93 
  94 static int pmi_component_close(void)
  95 {
  96     return ORTE_SUCCESS;
  97 }
  98 

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