This source file includes following definitions.
- plm_slurm_register
- plm_slurm_open
- orte_plm_slurm_component_query
- plm_slurm_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/util/opal_environ.h"
  33 #include "orte/util/name_fns.h"
  34 #include "orte/util/show_help.h"
  35 #include "orte/runtime/orte_globals.h"
  36 
  37 #include "orte/mca/plm/plm.h"
  38 #include "orte/mca/plm/base/plm_private.h"
  39 #include "plm_slurm.h"
  40 
  41 
  42 
  43 
  44 
  45 const char *mca_plm_slurm_component_version_string =
  46   "Open MPI slurm plm MCA component version " ORTE_VERSION;
  47 
  48 
  49 
  50 
  51 
  52 static int plm_slurm_register(void);
  53 static int plm_slurm_open(void);
  54 static int plm_slurm_close(void);
  55 static int orte_plm_slurm_component_query(mca_base_module_t **module, int *priority);
  56 
  57 
  58 
  59 
  60 
  61 
  62 
  63 orte_plm_slurm_component_t mca_plm_slurm_component = {
  64 
  65     {
  66         
  67 
  68 
  69         .base_version = {
  70             ORTE_PLM_BASE_VERSION_2_0_0,
  71 
  72             
  73             .mca_component_name = "slurm",
  74             MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
  75                                   ORTE_RELEASE_VERSION),
  76 
  77             
  78             .mca_open_component = plm_slurm_open,
  79             .mca_close_component = plm_slurm_close,
  80             .mca_query_component = orte_plm_slurm_component_query,
  81             .mca_register_component_params = plm_slurm_register,
  82         },
  83         .base_data = {
  84             
  85             MCA_BASE_METADATA_PARAM_CHECKPOINT
  86         },
  87     }
  88 
  89     
  90 
  91 };
  92 
  93 
  94 static int plm_slurm_register(void)
  95 {
  96     mca_base_component_t *comp = &mca_plm_slurm_component.super.base_version;
  97 
  98     mca_plm_slurm_component.custom_args = NULL;
  99     (void) mca_base_component_var_register (comp, "args", "Custom arguments to srun",
 100                                             MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
 101                                             OPAL_INFO_LVL_9,
 102                                             MCA_BASE_VAR_SCOPE_READONLY,
 103                                             &mca_plm_slurm_component.custom_args);
 104 
 105     mca_plm_slurm_component.slurm_warning_msg = true;
 106     (void) mca_base_component_var_register (comp, "warning", "Turn off warning message",
 107                                             MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 108                                             OPAL_INFO_LVL_9,
 109                                             MCA_BASE_VAR_SCOPE_READONLY,
 110                                             &mca_plm_slurm_component.slurm_warning_msg);
 111 
 112     return ORTE_SUCCESS;
 113 }
 114 
 115 static int plm_slurm_open(void)
 116 {
 117     return ORTE_SUCCESS;
 118 }
 119 
 120 static int orte_plm_slurm_component_query(mca_base_module_t **module, int *priority)
 121 {
 122     
 123 
 124     if (NULL != getenv("SLURM_JOBID")) {
 125         *priority = 75;
 126 
 127         OPAL_OUTPUT_VERBOSE((1, orte_plm_base_framework.framework_output,
 128                              "%s plm:slurm: available for selection",
 129                              ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
 130 
 131         *module = (mca_base_module_t *)&orte_plm_slurm_module;
 132         return ORTE_SUCCESS;
 133     }
 134 
 135     
 136     *module = NULL;
 137     return ORTE_ERROR;
 138 }
 139 
 140 
 141 static int plm_slurm_close(void)
 142 {
 143     return ORTE_SUCCESS;
 144 }