root/orte/mca/errmgr/default_app/errmgr_default_app_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. errmgr_default_app_register
  2. errmgr_default_app_open
  3. errmgr_default_app_close
  4. errmgr_default_app_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 "errmgr_default_app.h"
  20 
  21 /*
  22  * Public string for version number
  23  */
  24 const char *orte_errmgr_default_app_component_version_string =
  25     "ORTE ERRMGR default_app MCA component version " ORTE_VERSION;
  26 
  27 /*
  28  * Local functionality
  29  */
  30 static int errmgr_default_app_register(void);
  31 static int errmgr_default_app_open(void);
  32 static int errmgr_default_app_close(void);
  33 static int errmgr_default_app_component_query(mca_base_module_t **module, int *priority);
  34 
  35 /*
  36  * Instantiate the public struct with all of our public information
  37  * and pointer to our public functions in it
  38  */
  39 orte_errmgr_base_component_t mca_errmgr_default_app_component =
  40 {
  41     /* Handle the general mca_component_t struct containing
  42      *  meta information about the component
  43      */
  44     .base_version = {
  45         ORTE_ERRMGR_BASE_VERSION_3_0_0,
  46         /* Component name and version */
  47         .mca_component_name = "default_app",
  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 = errmgr_default_app_open,
  53         .mca_close_component = errmgr_default_app_close,
  54         .mca_query_component = errmgr_default_app_component_query,
  55         .mca_register_component_params = errmgr_default_app_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 errmgr_default_app_register(void)
  66 {
  67     mca_base_component_t *c = &mca_errmgr_default_app_component.base_version;
  68 
  69     my_priority = 1000;
  70     (void) mca_base_component_var_register(c, "priority",
  71                                            "Priority of the default_app 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     return ORTE_SUCCESS;
  76 }
  77 
  78 static int errmgr_default_app_open(void)
  79 {
  80     return ORTE_SUCCESS;
  81 }
  82 
  83 static int errmgr_default_app_close(void)
  84 {
  85     return ORTE_SUCCESS;
  86 }
  87 
  88 static int errmgr_default_app_component_query(mca_base_module_t **module, int *priority)
  89 {
  90     if (ORTE_PROC_IS_APP) {
  91         /* set our priority high as we are the default for apps */
  92         *priority = my_priority;
  93         *module = (mca_base_module_t *)&orte_errmgr_default_app_module;
  94         return ORTE_SUCCESS;
  95     }
  96 
  97     *priority = -1;
  98     *module = NULL;
  99     return ORTE_ERROR;
 100 }

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