root/orte/mca/schizo/slurm/schizo_slurm_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. component_query

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
   4  * $COPYRIGHT$
   5  *
   6  * Additional copyrights may follow
   7  *
   8  * $HEADER$
   9  */
  10 
  11 #include "orte_config.h"
  12 #include "orte/types.h"
  13 #include "opal/types.h"
  14 
  15 #include "opal/util/show_help.h"
  16 
  17 #include "orte/mca/schizo/schizo.h"
  18 #include "schizo_slurm.h"
  19 
  20 static int component_query(mca_base_module_t **module, int *priority);
  21 
  22 /*
  23  * Struct of function pointers and all that to let us be initialized
  24  */
  25 orte_schizo_base_component_t mca_schizo_slurm_component = {
  26     .base_version = {
  27         MCA_SCHIZO_BASE_VERSION_1_0_0,
  28         .mca_component_name = "slurm",
  29         MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
  30                               ORTE_RELEASE_VERSION),
  31         .mca_query_component = component_query,
  32     },
  33     .base_data = {
  34         /* The component is checkpoint ready */
  35         MCA_BASE_METADATA_PARAM_CHECKPOINT
  36     },
  37 };
  38 
  39 static int component_query(mca_base_module_t **module, int *priority)
  40 {
  41     /* disqualify ourselves if we are not under slurm */
  42     if (NULL == getenv("SLURM_JOBID")) {
  43         *priority = 0;
  44         *module = NULL;
  45         return OPAL_ERROR;
  46     }
  47 
  48     *module = (mca_base_module_t*)&orte_schizo_slurm_module;
  49     *priority = 50;
  50     return ORTE_SUCCESS;
  51 }

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