root/opal/mca/btl/template/btl_template_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. mca_btl_template_component_open
  2. mca_btl_template_component_register
  3. mca_btl_template_component_close
  4. mca_btl_template_component_init
  5. mca_btl_template_component_progress

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2005 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2005 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2014      Los Alamos National Security, LLC. All rights
  14  *                         reserved.
  15  * $COPYRIGHT$
  16  *
  17  * Additional copyrights may follow
  18  *
  19  * $HEADER$
  20  */
  21 
  22 
  23 #include "opal_config.h"
  24 #include "opal/constants.h"
  25 #include "opal/mca/event/event.h"
  26 #include "opal/mca/btl/btl.h"
  27 #include "opal/mca/mpool/base/base.h"
  28 #include "opal/mca/btl/base/base.h"
  29 
  30 #include "btl_template.h"
  31 #include "btl_template_frag.h"
  32 #include "btl_template_endpoint.h"
  33 
  34 /**
  35  * Register any MCA parameters associated with this component
  36  */
  37 static int mca_btl_template_component_register(void);
  38 
  39 /**
  40  * Make initial determination whether this component can run or not
  41  */
  42 static int mca_btl_template_component_open(void);
  43 
  44 /**
  45  * Any final cleanup before being unloaded.
  46  */
  47 static int mca_btl_template_component_close(void);
  48 
  49 
  50 mca_btl_template_component_t mca_btl_template_component = {
  51     .super = {
  52         /* First, the mca_base_component_t struct containing meta information
  53            about the component itself */
  54 
  55         .btl_version = {
  56             MCA_BTL_DEFAULT_VERSION("template"),
  57             .mca_open_component = mca_btl_template_component_open,
  58             .mca_close_component = mca_btl_template_component_close,
  59             .mca_register_component_params = mca_btl_template_component_register,
  60         },
  61         .btl_data = {
  62             /* The component is not checkpoint ready */
  63             .param_field = MCA_BASE_METADATA_PARAM_NONE
  64         },
  65 
  66         .btl_init = mca_btl_template_component_init,
  67         .btl_progress = mca_btl_template_component_progress,
  68     }
  69 };
  70 
  71 static int mca_btl_template_component_open(void)
  72 {
  73     return OPAL_SUCCESS;
  74 }
  75 
  76 static int mca_btl_template_component_register(void)
  77 {
  78     /* initialize state */
  79     mca_btl_template_component.template_num_btls=0;
  80     mca_btl_template_component.template_btls=NULL;
  81 
  82     /* initialize objects */
  83     OBJ_CONSTRUCT(&mca_btl_template_component.template_procs, opal_list_t);
  84 
  85     /* register TEMPLATE component parameters */
  86     mca_btl_template_component.template_free_list_num = 8;
  87     (void) mca_base_component_var_register(&mca_btl_template_component.super.btl_version,
  88                                            "free_list_num", NULL, MCA_BASE_VAR_TYPE_INT,
  89                                            NULL, 0, 0, OPAL_INFO_LVL_9,
  90                                            MCA_BASE_VAR_SCOPE_READONLY,
  91                                            &mca_btl_template_component.template_free_list_num);
  92     (void) mca_base_component_var_register(&mca_btl_template_component.super.btl_version,
  93                                            "free_list_max", NULL, MCA_BASE_VAR_TYPE_INT,
  94                                            NULL, 0, 0, OPAL_INFO_LVL_9,
  95                                            MCA_BASE_VAR_SCOPE_READONLY,
  96                                            &mca_btl_template_component.template_free_list_max);
  97     (void) mca_base_component_var_register(&mca_btl_template_component.super.btl_version,
  98                                            "free_list_inc", NULL, MCA_BASE_VAR_TYPE_INT,
  99                                            NULL, 0, 0, OPAL_INFO_LVL_9,
 100                                            MCA_BASE_VAR_SCOPE_READONLY,
 101                                            &mca_btl_template_component.template_free_list_inc);
 102 
 103     mca_btl_template_component.template_mpool_name = "grdma";
 104     (void) mca_base_component_var_register(&mca_btl_template_component.super.btl_version,
 105                                            "mpool", NULL, MCA_BASE_VAR_TYPE_STRING,
 106                                            NULL, 0, 0, OPAL_INFO_LVL_9,
 107                                            MCA_BASE_VAR_SCOPE_READONLY,
 108                                            &mca_btl_template_component.template_mpool_name);
 109 
 110     mca_btl_template_module.super.btl_exclusivity = 0;
 111     mca_btl_template_module.super.btl_eager_limit = 64*1024;
 112     mca_btl_template_module.super.btl_rndv_eager_limit = 64*1024;
 113     mca_btl_template_module.super.btl_max_send_size = 128*1024;
 114     mca_btl_template_module.super.btl_min_rdma_pipeline_size = 1024*1024;
 115     mca_btl_template_module.super.btl_rdma_pipeline_frag_size = 1024*1024;
 116     mca_btl_template_module.super.btl_rdma_pipeline_send_length = 1024*1024;
 117     mca_btl_template_module.super.btl_flags  = MCA_BTL_FLAGS_PUT;
 118 
 119     return mca_btl_base_param_register(&mca_btl_template_component.super.btl_version,
 120                                        &mca_btl_template_module.super);
 121 }
 122 
 123 /*
 124  * component cleanup - sanity checking of queue lengths
 125  */
 126 
 127 static int mca_btl_template_component_close(void)
 128 {
 129     return OPAL_SUCCESS;
 130 }
 131 
 132 /*
 133  *  TEMPLATE component initialization:
 134  *  (1) read interface list from kernel and compare against component parameters
 135  *      then create a BTL instance for selected interfaces
 136  *  (2) setup TEMPLATE listen socket for incoming connection attempts
 137  *  (3) register BTL parameters with the MCA
 138  */
 139 
 140 mca_btl_base_module_t** mca_btl_template_component_init(int *num_btl_modules,
 141                                                   bool enable_progress_threads,
 142                                                   bool enable_mpi_threads)
 143 {
 144     return NULL;
 145 }
 146 
 147 /*
 148  *  TEMPLATE component progress.
 149  */
 150 
 151 
 152 int mca_btl_template_component_progress()
 153 {
 154     return 0;
 155 }
 156 

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