root/orte/mca/state/tool/state_tool_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. state_tool_open
  2. state_tool_close
  3. state_tool_component_query

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2011-2015 Los Alamos National Security, LLC.
   4  *                         All rights reserved.
   5  * Copyright (c) 2013      Intel, Inc. All rights 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/state/state.h"
  18 #include "orte/mca/state/base/base.h"
  19 #include "state_tool.h"
  20 
  21 /*
  22  * Public string for version number
  23  */
  24 const char *orte_state_tool_component_version_string =
  25     "ORTE STATE tool MCA component version " ORTE_VERSION;
  26 
  27 /*
  28  * Local functionality
  29  */
  30 static int state_tool_open(void);
  31 static int state_tool_close(void);
  32 static int state_tool_component_query(mca_base_module_t **module, int *priority);
  33 
  34 /*
  35  * Instantiate the public struct with all of our public information
  36  * and pointer to our public functions in it
  37  */
  38 orte_state_base_component_t mca_state_tool_component =
  39 {
  40     /* Handle the general mca_component_t struct containing
  41      *  meta information about the component
  42      */
  43     .base_version = {
  44         ORTE_STATE_BASE_VERSION_1_0_0,
  45         /* Component name and version */
  46         .mca_component_name = "tool",
  47         MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
  48                               ORTE_RELEASE_VERSION),
  49 
  50         /* Component open and close functions */
  51         .mca_open_component = state_tool_open,
  52         .mca_close_component = state_tool_close,
  53         .mca_query_component = state_tool_component_query
  54     },
  55     .base_data = {
  56         /* The component is checkpoint ready */
  57         MCA_BASE_METADATA_PARAM_CHECKPOINT
  58     },
  59 };
  60 
  61 static int my_priority=1000;
  62 
  63 static int state_tool_open(void)
  64 {
  65     return ORTE_SUCCESS;
  66 }
  67 
  68 static int state_tool_close(void)
  69 {
  70     return ORTE_SUCCESS;
  71 }
  72 
  73 static int state_tool_component_query(mca_base_module_t **module, int *priority)
  74 {
  75     if (ORTE_PROC_IS_TOOL) {
  76         /* set our priority high as we are the default for tools */
  77         *priority = my_priority;
  78         *module = (mca_base_module_t *)&orte_state_tool_module;
  79         return ORTE_SUCCESS;
  80     }
  81 
  82     *priority = -1;
  83     *module = NULL;
  84     return ORTE_ERROR;
  85 }

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