root/ompi/mca/crcp/bkmrk/crcp_bkmrk_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. crcp_bkmrk_register
  2. crcp_bkmrk_open
  3. crcp_bkmrk_close

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2008 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 "ompi_config.h"
  21 
  22 #include "opal/util/output.h"
  23 
  24 #include "ompi/mca/crcp/crcp.h"
  25 #include "ompi/mca/crcp/base/base.h"
  26 #include "crcp_bkmrk.h"
  27 
  28 /*
  29  * Public string for version number
  30  */
  31 const char *ompi_crcp_bkmrk_component_version_string =
  32 "OMPI CRCP bkmrk MCA component version " OMPI_VERSION;
  33 
  34 bool timing_enabled;
  35 
  36 /*
  37  * Local functionality
  38  */
  39 static int crcp_bkmrk_register(void);
  40 static int crcp_bkmrk_open(void);
  41 static int crcp_bkmrk_close(void);
  42 
  43 /*
  44  * Instantiate the public struct with all of our public information
  45  * and pointer to our public functions in it
  46  */
  47 ompi_crcp_bkmrk_component_t mca_crcp_bkmrk_component = {
  48     /* First do the base component stuff */
  49     {
  50         /* Handle the general mca_component_t struct containing
  51          *  meta information about the component
  52          */
  53         .base_version = {
  54             OMPI_CRCP_BASE_VERSION_2_0_0,
  55             /* Component name and version */
  56             .mca_component_name = "bkmrk",
  57             MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
  58                                   OMPI_RELEASE_VERSION),
  59 
  60             /* Component open and close functions */
  61             .mca_open_component = crcp_bkmrk_open,
  62             .mca_close_component = crcp_bkmrk_close,
  63             .mca_query_component = ompi_crcp_bkmrk_component_query,
  64             .mca_register_component_params = crcp_bkmrk_register,
  65         },
  66         .base_data = {
  67             /* The component is checkpoint ready */
  68             MCA_BASE_METADATA_PARAM_CHECKPOINT
  69         },
  70 
  71         .verbose = 0,
  72         .output_handle = -1,
  73         .priority = 20,
  74     }
  75 };
  76 
  77 static int crcp_bkmrk_register(void)
  78 {
  79     /*
  80      * This should be the last componet to ever get used since
  81      * it doesn't do anything.
  82      */
  83     mca_crcp_bkmrk_component.super.priority = 20;
  84     (void) mca_base_component_var_register(&mca_crcp_bkmrk_component.super.base_version,
  85                                            "priority",
  86                                            "Priority of the CRCP bkmrk component",
  87                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  88                                            OPAL_INFO_LVL_9,
  89                                            MCA_BASE_VAR_SCOPE_READONLY,
  90                                            &mca_crcp_bkmrk_component.super.priority);
  91 
  92     mca_crcp_bkmrk_component.super.verbose = 0;
  93     (void) mca_base_component_var_register(&mca_crcp_bkmrk_component.super.base_version,
  94                                            "verbose",
  95                                            "Verbose level for the CRCP bkmrk component",
  96                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  97                                            OPAL_INFO_LVL_9,
  98                                            MCA_BASE_VAR_SCOPE_READONLY,
  99                                            &mca_crcp_bkmrk_component.super.verbose);
 100 
 101     timing_enabled = false;
 102     (void) mca_base_component_var_register(&mca_crcp_bkmrk_component.super.base_version,
 103                                            "timing", "Enable Performance timing",
 104                                            MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 105                                            OPAL_INFO_LVL_9,
 106                                            MCA_BASE_VAR_SCOPE_READONLY,
 107                                            &timing_enabled);
 108 
 109     return OMPI_SUCCESS;
 110 }
 111 
 112 static int crcp_bkmrk_open(void)
 113 {
 114     /* If there is a custom verbose level for this component than use it
 115      * otherwise take our parents level and output channel
 116      */
 117     if ( 0 != mca_crcp_bkmrk_component.super.verbose) {
 118         mca_crcp_bkmrk_component.super.output_handle = opal_output_open(NULL);
 119         opal_output_set_verbosity(mca_crcp_bkmrk_component.super.output_handle,
 120                                   mca_crcp_bkmrk_component.super.verbose);
 121     } else {
 122         mca_crcp_bkmrk_component.super.output_handle = ompi_crcp_base_framework.framework_output;
 123     }
 124 
 125     /*
 126      * Debug Output
 127      */
 128     opal_output_verbose(10, mca_crcp_bkmrk_component.super.output_handle,
 129                         "crcp:bkmrk: open()");
 130     opal_output_verbose(20, mca_crcp_bkmrk_component.super.output_handle,
 131                         "crcp:bkmrk: open: priority   = %d",
 132                         mca_crcp_bkmrk_component.super.priority);
 133     opal_output_verbose(20, mca_crcp_bkmrk_component.super.output_handle,
 134                         "crcp:bkmrk: open: verbosity  = %d",
 135                         mca_crcp_bkmrk_component.super.verbose);
 136 
 137     return OMPI_SUCCESS;
 138 }
 139 
 140 static int crcp_bkmrk_close(void)
 141 {
 142     opal_output_verbose(10, mca_crcp_bkmrk_component.super.output_handle,
 143                         "crcp:bkmrk: close()");
 144 
 145     return OMPI_SUCCESS;
 146 }

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