root/orte/mca/snapc/full/snapc_full_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. snapc_full_register
  2. snapc_full_open
  3. snapc_full_close

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2010 The Trustees of Indiana University.
   4  *                         All rights reserved.
   5  * Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
   6  *                         All rights reserved.
   7  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   8  *                         University of Stuttgart.  All rights reserved.
   9  * Copyright (c) 2004-2005 The Regents of the University of California.
  10  *                         All rights reserved.
  11  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
  12  *                         reserved.
  13  * $COPYRIGHT$
  14  *
  15  * Additional copyrights may follow
  16  *
  17  * $HEADER$
  18  */
  19 
  20 #include "orte_config.h"
  21 #include "opal/util/output.h"
  22 
  23 #include "orte/mca/snapc/snapc.h"
  24 #include "orte/mca/snapc/base/base.h"
  25 #include "snapc_full.h"
  26 
  27 /*
  28  * Public string for version number
  29  */
  30 const char *orte_snapc_full_component_version_string =
  31 "ORTE SNAPC full MCA component version " ORTE_VERSION;
  32 
  33 /*
  34  * Local functionality
  35  */
  36 static int snapc_full_open(void);
  37 static int snapc_full_close(void);
  38 static int snapc_full_register(void);
  39 
  40 bool orte_snapc_full_skip_app   = false;
  41 bool orte_snapc_full_timing_enabled = false;
  42 int orte_snapc_full_progress_meter = 0;
  43 int orte_snapc_full_max_wait_time = 20;
  44 
  45 /*
  46  * Instantiate the public struct with all of our public information
  47  * and pointer to our public functions in it
  48  */
  49 orte_snapc_full_component_t mca_snapc_full_component = {
  50     /* First do the base component stuff */
  51     {
  52         /* Handle the general mca_component_t struct containing
  53          *  meta information about the component itfull
  54          */
  55         .base_version = {
  56             ORTE_SNAPC_BASE_VERSION_2_0_0,
  57             /* Component name and version */
  58             .mca_component_name = "full",
  59             MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
  60                                   ORTE_RELEASE_VERSION),
  61 
  62             /* Component open and close functions */
  63             .mca_open_component = snapc_full_open,
  64             .mca_close_component = snapc_full_close,
  65             .mca_query_component = orte_snapc_full_component_query,
  66             .mca_register_component_params = snapc_full_register,
  67         },
  68         .base_data = {
  69             /* The component is checkpoint ready */
  70             MCA_BASE_METADATA_PARAM_CHECKPOINT
  71         },
  72 
  73         .verbose = 0,
  74         .output_handle = -1,
  75     }
  76 };
  77 
  78 static int snapc_full_register (void)
  79 {
  80     mca_base_component_t *component = &mca_snapc_full_component.super.base_version;
  81     /*
  82      * This should be the last component to ever get used since
  83      * it doesn't do anything.
  84       */
  85 
  86     /* Default priority */
  87     mca_snapc_full_component.super.priority = 20;
  88     (void) mca_base_component_var_register (component, "priority", "Priority of the SNAPC full component",
  89                                             MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  90                                             OPAL_INFO_LVL_9,
  91                                             MCA_BASE_VAR_SCOPE_READONLY,
  92                                             &mca_snapc_full_component.super.priority);
  93 
  94     mca_snapc_full_component.super.verbose = 0;
  95     (void) mca_base_component_var_register (component, "verbose",
  96                                             "Verbose level for the SNAPC full component",
  97                                             MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  98                                             OPAL_INFO_LVL_9,
  99                                             MCA_BASE_VAR_SCOPE_LOCAL,
 100                                             &mca_snapc_full_component.super.verbose);
 101 
 102     orte_snapc_full_skip_app = false;
 103     (void) mca_base_component_var_register (component, "skip_app",
 104                                             "Not for general use! For debugging only! Shortcut app level coord. [Default = disabled]",
 105                                             MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 106                                             OPAL_INFO_LVL_9,
 107                                             MCA_BASE_VAR_SCOPE_LOCAL,
 108                                             &orte_snapc_full_skip_app);
 109 
 110     orte_snapc_full_timing_enabled = false;
 111     (void) mca_base_component_var_register (component, "enable_timing",
 112                                             "Enable timing information. [Default = disabled]",
 113                                             MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 114                                             OPAL_INFO_LVL_9,
 115                                             MCA_BASE_VAR_SCOPE_LOCAL,
 116                                             &orte_snapc_full_timing_enabled);
 117 
 118     orte_snapc_full_max_wait_time = 20;
 119     (void) mca_base_component_var_register (component, "max_wait_time",
 120                                             "Wait time before orted gives up on checkpoint (seconds)",
 121                                             MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 122                                             OPAL_INFO_LVL_9,
 123                                             MCA_BASE_VAR_SCOPE_LOCAL,
 124                                             &orte_snapc_full_max_wait_time);
 125 
 126     orte_snapc_full_progress_meter = 0;
 127     (void) mca_base_component_var_register (component, "progress_meter",
 128                                             "Display Progress every X percentage done. [Default = 0/off]",
 129                                             MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 130                                             OPAL_INFO_LVL_9,
 131                                             MCA_BASE_VAR_SCOPE_LOCAL,
 132                                             &orte_snapc_full_progress_meter);
 133     orte_snapc_full_progress_meter %= 101;
 134 
 135     return ORTE_SUCCESS;
 136 }
 137 
 138 static int snapc_full_open(void)
 139 {
 140     /* If there is a custom verbose level for this component than use it
 141      * otherwise take our parents level and output channel
 142      */
 143     if ( 0 != mca_snapc_full_component.super.verbose) {
 144         mca_snapc_full_component.super.output_handle = opal_output_open(NULL);
 145         opal_output_set_verbosity(mca_snapc_full_component.super.output_handle,
 146                                   mca_snapc_full_component.super.verbose);
 147     } else {
 148         mca_snapc_full_component.super.output_handle = orte_snapc_base_framework.framework_output;
 149     }
 150 
 151     /* recheck the progress meter (it may have changed between register and open) */
 152     orte_snapc_full_progress_meter %= 101;
 153 
 154     /*
 155      * Debug Output
 156      */
 157     opal_output_verbose(10, mca_snapc_full_component.super.output_handle,
 158                         "snapc:full: open()");
 159     opal_output_verbose(20, mca_snapc_full_component.super.output_handle,
 160                         "snapc:full: open: priority    = %d",
 161                         mca_snapc_full_component.super.priority);
 162     opal_output_verbose(20, mca_snapc_full_component.super.output_handle,
 163                         "snapc:full: open: verbosity   = %d",
 164                         mca_snapc_full_component.super.verbose);
 165     opal_output_verbose(20, mca_snapc_full_component.super.output_handle,
 166                         "snapc:full: open: max_wait_time  = %d",
 167                         orte_snapc_full_max_wait_time);
 168     opal_output_verbose(20, mca_snapc_full_component.super.output_handle,
 169                         "snapc:full: open: progress_meter = %d",
 170                         orte_snapc_full_progress_meter);
 171 
 172     return ORTE_SUCCESS;
 173 }
 174 
 175 static int snapc_full_close(void)
 176 {
 177     opal_output_verbose(10, mca_snapc_full_component.super.output_handle,
 178                         "snapc:full: close()");
 179 
 180     return ORTE_SUCCESS;
 181 }

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