root/oshmem/mca/scoll/basic/scoll_basic_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. basic_register
  2. basic_open
  3. basic_close

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2013      Mellanox Technologies, Inc.
   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 "oshmem_config.h"
  15 
  16 #include "oshmem/constants.h"
  17 #include "oshmem/mca/scoll/scoll.h"
  18 #include "oshmem/mca/scoll/base/base.h"
  19 #include "scoll_basic.h"
  20 
  21 /*
  22  * Public string showing the scoll basic component version number
  23  */
  24 const char *mca_scoll_basic_component_version_string =
  25 "Open SHMEM basic collective MCA component version " OSHMEM_VERSION;
  26 
  27 /*
  28  * Global variable
  29  */
  30 int mca_scoll_basic_priority_param = -1;
  31 int mca_scoll_basic_param_barrier_algorithm = SCOLL_ALG_BARRIER_ADAPTIVE;
  32 int mca_scoll_basic_param_broadcast_algorithm = SCOLL_ALG_BROADCAST_BINOMIAL;
  33 int mca_scoll_basic_param_collect_algorithm =
  34         SCOLL_ALG_COLLECT_RECURSIVE_DOUBLING;
  35 int mca_scoll_basic_param_reduce_algorithm = SCOLL_ALG_REDUCE_RECURSIVE_DOUBLING;
  36 
  37 /*
  38  * Local function
  39  */
  40 static int basic_register(void);
  41 static int basic_open(void);
  42 static int basic_close(void);
  43 
  44 /*
  45  * Instantiate the public struct with all of our public information
  46  * and pointers to our public functions in it
  47  */
  48 
  49 mca_scoll_base_component_t mca_scoll_basic_component = {
  50 
  51     /* First, the mca_component_t struct containing meta information
  52        about the component itself */
  53 
  54     .scoll_version = {
  55         MCA_SCOLL_BASE_VERSION_2_0_0,
  56 
  57         /* Component name and version */
  58         .mca_component_name = "basic",
  59         MCA_BASE_MAKE_VERSION(component, OSHMEM_MAJOR_VERSION, OSHMEM_MINOR_VERSION,
  60                               OSHMEM_RELEASE_VERSION),
  61 
  62         /* Component open and close functions */
  63         .mca_open_component = basic_open,
  64         .mca_close_component = basic_close,
  65         .mca_register_component_params = basic_register,
  66     },
  67     .scoll_data = {
  68         /* The component is checkpoint ready */
  69         MCA_BASE_METADATA_PARAM_CHECKPOINT
  70     },
  71 
  72     /* Initialization / querying functions */
  73 
  74     .scoll_init = mca_scoll_basic_init,
  75     .scoll_query = mca_scoll_basic_query,
  76 };
  77 
  78 static int basic_register(void)
  79 {
  80     char help_msg[200];
  81     mca_base_component_t *comp = &mca_scoll_basic_component.scoll_version;
  82 
  83     mca_scoll_basic_priority_param = 75;
  84     (void) mca_base_component_var_register(comp,
  85                                            "priority",
  86                                            "Priority of the basic scoll:basic component",
  87                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
  88                                            OPAL_INFO_LVL_9,
  89                                            MCA_BASE_VAR_SCOPE_READONLY,
  90                                            &mca_scoll_basic_priority_param);
  91 
  92     sprintf(help_msg,
  93             "Algorithm selection for Barrier (%d - Central Counter, %d - Tournament, %d - Recursive Doubling, %d - Dissemination, %d - Basic, %d - Adaptive)",
  94             SCOLL_ALG_BARRIER_CENTRAL_COUNTER,
  95             SCOLL_ALG_BARRIER_TOURNAMENT,
  96             SCOLL_ALG_BARRIER_RECURSIVE_DOUBLING,
  97             SCOLL_ALG_BARRIER_DISSEMINATION,
  98             SCOLL_ALG_BARRIER_BASIC,
  99             SCOLL_ALG_BARRIER_ADAPTIVE);
 100     (void) mca_base_component_var_register(comp,
 101                                            "barrier_alg",
 102                                            help_msg,
 103                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
 104                                            OPAL_INFO_LVL_9,
 105                                            MCA_BASE_VAR_SCOPE_READONLY,
 106                                            &mca_scoll_basic_param_barrier_algorithm);
 107 
 108     sprintf(help_msg,
 109             "Algorithm selection for Broadcast (%d - Central Counter, %d - Binomial)",
 110             SCOLL_ALG_BROADCAST_CENTRAL_COUNTER,
 111             SCOLL_ALG_BROADCAST_BINOMIAL);
 112     (void) mca_base_component_var_register(comp,
 113                                            "broadcast_alg",
 114                                            help_msg,
 115                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
 116                                            OPAL_INFO_LVL_9,
 117                                            MCA_BASE_VAR_SCOPE_READONLY,
 118                                            &mca_scoll_basic_param_broadcast_algorithm);
 119 
 120     sprintf(help_msg,
 121             "Algorithm selection for Collect (%d - Central Counter, %d - Tournament, %d - Recursive Doubling, %d - Ring)",
 122             SCOLL_ALG_COLLECT_CENTRAL_COUNTER,
 123             SCOLL_ALG_COLLECT_TOURNAMENT,
 124             SCOLL_ALG_COLLECT_RECURSIVE_DOUBLING,
 125             SCOLL_ALG_COLLECT_RING);
 126     (void) mca_base_component_var_register(comp,
 127                                            "collect_alg",
 128                                            help_msg,
 129                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
 130                                            OPAL_INFO_LVL_9,
 131                                            MCA_BASE_VAR_SCOPE_READONLY,
 132                                            &mca_scoll_basic_param_collect_algorithm);
 133 
 134     sprintf(help_msg,
 135             "Algorithm selection for Reduce (%d - Central Counter, %d - Tournament, %d - Recursive Doubling %d - Linear %d - Log)",
 136             SCOLL_ALG_REDUCE_CENTRAL_COUNTER,
 137             SCOLL_ALG_REDUCE_TOURNAMENT,
 138             SCOLL_ALG_REDUCE_RECURSIVE_DOUBLING,
 139             SCOLL_ALG_REDUCE_LEGACY_LINEAR,
 140             SCOLL_ALG_REDUCE_LEGACY_LOG);
 141     (void) mca_base_component_var_register(comp,
 142                                            "reduce_alg",
 143                                            help_msg,
 144                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
 145                                            OPAL_INFO_LVL_9,
 146                                            MCA_BASE_VAR_SCOPE_READONLY,
 147                                            &mca_scoll_basic_param_reduce_algorithm);
 148 
 149     return OSHMEM_SUCCESS;
 150 }
 151 
 152 static int basic_open(void)
 153 {
 154     return OSHMEM_SUCCESS;
 155 }
 156 
 157 static int basic_close(void)
 158 {
 159     return OSHMEM_SUCCESS;
 160 }
 161 
 162 OBJ_CLASS_INSTANCE(mca_scoll_basic_module_t,
 163                    mca_scoll_base_module_t,
 164                    NULL,
 165                    NULL);

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