Skip to content

Commit 7de93e9

Browse files
committed
Restore NUMA tracking
See long explanation on openpmix#2025 Signed-off-by: Ralph Castain <[email protected]>
1 parent cd8b2f7 commit 7de93e9

File tree

13 files changed

+254
-66
lines changed

13 files changed

+254
-66
lines changed

src/hwloc/hwloc-internal.h

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ typedef struct {
9797
size_t mbs_len;
9898
} prte_hwloc_base_memory_segment_t;
9999

100+
101+
/**
102+
* Struct used to cache topology-level data used
103+
* for repeated lookup - the struct is attached
104+
* to the userdata of the root object of the
105+
* topology
106+
*/
107+
typedef struct {
108+
pmix_object_t super;
109+
bool computed;
110+
unsigned numa_cutoff;
111+
} prte_hwloc_topo_data_t;
112+
PRTE_EXPORT PMIX_CLASS_DECLARATION(prte_hwloc_topo_data_t);
113+
114+
100115
/* define binding policies */
101116
typedef uint16_t prte_binding_policy_t;
102117
#define PRTE_BINDING_POLICY PRTE_UINT16
@@ -226,20 +241,28 @@ PRTE_EXPORT extern prte_hwloc_base_mbfa_t prte_hwloc_base_mbfa;
226241
* hwloc_topology_load()).
227242
*/
228243
PRTE_EXPORT int prte_hwloc_base_get_topology(void);
229-
PRTE_EXPORT hwloc_cpuset_t prte_hwloc_base_setup_summary(hwloc_topology_t topo);
230244

231245
/**
232246
* Set the hwloc topology to that from the given topo file
233247
*/
234248
PRTE_EXPORT int prte_hwloc_base_set_topology(char *topofile);
235249

250+
PRTE_EXPORT void prte_hwloc_base_setup_summary(hwloc_topology_t topo);
251+
236252
PRTE_EXPORT hwloc_cpuset_t prte_hwloc_base_generate_cpuset(hwloc_topology_t topo,
237253
bool use_hwthread_cpus, char *cpulist);
238254

239255
PRTE_EXPORT hwloc_cpuset_t prte_hwloc_base_filter_cpus(hwloc_topology_t topo);
240256

241257
PRTE_EXPORT unsigned int prte_hwloc_base_get_obj_idx(hwloc_topology_t topo, hwloc_obj_t obj);
242258

259+
PRTE_EXPORT unsigned int prte_hwloc_base_get_nbobjs_by_type(hwloc_topology_t topo,
260+
hwloc_obj_type_t target);
261+
262+
PRTE_EXPORT hwloc_obj_t prte_hwloc_base_get_obj_by_type(hwloc_topology_t topo,
263+
hwloc_obj_type_t target,
264+
unsigned int instance);
265+
243266
/**
244267
* Get the number of pu's under a given hwloc object.
245268
*/

src/hwloc/hwloc.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,3 +673,13 @@ int prte_hwloc_base_set_binding_policy(void *jdat, char *spec)
673673
}
674674
return PRTE_SUCCESS;
675675
}
676+
677+
static void topo_data_const(prte_hwloc_topo_data_t *ptr)
678+
{
679+
ptr->computed = false;
680+
ptr->numa_cutoff = UINT_MAX;
681+
}
682+
PMIX_CLASS_INSTANCE(prte_hwloc_topo_data_t,
683+
pmix_object_t,
684+
topo_data_const, NULL);
685+

0 commit comments

Comments
 (0)