root/orte/mca/grpcomm/direct/grpcomm_direct_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. direct_register
  2. direct_open
  3. direct_close
  4. direct_query

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2011      Cisco Systems, Inc.  All rights reserved.
   4  * Copyright (c) 2011-2016 Los Alamos National Security, LLC. All rights
   5  *                         reserved.
   6  * Copyright (c) 2014      Intel, Inc. All rights reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 #include "orte_config.h"
  15 #include "orte/constants.h"
  16 
  17 #include "orte/mca/mca.h"
  18 #include "opal/runtime/opal_params.h"
  19 
  20 #include "orte/util/proc_info.h"
  21 
  22 #include "grpcomm_direct.h"
  23 
  24 static int my_priority=5;  /* must be below "bad" module */
  25 static int direct_open(void);
  26 static int direct_close(void);
  27 static int direct_query(mca_base_module_t **module, int *priority);
  28 static int direct_register(void);
  29 
  30 /*
  31  * Struct of function pointers that need to be initialized
  32  */
  33 orte_grpcomm_base_component_t mca_grpcomm_direct_component = {
  34     .base_version = {
  35         ORTE_GRPCOMM_BASE_VERSION_3_0_0,
  36 
  37         .mca_component_name = "direct",
  38         MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
  39                               ORTE_RELEASE_VERSION),
  40         .mca_open_component = direct_open,
  41         .mca_close_component = direct_close,
  42         .mca_query_component = direct_query,
  43         .mca_register_component_params = direct_register,
  44     },
  45     .base_data = {
  46         /* The component is checkpoint ready */
  47         MCA_BASE_METADATA_PARAM_CHECKPOINT
  48     },
  49 };
  50 
  51 static int direct_register(void)
  52 {
  53     mca_base_component_t *c = &mca_grpcomm_direct_component.base_version;
  54 
  55     /* make the priority adjustable so users can select
  56      * direct for use by apps without affecting daemons
  57      */
  58     my_priority = 85;
  59     (void) mca_base_component_var_register(c, "priority",
  60                                            "Priority of the grpcomm direct component",
  61                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  62                                            OPAL_INFO_LVL_9,
  63                                            MCA_BASE_VAR_SCOPE_READONLY,
  64                                            &my_priority);
  65     return ORTE_SUCCESS;
  66 }
  67 
  68 /* Open the component */
  69 static int direct_open(void)
  70 {
  71     return ORTE_SUCCESS;
  72 }
  73 
  74 static int direct_close(void)
  75 {
  76     return ORTE_SUCCESS;
  77 }
  78 
  79 static int direct_query(mca_base_module_t **module, int *priority)
  80 {
  81     /* we are always available */
  82     *priority = my_priority;
  83     *module = (mca_base_module_t *)&orte_grpcomm_direct_module;
  84     return ORTE_SUCCESS;
  85 }

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