root/oshmem/mca/atomic/mxm/atomic_mxm_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. _mxm_register
  2. _mxm_open

   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/atomic/atomic.h"
  18 #include "oshmem/mca/atomic/base/base.h"
  19 #include "oshmem/mca/spml/base/base.h"
  20 
  21 #include "atomic_mxm.h"
  22 
  23 
  24 /*
  25  * Public string showing the scoll mxm component version number
  26  */
  27 const char *mca_atomic_mxm_component_version_string =
  28 "Open SHMEM mxm atomic MCA component version " OSHMEM_VERSION;
  29 
  30 /*
  31  * Global variable
  32  */
  33 mca_spml_ikrit_t *mca_atomic_mxm_spml_self = NULL;
  34 
  35 /*
  36  * Local function
  37  */
  38 static int _mxm_register(void);
  39 static int _mxm_open(void);
  40 
  41 /*
  42  * Instantiate the public struct with all of our public information
  43  * and pointers to our public functions in it
  44  */
  45 
  46 mca_atomic_base_component_t mca_atomic_mxm_component = {
  47 
  48     /* First, the mca_component_t struct containing meta information
  49        about the component itself */
  50 
  51     .atomic_version = {
  52         MCA_ATOMIC_BASE_VERSION_2_0_0,
  53 
  54         /* Component name and version */
  55         .mca_component_name = "mxm",
  56         MCA_BASE_MAKE_VERSION(component, OSHMEM_MAJOR_VERSION, OSHMEM_MINOR_VERSION,
  57                               OSHMEM_RELEASE_VERSION),
  58 
  59         .mca_open_component = _mxm_open,
  60         .mca_register_component_params = _mxm_register,
  61     },
  62     .atomic_data = {
  63         /* The component is checkpoint ready */
  64         MCA_BASE_METADATA_PARAM_CHECKPOINT
  65     },
  66 
  67     /* Initialization / querying functions */
  68 
  69     .atomic_startup = mca_atomic_mxm_startup,
  70     .atomic_finalize  = mca_atomic_mxm_finalize,
  71     .atomic_query = mca_atomic_mxm_query,
  72 };
  73 
  74 static int _mxm_register(void)
  75 {
  76     mca_atomic_mxm_component.priority = 100;
  77     mca_base_component_var_register (&mca_atomic_mxm_component.atomic_version,
  78                                      "priority", "Priority of the atomic:mxm "
  79                                      "component (default: 100)", MCA_BASE_VAR_TYPE_INT,
  80                                      NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
  81                                      OPAL_INFO_LVL_3,
  82                                      MCA_BASE_VAR_SCOPE_ALL_EQ,
  83                                      &mca_atomic_mxm_component.priority);
  84 
  85     return OSHMEM_SUCCESS;
  86 }
  87 
  88 static int _mxm_open(void)
  89 {
  90     /*
  91      * This component is able to work using spml:ikrit component only
  92      * (this check is added instead of !mca_spml_ikrit.enabled)
  93      */
  94     if (strcmp(mca_spml_base_selected_component.spmlm_version.mca_component_name, "ikrit")) {
  95         ATOMIC_VERBOSE(5,
  96                        "Can not use atomic/mxm because spml ikrit component disabled");
  97         return OSHMEM_ERR_NOT_AVAILABLE;
  98     }
  99     mca_atomic_mxm_spml_self = (mca_spml_ikrit_t *) mca_spml.self;
 100 
 101     return OSHMEM_SUCCESS;
 102 }
 103 
 104 OBJ_CLASS_INSTANCE(mca_atomic_mxm_module_t,
 105                    mca_atomic_base_module_t,
 106                    NULL,
 107                    NULL);

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