Hardware Locality (hwloc)  v2.8-20240516.1852.gitc5dfa82e
memattrs.h
1 /*
2  * Copyright © 2019-2023 Inria. All rights reserved.
3  * See COPYING in top-level directory.
4  */
5 
10 #ifndef HWLOC_MEMATTR_H
11 #define HWLOC_MEMATTR_H
12 
13 #include "hwloc.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #elif 0
18 }
19 #endif
20 
80 
95 
110 
121 
132 
147 
158 
169 
170  /* TODO persistence? */
171 
172  HWLOC_MEMATTR_ID_MAX
173 };
174 
178 typedef unsigned hwloc_memattr_id_t;
179 
185 HWLOC_DECLSPEC int
187  const char *name,
188  hwloc_memattr_id_t *id);
189 
190 
197 };
198 
209  } location;
210 };
211 
212 
221 
228 
234 };
235 
267 HWLOC_DECLSPEC int
269  struct hwloc_location *location,
270  unsigned *nr,
271  hwloc_obj_t *nodes,
272  unsigned long flags);
273 
274 
275 
294 HWLOC_DECLSPEC int
296  hwloc_memattr_id_t attribute,
297  hwloc_obj_t target_node,
298  struct hwloc_location *initiator,
299  unsigned long flags,
300  hwloc_uint64_t *value);
301 
330 HWLOC_DECLSPEC int
332  hwloc_memattr_id_t attribute,
333  struct hwloc_location *initiator,
334  unsigned long flags,
335  hwloc_obj_t *best_target, hwloc_uint64_t *value);
336 
358 HWLOC_DECLSPEC int
360  hwloc_memattr_id_t attribute,
361  hwloc_obj_t target,
362  unsigned long flags,
363  struct hwloc_location *best_initiator, hwloc_uint64_t *value);
364 
377 HWLOC_DECLSPEC int
379  hwloc_memattr_id_t attribute,
380  const char **name);
381 
389 HWLOC_DECLSPEC int
391  hwloc_memattr_id_t attribute,
392  unsigned long *flags);
393 
410 };
411 
421 HWLOC_DECLSPEC int
423  const char *name,
424  unsigned long flags,
425  hwloc_memattr_id_t *id);
426 
447 HWLOC_DECLSPEC int
449  hwloc_memattr_id_t attribute,
450  hwloc_obj_t target_node,
451  struct hwloc_location *initiator,
452  unsigned long flags,
453  hwloc_uint64_t value);
454 
493 HWLOC_DECLSPEC int
495  hwloc_memattr_id_t attribute,
496  struct hwloc_location *initiator,
497  unsigned long flags,
498  unsigned *nr, hwloc_obj_t *targets, hwloc_uint64_t *values);
499 
531 HWLOC_DECLSPEC int
533  hwloc_memattr_id_t attribute,
534  hwloc_obj_t target_node,
535  unsigned long flags,
536  unsigned *nr, struct hwloc_location *initiators, hwloc_uint64_t *values);
539 #ifdef __cplusplus
540 } /* extern "C" */
541 #endif
542 
543 
544 #endif /* HWLOC_MEMATTR_H */
Where to measure attributes from.
Definition: memattrs.h:200
The best nodes for this memory attribute are those with the higher values. For instance Bandwidth...
Definition: memattrs.h:401
int hwloc_memattr_get_best_initiator(hwloc_topology_t topology, hwloc_memattr_id_t attribute, hwloc_obj_t target, unsigned long flags, struct hwloc_location *best_initiator, hwloc_uint64_t *value)
Return the best initiator for the given attribute and target NUMA node.
hwloc_cpuset_t cpuset
Location as a cpuset, when the location type is HWLOC_LOCATION_TYPE_CPUSET.
Definition: memattrs.h:206
int hwloc_get_local_numanode_objs(hwloc_topology_t topology, struct hwloc_location *location, unsigned *nr, hwloc_obj_t *nodes, unsigned long flags)
Return an array of local NUMA nodes.
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:716
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:161
int hwloc_memattr_get_targets(hwloc_topology_t topology, hwloc_memattr_id_t attribute, struct hwloc_location *initiator, unsigned long flags, unsigned *nr, hwloc_obj_t *targets, hwloc_uint64_t *values)
Return the target NUMA nodes that have some values for a given attribute.
union hwloc_location::hwloc_location_u location
The "WriteLatency" is returned as nanoseconds, as seen from the given initiator location.
Definition: memattrs.h:168
Location is given as a cpuset, in the location cpuset union field.
Definition: memattrs.h:194
Location is given as an object, in the location object union field.
Definition: memattrs.h:196
The "Bandwidth" is returned in MiB/s, as seen from the given initiator location.
Definition: memattrs.h:109
int hwloc_memattr_get_by_name(hwloc_topology_t topology, const char *name, hwloc_memattr_id_t *id)
Return the identifier of the memory attribute with the given name.
The "Locality" is returned as the number of PUs in that locality (e.g. the weight of its cpuset)...
Definition: memattrs.h:94
The "Capacity" is returned in bytes (local_memory attribute in objects).
Definition: memattrs.h:79
hwloc_local_numanode_flag_e
Flags for selecting target NUMA nodes.
Definition: memattrs.h:214
hwloc_obj_t object
Location as an object, when the location type is HWLOC_LOCATION_TYPE_OBJECT.
Definition: memattrs.h:208
enum hwloc_location_type_e type
Type of location.
Definition: memattrs.h:202
int hwloc_memattr_get_best_target(hwloc_topology_t topology, hwloc_memattr_id_t attribute, struct hwloc_location *initiator, unsigned long flags, hwloc_obj_t *best_target, hwloc_uint64_t *value)
Return the best target NUMA node for the given attribute and initiator.
The "WriteBandwidth" is returned in MiB/s, as seen from the given initiator location.
Definition: memattrs.h:131
The "ReadBandwidth" is returned in MiB/s, as seen from the given initiator location.
Definition: memattrs.h:120
int hwloc_memattr_get_initiators(hwloc_topology_t topology, hwloc_memattr_id_t attribute, hwloc_obj_t target_node, unsigned long flags, unsigned *nr, struct hwloc_location *initiators, hwloc_uint64_t *values)
Return the initiators that have values for a given attribute for a specific target NUMA node...
int hwloc_memattr_register(hwloc_topology_t topology, const char *name, unsigned long flags, hwloc_memattr_id_t *id)
Register a new memory attribute.
hwloc_location_type_e
Type of location.
Definition: memattrs.h:192
hwloc_memattr_flag_e
Memory attribute flags. Given to hwloc_memattr_register() and returned by hwloc_memattr_get_flags().
Definition: memattrs.h:397
The value returned for this memory attribute depends on the given initiator. For instance Bandwidth a...
Definition: memattrs.h:409
int hwloc_memattr_get_value(hwloc_topology_t topology, hwloc_memattr_id_t attribute, hwloc_obj_t target_node, struct hwloc_location *initiator, unsigned long flags, hwloc_uint64_t *value)
Return an attribute value for a specific target NUMA node.
The best nodes for this memory attribute are those with the lower values. For instance Latency...
Definition: memattrs.h:405
int hwloc_memattr_get_flags(hwloc_topology_t topology, hwloc_memattr_id_t attribute, unsigned long *flags)
Return the flags of the given attribute.
Select NUMA nodes whose locality is smaller than the given cpuset. For instance, if a package (or its...
Definition: memattrs.h:227
unsigned hwloc_memattr_id_t
A memory attribute identifier. May be either one of hwloc_memattr_id_e or a new id returned by hwloc_...
Definition: memattrs.h:178
Actual location.
Definition: memattrs.h:204
The "ReadLatency" is returned as nanoseconds, as seen from the given initiator location.
Definition: memattrs.h:157
Select all NUMA nodes in the topology. The initiator initiator is ignored.
Definition: memattrs.h:233
int hwloc_memattr_set_value(hwloc_topology_t topology, hwloc_memattr_id_t attribute, hwloc_obj_t target_node, struct hwloc_location *initiator, unsigned long flags, hwloc_uint64_t value)
Set an attribute value for a specific target NUMA node.
int hwloc_memattr_get_name(hwloc_topology_t topology, hwloc_memattr_id_t attribute, const char **name)
Return the name of a memory attribute.
Select NUMA nodes whose locality is larger than the given cpuset. For instance, if a single PU (or it...
Definition: memattrs.h:220
Structure of a topology object.
Definition: hwloc.h:420
hwloc_memattr_id_e
Memory node attributes.
Definition: memattrs.h:69
The "Latency" is returned as nanoseconds, as seen from the given initiator location.
Definition: memattrs.h:146