root/orte/mca/errmgr/default_hnp/errmgr_default_hnp_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. default_hnp_register
  2. default_hnp_open
  3. default_hnp_close
  4. default_hnp_component_query

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2010      Cisco Systems, Inc. All rights reserved.
   4  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   5  *                         reserved.
   6  *
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 #include "orte_config.h"
  15 #include "opal/util/output.h"
  16 
  17 #include "orte/mca/errmgr/errmgr.h"
  18 #include "orte/mca/errmgr/base/base.h"
  19 #include "orte/mca/errmgr/base/errmgr_private.h"
  20 #include "errmgr_default_hnp.h"
  21 
  22 /*
  23  * Public string for version number
  24  */
  25 const char *orte_errmgr_default_hnp_component_version_string =
  26     "ORTE ERRMGR default_hnp MCA component version " ORTE_VERSION;
  27 
  28 /*
  29  * Local functionality
  30  */
  31 static int default_hnp_register(void);
  32 static int default_hnp_open(void);
  33 static int default_hnp_close(void);
  34 static int default_hnp_component_query(mca_base_module_t **module, int *priority);
  35 
  36 /*
  37  * Instantiate the public struct with all of our public information
  38  * and pointer to our public functions in it
  39  */
  40 orte_errmgr_base_component_t mca_errmgr_default_hnp_component = {
  41     /* Handle the general mca_component_t struct containing
  42      *  meta information about the component default_hnp
  43      */
  44     .base_version = {
  45         ORTE_ERRMGR_BASE_VERSION_3_0_0,
  46         /* Component name and version */
  47         .mca_component_name = "default_hnp",
  48         MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
  49                               ORTE_RELEASE_VERSION),
  50 
  51         /* Component open and close functions */
  52         .mca_open_component = default_hnp_open,
  53         .mca_close_component = default_hnp_close,
  54         .mca_query_component = default_hnp_component_query,
  55         .mca_register_component_params = default_hnp_register,
  56     },
  57     .base_data = {
  58         /* The component is checkpoint ready */
  59         MCA_BASE_METADATA_PARAM_CHECKPOINT
  60     },
  61 };
  62 
  63 static int my_priority;
  64 
  65 static int default_hnp_register(void)
  66 {
  67     mca_base_component_t *c = &mca_errmgr_default_hnp_component.base_version;
  68 
  69     my_priority = 1000;
  70     (void) mca_base_component_var_register(c, "priority",
  71                                            "Priority of the default_hnp errmgr component",
  72                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  73                                            OPAL_INFO_LVL_9,
  74                                            MCA_BASE_VAR_SCOPE_READONLY, &my_priority);
  75 
  76     return ORTE_SUCCESS;
  77 }
  78 
  79 static int default_hnp_open(void)
  80 {
  81     return ORTE_SUCCESS;
  82 }
  83 
  84 static int default_hnp_close(void)
  85 {
  86     return ORTE_SUCCESS;
  87 }
  88 
  89 static int default_hnp_component_query(mca_base_module_t **module, int *priority)
  90 {
  91     if (ORTE_PROC_IS_HNP && !ORTE_PROC_IS_MASTER) {
  92         /* we are the default HNP component */
  93         *priority = my_priority;
  94         *module = (mca_base_module_t *)&orte_errmgr_default_hnp_module;
  95         return ORTE_SUCCESS;
  96     }
  97 
  98     *module = NULL;
  99     *priority = -1;
 100     return ORTE_ERROR;
 101 }

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