1 /* 2 * Copyright (c) 2004-2008 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 Los Alamos National Security, LLC. 14 * All rights reserved. 15 * Copyright (c) 2017 Intel, Inc. All rights reserved. 16 * $COPYRIGHT$ 17 * 18 * Additional copyrights may follow 19 * 20 * $HEADER$ 21 */ 22 /** @file: 23 * 24 * The Open RTE Resource MAPping Subsystem (RMAPS) 25 * 26 * The resource mapping subsystem is responsible for mapping processes 27 * to specific nodes/cpus within a given job. In many systems, this 28 * functionality will not be supported - the system will map processes 29 * wherever it chooses and does not allow the user to specify the 30 * mapping. RMAPS components, therefore, provide services for those 31 * systems that do permit such mappings. 32 * 33 * RMAPS checks the MCA parameters to see if a mapping algorithm has 34 * been specified. If the user selected a mapping algorithm, the 35 * indicated RMAPS component will take information from the registry 36 * to determine the number of applications/processes to be run, and 37 * the identified resources that have been allocated to this job. The 38 * selected RMAP component will then assign processes to resources 39 * according to its algorithm, with the results stored on the 40 * appropriate job segment - the assigned nodename for each process is 41 * stored in that respective process' container on the segment. 42 * 43 */ 44 45 #ifndef ORTE_MCA_RMAPS_H 46 #define ORTE_MCA_RMAPS_H 47 48 #include "orte_config.h" 49 #include "orte/types.h" 50 51 #include "orte/mca/mca.h" 52 53 #include "orte/runtime/orte_globals.h" 54 55 #include "orte/mca/rmaps/rmaps_types.h" 56 57 BEGIN_C_DECLS 58 59 /* 60 * rmaps module functions 61 */ 62 63 /** 64 * RMAPS module functions - these are not accessible to the outside world, 65 * but are defined here by convention 66 */ 67 68 /* map a job - used by the HNP to compute the #procs on each node. 69 * This is passed to the backend daemons as a regex which they 70 * use to create an orte_job_map_t for the job */ 71 typedef int (*orte_rmaps_base_module_map_fn_t)(orte_job_t *jdata); 72 73 /* assign a location to each process. Used by the backend daemons, 74 * this function takes the orte_job_map_t created from the regex 75 * and assigns each process to a specific location within the 76 * hardware topology based on the --map-by directive */ 77 typedef int (*orte_rmaps_base_module_assign_loc_fn_t)(orte_job_t *jdata); 78 79 /* 80 * rmaps module version 3.0.0 81 */ 82 struct orte_rmaps_base_module_3_0_0_t { 83 /** Mapping function pointer */ 84 orte_rmaps_base_module_map_fn_t map_job; 85 /* assign locations */ 86 orte_rmaps_base_module_assign_loc_fn_t assign_locations; 87 }; 88 /** Convenience typedef */ 89 typedef struct orte_rmaps_base_module_3_0_0_t orte_rmaps_base_module_3_0_0_t; 90 /** Convenience typedef */ 91 typedef orte_rmaps_base_module_3_0_0_t orte_rmaps_base_module_t; 92 93 94 /* 95 * rmaps component 96 */ 97 98 /** 99 * rmaps component version 3.0.0 100 */ 101 struct orte_rmaps_base_component_3_0_0_t { 102 /** Base MCA structure */ 103 mca_base_component_t base_version; 104 /** Base MCA data */ 105 mca_base_component_data_t base_data; 106 }; 107 /** Convenience typedef */ 108 typedef struct orte_rmaps_base_component_3_0_0_t orte_rmaps_base_component_3_0_0_t; 109 /** Convenience typedef */ 110 typedef orte_rmaps_base_component_3_0_0_t orte_rmaps_base_component_t; 111 112 113 END_C_DECLS 114 115 #endif