root/orte/mca/rmaps/base/base.h

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

INCLUDED FROM


   1 /*
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2005 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2011      Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2011-2013 Los Alamos National Security, LLC.
  14  *                         All rights reserved.
  15  * Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
  16  * $COPYRIGHT$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 /** @file:
  23  * rmaps framework base functionality.
  24  */
  25 
  26 #ifndef ORTE_MCA_RMAPS_BASE_H
  27 #define ORTE_MCA_RMAPS_BASE_H
  28 
  29 /*
  30  * includes
  31  */
  32 #include "orte_config.h"
  33 #include "orte/types.h"
  34 
  35 #include "opal/class/opal_list.h"
  36 #include "opal/util/printf.h"
  37 #include "orte/mca/mca.h"
  38 
  39 #include "orte/runtime/orte_globals.h"
  40 
  41 #include "orte/mca/rmaps/rmaps.h"
  42 
  43 BEGIN_C_DECLS
  44 
  45 /*
  46  * MCA Framework
  47  */
  48 ORTE_DECLSPEC extern mca_base_framework_t orte_rmaps_base_framework;
  49 /* select a component */
  50 ORTE_DECLSPEC    int orte_rmaps_base_select(void);
  51 
  52 /*
  53  * Global functions for MCA overall collective open and close
  54  */
  55 
  56 /**
  57  * Struct to hold data global to the rmaps framework
  58  */
  59 typedef struct {
  60     /* list of selected modules */
  61     opal_list_t selected_modules;
  62     /* default ppr */
  63     char *ppr;
  64     /* cpus per rank */
  65     int cpus_per_rank;
  66     /* display the map after it is computed */
  67     bool display_map;
  68     /* slot list, if provided by user */
  69     char *slot_list;
  70     /* default mapping directives */
  71     orte_mapping_policy_t mapping;
  72     orte_ranking_policy_t ranking;
  73     /* device specification for min distance mapping */
  74     char *device;
  75     /* whether or not child jobs should inherit launch directives */
  76     bool inherit;
  77 } orte_rmaps_base_t;
  78 
  79 /**
  80  * Global instance of rmaps-wide framework data
  81  */
  82 ORTE_DECLSPEC extern orte_rmaps_base_t orte_rmaps_base;
  83 
  84 /**
  85  * Global MCA variables
  86  */
  87 ORTE_DECLSPEC extern bool orte_rmaps_base_pernode;
  88 ORTE_DECLSPEC extern int orte_rmaps_base_n_pernode;
  89 ORTE_DECLSPEC extern int orte_rmaps_base_n_persocket;
  90 
  91 /**
  92  * Select an rmaps component / module
  93  */
  94 typedef struct {
  95     opal_list_item_t super;
  96     int pri;
  97     orte_rmaps_base_module_t *module;
  98     mca_base_component_t *component;
  99 } orte_rmaps_base_selected_module_t;
 100 OBJ_CLASS_DECLARATION(orte_rmaps_base_selected_module_t);
 101 
 102 /*
 103  * Map a job
 104  */
 105 ORTE_DECLSPEC void orte_rmaps_base_map_job(int sd, short args, void *cbdata);
 106 ORTE_DECLSPEC int orte_rmaps_base_assign_locations(orte_job_t *jdata);
 107 
 108 /**
 109  * Utility routines to get/set vpid mapping for the job
 110  */
 111 
 112 ORTE_DECLSPEC int orte_rmaps_base_get_vpid_range(orte_jobid_t jobid,
 113     orte_vpid_t *start, orte_vpid_t *range);
 114 ORTE_DECLSPEC int orte_rmaps_base_set_vpid_range(orte_jobid_t jobid,
 115     orte_vpid_t start, orte_vpid_t range);
 116 
 117 /* pretty-print functions */
 118 ORTE_DECLSPEC char* orte_rmaps_base_print_mapping(orte_mapping_policy_t mapping);
 119 ORTE_DECLSPEC char* orte_rmaps_base_print_ranking(orte_ranking_policy_t ranking);
 120 
 121 ORTE_DECLSPEC int orte_rmaps_base_prep_topology(hwloc_topology_t topo);
 122 
 123 ORTE_DECLSPEC int orte_rmaps_base_filter_nodes(orte_app_context_t *app,
 124                                                opal_list_t *nodes,
 125                                                bool remove);
 126 
 127 ORTE_DECLSPEC int orte_rmaps_base_set_mapping_policy(orte_job_t *jdata,
 128                                                      orte_mapping_policy_t *policy,
 129                                                      char **device, char *spec);
 130 ORTE_DECLSPEC int orte_rmaps_base_set_ranking_policy(orte_ranking_policy_t *policy,
 131                                                      orte_mapping_policy_t mapping,
 132                                                      char *spec);
 133 
 134 ORTE_DECLSPEC void orte_rmaps_base_display_map(orte_job_t *jdata);
 135 
 136 END_C_DECLS
 137 
 138 #endif

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