OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

rmaps_types.h
Go to the documentation of this file.
1 /* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
2 * University Research and Technology
3 * Corporation. All rights reserved.
4 * Copyright (c) 2004-2008 The University of Tennessee and The University
5 * of Tennessee Research Foundation. All rights
6 * reserved.
7 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
8 * University of Stuttgart. All rights reserved.
9 * Copyright (c) 2004-2005 The Regents of the University of California.
10 * All rights reserved.
11 * Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
12 * $COPYRIGHT$
13 *
14 * Additional copyrights may follow
15 *
16 * $HEADER$
17 */
18 /** @file:
19 */
20
21 #ifndef ORTE_MCA_RMAPS_TYPES_H
22 #define ORTE_MCA_RMAPS_TYPES_H
23
24 #include "orte_config.h"
25 #include "orte/constants.h"
26
27 #include "opal/class/opal_pointer_array.h"
28 #include "opal/mca/hwloc/hwloc.h"
29
30 #include "orte/runtime/orte_globals.h"
31
32 /*
33 * General MAP types - instanced in runtime/orte_globals_class_instances.h
34 */
35
36 BEGIN_C_DECLS
37
38 typedef uint16_t orte_mapping_policy_t;
39 #define ORTE_MAPPING_POLICY OPAL_UINT16
40 typedef uint16_t orte_ranking_policy_t;
41 #define ORTE_RANKING_POLICY OPAL_UINT16
42
43 /*
44 * Structure that represents the mapping of a job to an
45 * allocated set of resources.
46 */
47 struct orte_job_map_t {
48 opal_object_t super;
49 /* user-specified mapping params */
50 char *req_mapper; /* requested mapper */
51 char *last_mapper; /* last mapper used */
52 orte_mapping_policy_t mapping;
53 orte_ranking_policy_t ranking;
54 #if OPAL_HAVE_HWLOC
55 opal_binding_policy_t binding;
56 opal_hwloc_level_t bind_level;
57 #endif
58 /* mapping options */
59 char *ppr;
60 int16_t cpus_per_rank;
61 bool display_map;
62 /* *** */
63 /* number of new daemons required to be launched
64 * to support this job map
65 */
66 orte_std_cntr_t num_new_daemons;
67 /* starting vpid of the new daemons - they will
68 * be sequential from that point
69 */
70 orte_vpid_t daemon_vpid_start;
71 /* number of nodes participating in this job */
72 orte_std_cntr_t num_nodes;
73 /* array of pointers to nodes in this map for this job */
74 opal_pointer_array_t *nodes;
75 };
76 typedef struct orte_job_map_t orte_job_map_t;
77 ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_job_map_t);
78
79 /**
80 * Macro for use in components that are of type rmaps
81 */
82 #define ORTE_RMAPS_BASE_VERSION_2_0_0 \
83 MCA_BASE_VERSION_2_0_0, \
84 "rmaps", 2, 0, 0
85
86 /* define map-related directives */
87 #define ORTE_MAPPING_NO_USE_LOCAL 0x0100
88 #define ORTE_MAPPING_NO_OVERSUBSCRIBE 0x0200
89 #define ORTE_MAPPING_SUBSCRIBE_GIVEN 0x0400
90 #define ORTE_MAPPING_SPAN 0x0800
91 #define ORTE_MAPPING_PPR 0x1000
92 /* an error flag */
93 #define ORTE_MAPPING_CONFLICTED 0x2000
94 #define ORTE_MAPPING_GIVEN 0x4000
95 #define ORTE_SET_MAPPING_DIRECTIVE(target, pol) \
96 (target) |= (pol)
97 #define ORTE_UNSET_MAPPING_DIRECTIVE(target, pol) \
98 (target) &= ~(pol)
99 #define ORTE_GET_MAPPING_DIRECTIVE(pol) \
100 ((pol) & 0xff00)
101
102 /* round-robin policies */
103 #define ORTE_MAPPING_BYSLOT 1
104 #define ORTE_MAPPING_BYNODE 2
105 #define ORTE_MAPPING_BYBOARD 3
106 #define ORTE_MAPPING_BYNUMA 4
107 #define ORTE_MAPPING_BYSOCKET 5
108 #define ORTE_MAPPING_BYL3CACHE 6
109 #define ORTE_MAPPING_BYL2CACHE 7
110 #define ORTE_MAPPING_BYL1CACHE 8
111 #define ORTE_MAPPING_BYCORE 9
112 #define ORTE_MAPPING_BYHWTHREAD 10
113 /* convenience - declare anything <= 15 to be round-robin*/
114 #define ORTE_MAPPING_RR 0x000f
115 /* sequential policy */
116 #define ORTE_MAPPING_SEQ 20
117 /* rank file and other user-defined mapping */
118 #define ORTE_MAPPING_BYUSER 22
119 /* macro to separate out the mapping policy
120 * from the directives
121 */
122 #define ORTE_GET_MAPPING_POLICY(pol) \
123 ((pol) & 0x00ff)
124 /* macro to determine if mapping policy is set */
125 #define ORTE_MAPPING_POLICY_IS_SET(pol) \
126 ((pol) & 0x00ff)
127 #define ORTE_SET_MAPPING_POLICY(target, pol) \
128 (target) = (pol) | ((target) & 0xff00)
129
130 /* define ranking directives */
131 #define ORTE_RANKING_SPAN 0x1000
132 #define ORTE_RANKING_FILL 0x2000
133 #define ORTE_RANKING_GIVEN 0x4000
134 #define ORTE_SET_RANKING_DIRECTIVE(target, pol) \
135 (target) |= (pol)
136 #define ORTE_UNSET_RANKING_DIRECTIVE(target, pol) \
137 (target) &= ~(pol)
138 #define ORTE_GET_RANKING_DIRECTIVE(pol) \
139 ((pol) & 0xf000)
140
141 /* define ranking policies */
142 #define ORTE_RANK_BY_NODE 1
143 #define ORTE_RANK_BY_BOARD 2
144 #define ORTE_RANK_BY_NUMA 3
145 #define ORTE_RANK_BY_SOCKET 4
146 #define ORTE_RANK_BY_L3CACHE 5
147 #define ORTE_RANK_BY_L2CACHE 6
148 #define ORTE_RANK_BY_L1CACHE 7
149 #define ORTE_RANK_BY_CORE 8
150 #define ORTE_RANK_BY_HWTHREAD 9
151 #define ORTE_RANK_BY_SLOT 10
152 #define ORTE_GET_RANKING_POLICY(pol) \
153 ((pol) & 0x0fff)
154 /* macro to determine if ranking policy is set */
155 #define ORTE_RANKING_POLICY_IS_SET(pol) \
156 ((pol) & 0x0fff)
157 #define ORTE_SET_RANKING_POLICY(target, pol) \
158 (target) = (pol) | ((target) & 0xf000)
159
160 END_C_DECLS
161
162 #endif
opal_pointer_array_t
dynamic pointer array
Definition: opal_pointer_array.h:45
orte_std_cntr_t
int32_t orte_std_cntr_t
Supported datatypes for messaging and storage operations.
Definition: types.h:34
opal_pointer_array.h
See opal_bitmap.h for an explanation of why there is a split between OPAL and ORTE for this generic c...
opal_object_t
Base object.
Definition: opal_object.h:182
orte_job_map_t
Definition: rmaps_types.h:47
orte_globals.h
Global params for OpenRTE.
OBJ_CLASS_DECLARATION
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236