This source file includes following definitions.
- plm_alps_register
- plm_alps_open
- orte_plm_alps_component_query
- plm_alps_close
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 
  24 
  25 
  26 
  27 
  28 
  29 #include "orte_config.h"
  30 #include "orte/constants.h"
  31 
  32 #include "opal/mca/base/mca_base_var.h"
  33 
  34 #include "orte/runtime/orte_globals.h"
  35 
  36 #include "orte/mca/plm/plm.h"
  37 #include "orte/mca/plm/base/base.h"
  38 #include "orte/mca/plm/base/plm_private.h"
  39 #include "plm_alps.h"
  40 
  41 
  42 
  43 
  44 
  45 const char *mca_plm_alps_component_version_string =
  46   "Open MPI alps plm MCA component version " ORTE_VERSION;
  47 
  48 
  49 
  50 
  51 
  52 static int plm_alps_register(void);
  53 static int plm_alps_open(void);
  54 static int plm_alps_close(void);
  55 static int orte_plm_alps_component_query(mca_base_module_t **module, int *priority);
  56 
  57 
  58 
  59 
  60 
  61 
  62 
  63 orte_plm_alps_component_t mca_plm_alps_component = {
  64 
  65     {
  66         
  67 
  68 
  69         .base_version = {
  70             ORTE_PLM_BASE_VERSION_2_0_0,
  71 
  72             
  73             .mca_component_name = "alps",
  74             MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
  75                                   ORTE_RELEASE_VERSION),
  76 
  77             
  78             .mca_open_component = plm_alps_open,
  79             .mca_close_component = plm_alps_close,
  80             .mca_query_component = orte_plm_alps_component_query,
  81             .mca_register_component_params = plm_alps_register,
  82         },
  83         .base_data = {
  84             
  85             MCA_BASE_METADATA_PARAM_CHECKPOINT
  86         },
  87     }
  88 
  89     
  90 
  91 };
  92 
  93 
  94 static int plm_alps_register(void)
  95 {
  96     mca_base_component_t *comp = &mca_plm_alps_component.super.base_version;
  97 
  98     mca_plm_alps_component.debug = false;
  99     (void) mca_base_component_var_register (comp, "debug", "Enable debugging of alps plm",
 100                                             MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 101                                             OPAL_INFO_LVL_9,
 102                                             MCA_BASE_VAR_SCOPE_READONLY,
 103                                             &mca_plm_alps_component.debug);
 104 
 105     if (mca_plm_alps_component.debug == 0) {
 106         mca_plm_alps_component.debug = orte_debug_flag;
 107     }
 108 
 109     mca_plm_alps_component.priority = 100;
 110     (void) mca_base_component_var_register (comp, "priority", "Default selection priority",
 111                                             MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 112                                             OPAL_INFO_LVL_9,
 113                                             MCA_BASE_VAR_SCOPE_READONLY,
 114                                             &mca_plm_alps_component.priority);
 115 
 116     mca_plm_alps_component.aprun_cmd = "aprun";
 117     (void) mca_base_component_var_register (comp, "aprun", "Command to run instead of aprun",
 118                                             MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
 119                                             OPAL_INFO_LVL_9,
 120                                             MCA_BASE_VAR_SCOPE_READONLY,
 121                                             &mca_plm_alps_component.aprun_cmd);
 122 
 123     mca_plm_alps_component.custom_args = NULL;
 124     (void) mca_base_component_var_register (comp, "args", "Custom arguments to aprun",
 125                                             MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
 126                                             OPAL_INFO_LVL_9,
 127                                             MCA_BASE_VAR_SCOPE_READONLY,
 128                                             &mca_plm_alps_component.custom_args);
 129     return ORTE_SUCCESS;
 130 }
 131 
 132 static int plm_alps_open(void)
 133 {
 134     return ORTE_SUCCESS;
 135 }
 136 
 137 
 138 static int orte_plm_alps_component_query(mca_base_module_t **module, int *priority)
 139 {
 140 #if CRAY_WLM_DETECT
 141     char slurm[]="SLURM";
 142     char *wlm_detected = NULL;
 143 
 144     wlm_detected = wlm_detect_get_active();
 145 
 146     
 147 
 148 
 149 
 150 
 151 
 152     if (NULL == wlm_detected) {
 153         wlm_detected = (char *)wlm_detect_get_default();
 154         OPAL_OUTPUT_VERBOSE((10, orte_plm_base_framework.framework_output,
 155                              "%s plm:alps: wlm_detect_get_active returned NULL, using %s",
 156                              ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), wlm_detected));
 157 
 158     }
 159 
 160     if((NULL != wlm_detected) && !strcmp(slurm, wlm_detected)) {
 161         
 162 
 163         *priority = 0;
 164         *module = NULL;
 165         return ORTE_ERROR;
 166     }
 167 #endif
 168 
 169     *priority = mca_plm_alps_component.priority;
 170     *module = (mca_base_module_t *) &orte_plm_alps_module;
 171     OPAL_OUTPUT_VERBOSE((1, orte_plm_base_framework.framework_output,
 172                         "%s plm:alps: available for selection",
 173                          ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
 174 
 175     return ORTE_SUCCESS;
 176 }
 177 
 178 
 179 static int plm_alps_close(void)
 180 {
 181     return ORTE_SUCCESS;
 182 }