Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore NUMA tracking #46

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/hwloc/hwloc-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,21 @@ typedef struct {
size_t mbs_len;
} prte_hwloc_base_memory_segment_t;


/**
* Struct used to cache topology-level data used
* for repeated lookup - the struct is attached
* to the userdata of the root object of the
* topology
*/
typedef struct {
pmix_object_t super;
bool computed;
unsigned numa_cutoff;
} prte_hwloc_topo_data_t;
PRTE_EXPORT PMIX_CLASS_DECLARATION(prte_hwloc_topo_data_t);


/* define binding policies */
typedef uint16_t prte_binding_policy_t;
#define PRTE_BINDING_POLICY PRTE_UINT16
Expand Down Expand Up @@ -226,20 +241,28 @@ PRTE_EXPORT extern prte_hwloc_base_mbfa_t prte_hwloc_base_mbfa;
* hwloc_topology_load()).
*/
PRTE_EXPORT int prte_hwloc_base_get_topology(void);
PRTE_EXPORT hwloc_cpuset_t prte_hwloc_base_setup_summary(hwloc_topology_t topo);

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

PRTE_EXPORT void prte_hwloc_base_setup_summary(hwloc_topology_t topo);

PRTE_EXPORT hwloc_cpuset_t prte_hwloc_base_generate_cpuset(hwloc_topology_t topo,
bool use_hwthread_cpus, char *cpulist);

PRTE_EXPORT hwloc_cpuset_t prte_hwloc_base_filter_cpus(hwloc_topology_t topo);

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

PRTE_EXPORT unsigned int prte_hwloc_base_get_nbobjs_by_type(hwloc_topology_t topo,
hwloc_obj_type_t target);

PRTE_EXPORT hwloc_obj_t prte_hwloc_base_get_obj_by_type(hwloc_topology_t topo,
hwloc_obj_type_t target,
unsigned int instance);

/**
* Get the number of pu's under a given hwloc object.
*/
Expand Down
10 changes: 10 additions & 0 deletions src/hwloc/hwloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,13 @@ int prte_hwloc_base_set_binding_policy(void *jdat, char *spec)
}
return PRTE_SUCCESS;
}

static void topo_data_const(prte_hwloc_topo_data_t *ptr)
{
ptr->computed = false;
ptr->numa_cutoff = UINT_MAX;
}
PMIX_CLASS_INSTANCE(prte_hwloc_topo_data_t,
pmix_object_t,
topo_data_const, NULL);

Loading
Loading