root/orte/mca/state/app/state_app_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. state_app_open
  2. state_app_close
  3. state_app_component_query

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
   4  *                         reserved.
   5  *
   6  * $COPYRIGHT$
   7  *
   8  * Additional copyrights may follow
   9  *
  10  * $HEADER$
  11  */
  12 
  13 #include "orte_config.h"
  14 #include "opal/util/output.h"
  15 
  16 #include "orte/mca/state/state.h"
  17 #include "orte/mca/state/base/base.h"
  18 #include "state_app.h"
  19 
  20 /*
  21  * Public string for version number
  22  */
  23 const char *orte_state_app_component_version_string =
  24     "ORTE STATE app MCA component version " ORTE_VERSION;
  25 
  26 /*
  27  * Local functionality
  28  */
  29 static int state_app_open(void);
  30 static int state_app_close(void);
  31 static int state_app_component_query(mca_base_module_t **module, int *priority);
  32 
  33 /*
  34  * Instantiate the public struct with all of our public information
  35  * and pointer to our public functions in it
  36  */
  37 orte_state_base_component_t mca_state_app_component =
  38 {
  39     /* Handle the general mca_component_t struct containing
  40      *  meta information about the component
  41      */
  42     .base_version = {
  43         ORTE_STATE_BASE_VERSION_1_0_0,
  44         /* Component name and version */
  45         .mca_component_name = "app",
  46         MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
  47                               ORTE_RELEASE_VERSION),
  48 
  49         /* Component open and close functions */
  50         .mca_open_component = state_app_open,
  51         .mca_close_component = state_app_close,
  52         .mca_query_component = state_app_component_query,
  53     },
  54     .base_data = {
  55         /* The component is checkpoint ready */
  56         MCA_BASE_METADATA_PARAM_CHECKPOINT
  57     },
  58 };
  59 
  60 static int my_priority=1000;
  61 
  62 static int state_app_open(void)
  63 {
  64     return ORTE_SUCCESS;
  65 }
  66 
  67 static int state_app_close(void)
  68 {
  69     return ORTE_SUCCESS;
  70 }
  71 
  72 static int state_app_component_query(mca_base_module_t **module, int *priority)
  73 {
  74     if (ORTE_PROC_IS_APP) {
  75         /* set our priority high as we are the default for apps */
  76         *priority = my_priority;
  77         *module = (mca_base_module_t *)&orte_state_app_module;
  78         return ORTE_SUCCESS;
  79     }
  80 
  81     *priority = -1;
  82     *module = NULL;
  83     return ORTE_ERROR;
  84 }

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