root/orte/mca/sstore/central/sstore_central_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. sstore_central_register
  2. sstore_central_open
  3. sstore_central_close

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c)      2010 The Trustees of Indiana University.
   4  *                         All rights reserved.
   5  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   6  *                         reserved.
   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 #include "orte/constants.h"
  17 
  18 #include "orte/mca/sstore/sstore.h"
  19 #include "orte/mca/sstore/base/base.h"
  20 #include "sstore_central.h"
  21 
  22 /*
  23  * Public string for version number
  24  */
  25 const char *orte_sstore_central_component_version_string =
  26     "ORTE SSTORE central MCA component version " ORTE_VERSION;
  27 
  28 /*
  29  * Local functionality
  30  */
  31 static int sstore_central_register (void);
  32 static int sstore_central_open(void);
  33 static int sstore_central_close(void);
  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_sstore_central_component_t mca_sstore_central_component = {
  40     /* First do the base component stuff */
  41     {
  42         /* Handle the general mca_component_t struct containing
  43          *  meta information about the component itcentral
  44          */
  45         .base_version = {
  46             ORTE_SSTORE_BASE_VERSION_2_0_0,
  47             /* Component name and version */
  48             .mca_component_name = "central",
  49             MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
  50                                   ORTE_RELEASE_VERSION),
  51 
  52             /* Component open and close functions */
  53             .mca_open_component = sstore_central_open,
  54             .mca_close_component = sstore_central_close,
  55             .mca_query_component = orte_sstore_central_component_query,
  56             .mca_register_component_params = sstore_central_register,
  57         },
  58         .base_data = {
  59             /* The component is checkpoint ready */
  60             MCA_BASE_METADATA_PARAM_CHECKPOINT
  61         },
  62 
  63         .verbose = 0,
  64         .output_handle = -1,
  65     },
  66 };
  67 
  68 static int sstore_central_register (void)
  69 {
  70     (void)mca_base_component_var_register(&mca_sstore_central_component.super.base_version,
  71                                           "verbose", "Verbose level for the SSTORE central component",
  72                                           MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  73                                           OPAL_INFO_LVL_9,
  74                                           MCA_BASE_VAR_SCOPE_LOCAL,
  75                                           &mca_sstore_central_component.super.verbose);
  76 
  77     /* Default priority */
  78     mca_sstore_central_component.super.priority = 20;
  79     (void)mca_base_component_var_register(&mca_sstore_central_component.super.base_version,
  80                                           "priority", "Priority of the SSTORE central component",
  81                                           MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  82                                           OPAL_INFO_LVL_9,
  83                                           MCA_BASE_VAR_SCOPE_READONLY,
  84                                           &mca_sstore_central_component.super.priority);
  85 
  86     return ORTE_SUCCESS;
  87 }
  88 
  89 static int sstore_central_open(void)
  90 {
  91     /* If there is a custom verbose level for this component than use it
  92      * otherwise take our parents level and output channel
  93      */
  94     if ( 0 != mca_sstore_central_component.super.verbose) {
  95         mca_sstore_central_component.super.output_handle = opal_output_open(NULL);
  96         opal_output_set_verbosity(mca_sstore_central_component.super.output_handle,
  97                                   mca_sstore_central_component.super.verbose);
  98     } else {
  99         mca_sstore_central_component.super.output_handle = orte_sstore_base_framework.framework_output;
 100     }
 101 
 102     /*
 103      * Debug Output
 104      */
 105     opal_output_verbose(10, mca_sstore_central_component.super.output_handle,
 106                         "sstore:central: open()");
 107     opal_output_verbose(20, mca_sstore_central_component.super.output_handle,
 108                         "sstore:central: open: priority   = %d",
 109                         mca_sstore_central_component.super.priority);
 110     opal_output_verbose(20, mca_sstore_central_component.super.output_handle,
 111                         "sstore:central: open: verbosity  = %d",
 112                         mca_sstore_central_component.super.verbose);
 113 
 114     return ORTE_SUCCESS;
 115 }
 116 
 117 static int sstore_central_close(void)
 118 {
 119     opal_output_verbose(10, mca_sstore_central_component.super.output_handle,
 120                         "sstore:central: close()");
 121 
 122     return ORTE_SUCCESS;
 123 }

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