Skip to content

Commit c81a768

Browse files
committed
checkpoint
1 parent a84a6e6 commit c81a768

File tree

6 files changed

+25
-31
lines changed

6 files changed

+25
-31
lines changed

opal/mca/hwloc/base/base.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ OPAL_DECLSPEC opal_hwloc_locality_t opal_hwloc_compute_relative_locality(char *l
290290

291291
OPAL_DECLSPEC int opal_hwloc_base_topology_export_xmlbuffer(hwloc_topology_t topology, char **xmlpath, int *buflen);
292292

293+
OPAL_DECLSPEC int opal_hwloc_base_topology_set_flags (hwloc_topology_t topology, unsigned long flags, bool io);
293294
END_C_DECLS
294295

295296
#endif /* OPAL_HWLOC_BASE_H */

opal/mca/hwloc/base/hwloc_base_dt.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,7 @@ int opal_hwloc_unpack(opal_buffer_t *buffer, void *dest,
106106
/* since we are loading this from an external source, we have to
107107
* explicitly set a flag so hwloc sets things up correctly
108108
*/
109-
if (0 != hwloc_topology_set_flags(t, (HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM
110-
#if HWLOC_API_VERSION < 0x20000
111-
| HWLOC_TOPOLOGY_FLAG_IO_DEVICES
112-
#endif
113-
))) {
109+
if (0 != opal_hwloc_base_topology_set_flags(t, HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM, true)) {
114110
rc = OPAL_ERROR;
115111
hwloc_topology_destroy(t);
116112
goto cleanup;

opal/mca/hwloc/base/hwloc_base_util.c

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,9 @@ int opal_hwloc_base_get_topology(void)
187187
/* since we are loading this from an external source, we have to
188188
* explicitly set a flag so hwloc sets things up correctly
189189
*/
190-
if (0 != hwloc_topology_set_flags(opal_hwloc_topology,
191-
(HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM
192-
#if HWLOC_API_VERSION < 0x20000
193-
| HWLOC_TOPOLOGY_FLAG_IO_DEVICES
194-
#endif
195-
))) {
190+
if (0 != opal_hwloc_base_topology_set_flags(opal_hwloc_topology,
191+
HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM,
192+
true)) {
196193
hwloc_topology_destroy(opal_hwloc_topology);
197194
free(val);
198195
return OPAL_ERROR;
@@ -206,10 +203,7 @@ int opal_hwloc_base_get_topology(void)
206203
free(val);
207204
} else if (NULL == opal_hwloc_base_topo_file) {
208205
if (0 != hwloc_topology_init(&opal_hwloc_topology) ||
209-
#if HWLOC_API_VERSION < 0x20000
210-
0 != hwloc_topology_set_flags(opal_hwloc_topology,
211-
HWLOC_TOPOLOGY_FLAG_IO_DEVICES) ||
212-
#endif
206+
0 != opal_hwloc_base_topology_set_flags(opal_hwloc_topology, 0, true) ||
213207
0 != hwloc_topology_load(opal_hwloc_topology)) {
214208
return OPAL_ERR_NOT_SUPPORTED;
215209
}
@@ -253,12 +247,9 @@ int opal_hwloc_base_set_topology(char *topofile)
253247
/* since we are loading this from an external source, we have to
254248
* explicitly set a flag so hwloc sets things up correctly
255249
*/
256-
if (0 != hwloc_topology_set_flags(opal_hwloc_topology,
257-
(HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM
258-
#if HWLOC_API_VERSION < 0x20000
259-
| HWLOC_TOPOLOGY_FLAG_IO_DEVICES
260-
#endif
261-
))) {
250+
if (0 != opal_hwloc_base_topology_set_flags(opal_hwloc_topology,
251+
HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM,
252+
true)) {
262253
hwloc_topology_destroy(opal_hwloc_topology);
263254
return OPAL_ERR_NOT_SUPPORTED;
264255
}
@@ -2346,3 +2337,14 @@ int opal_hwloc_base_topology_export_xmlbuffer(hwloc_topology_t topology, char **
23462337
#endif
23472338
}
23482339

2340+
int opal_hwloc_base_topology_set_flags (hwloc_topology_t topology, unsigned long flags, bool io) {
2341+
if (io) {
2342+
#if HWLOC_API_VERSION < 0x20000
2343+
flags |= HWLOC_TOPOLOGY_FLAG_IO_DEVICES;
2344+
#else
2345+
int ret = hwloc_topology_set_io_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_IMPORTANT);
2346+
if (0 != ret) return ret;
2347+
#endif
2348+
}
2349+
return hwloc_topology_set_flags(topology, flags);
2350+
}

orte/mca/ess/singleton/ess_singleton_module.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,8 @@ static int rte_init(void)
288288
/* since we are loading this from an external source, we have to
289289
* explicitly set a flag so hwloc sets things up correctly
290290
*/
291-
if (0 != hwloc_topology_set_flags(opal_hwloc_topology,
292-
(HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM
293-
#if HWLOC_API_VERSION < 0x20000
294-
| HWLOC_TOPOLOGY_FLAG_IO_DEVICES
295-
#endif
296-
))) {
291+
if (0 != opal_hwloc_base_topology_set_flags(opal_hwloc_topology,
292+
HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM, true)) {
297293
ret = OPAL_ERROR;
298294
hwloc_topology_destroy(opal_hwloc_topology);
299295
free(val);

orte/mca/ras/simulator/ras_sim_module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes)
135135
/* since we are loading this from an external source, we have to
136136
* explicitly set a flag so hwloc sets things up correctly
137137
*/
138-
if (0 != hwloc_topology_set_flags(topo, HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM)) {
138+
if (0 != opal_hwloc_base_topology_set_flags(topo, HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM, false)) {
139139
orte_show_help("help-ras-simulator.txt",
140140
"hwloc API fail", true,
141141
__FILE__, __LINE__, "hwloc_topology_set_flags");

orte/test/system/opal_hwloc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ int main(int argc, char* argv[])
7272
/* since we are loading this from an external source, we have to
7373
* explicitly set a flag so hwloc sets things up correctly
7474
*/
75-
if (0 != hwloc_topology_set_flags(my_topology,
76-
(HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM |
77-
HWLOC_TOPOLOGY_FLAG_IO_DEVICES))) {
75+
if (0 != opal_hwloc_base_topology_set_flags(my_topology,
76+
HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM)) {
7877
hwloc_topology_destroy(my_topology);
7978
return OPAL_ERR_NOT_SUPPORTED;
8079
}

0 commit comments

Comments
 (0)