root/orte/mca/errmgr/default_tool/errmgr_default_tool_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. errmgr_default_tool_register
  2. errmgr_default_tool_open
  3. errmgr_default_tool_close
  4. errmgr_default_tool_component_query

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

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