Hardware Locality (hwloc)  2.3.0
memattrs.h
1 /*
2  * Copyright © 2019-2020 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 
77 
91 
99 
107 
108  /* TODO read vs write, persistence? */
109 };
110 
114 typedef unsigned hwloc_memattr_id_t;
115 
118 HWLOC_DECLSPEC int
120  const char *name,
121  hwloc_memattr_id_t *id);
122 
123 
132  } type;
140 };
141 
142 
150 
156 
161 };
162 
192 HWLOC_DECLSPEC int
194  struct hwloc_location *location,
195  unsigned *nr,
196  hwloc_obj_t *nodes,
197  unsigned long flags);
198 
199 
200 
209 HWLOC_DECLSPEC int
211  hwloc_memattr_id_t attribute,
212  hwloc_obj_t target_node,
213  struct hwloc_location *initiator,
214  unsigned long flags,
215  hwloc_uint64_t *value);
216 
236 HWLOC_DECLSPEC int
238  hwloc_memattr_id_t attribute,
239  struct hwloc_location *initiator,
240  unsigned long flags,
241  hwloc_obj_t *best_target, hwloc_uint64_t *value);
242 
265 HWLOC_DECLSPEC int
267  hwloc_memattr_id_t attribute,
268  hwloc_obj_t target,
269  unsigned long flags,
270  struct hwloc_location *best_initiator, hwloc_uint64_t *value);
271 
281 HWLOC_DECLSPEC int
283  hwloc_memattr_id_t attribute,
284  const char **name);
285 
290 HWLOC_DECLSPEC int
292  hwloc_memattr_id_t attribute,
293  unsigned long *flags);
294 
311 };
312 
319 HWLOC_DECLSPEC int
321  const char *name,
322  unsigned long flags,
323  hwloc_memattr_id_t *id);
324 
337 HWLOC_DECLSPEC int
339  hwloc_memattr_id_t attribute,
340  hwloc_obj_t target_node,
341  struct hwloc_location *initiator,
342  unsigned long flags,
343  hwloc_uint64_t value);
344 
375 HWLOC_DECLSPEC int
377  hwloc_memattr_id_t attribute,
378  struct hwloc_location *initiator,
379  unsigned long flags,
380  unsigned *nrp, hwloc_obj_t *targets, hwloc_uint64_t *values);
381 
411 HWLOC_DECLSPEC int
413  hwloc_memattr_id_t attribute,
414  hwloc_obj_t target_node,
415  unsigned long flags,
416  unsigned *nr, struct hwloc_location *initiators, hwloc_uint64_t *values);
419 #ifdef __cplusplus
420 } /* extern "C" */
421 #endif
422 
423 
424 #endif /* HWLOC_MEMATTR_H */
hwloc_get_local_numanode_objs
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.
hwloc_location
Where to measure attributes from.
Definition: memattrs.h:125
hwloc_cpuset_t
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:140
hwloc_memattr_get_targets
int hwloc_memattr_get_targets(hwloc_topology_t topology, hwloc_memattr_id_t attribute, struct hwloc_location *initiator, unsigned long flags, unsigned *nrp, hwloc_obj_t *targets, hwloc_uint64_t *values)
Return the target NUMA nodes that have some values for a given attribute.
HWLOC_LOCAL_NUMANODE_FLAG_LARGER_LOCALITY
@ HWLOC_LOCAL_NUMANODE_FLAG_LARGER_LOCALITY
Select NUMA nodes whose locality is larger than the given cpuset. For instance, if a single PU (or it...
Definition: memattrs.h:149
hwloc_location::HWLOC_LOCATION_TYPE_CPUSET
@ HWLOC_LOCATION_TYPE_CPUSET
Location is given as an cpuset, in the location cpuset union field.
Definition: memattrs.h:131
hwloc_memattr_get_flags
int hwloc_memattr_get_flags(hwloc_topology_t topology, hwloc_memattr_id_t attribute, unsigned long *flags)
Return the flags of the given attribute.
hwloc_location::hwloc_location_u::cpuset
hwloc_cpuset_t cpuset
Location as a cpuset, when the location type is HWLOC_LOCATION_TYPE_CPUSET.
Definition: memattrs.h:138
hwloc_memattr_id_e
hwloc_memattr_id_e
Memory node attributes.
Definition: memattrs.h:66
HWLOC_LOCAL_NUMANODE_FLAG_ALL
@ HWLOC_LOCAL_NUMANODE_FLAG_ALL
Select all NUMA nodes in the topology. initiator is ignored.
Definition: memattrs.h:160
HWLOC_MEMATTR_FLAG_HIGHER_FIRST
@ HWLOC_MEMATTR_FLAG_HIGHER_FIRST
The best nodes for this memory attribute are those with the higher values. For instance Bandwidth.
Definition: memattrs.h:302
hwloc_location::type
enum hwloc_location::hwloc_location_type_e type
hwloc_memattr_get_best_target
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.
hwloc_memattr_get_by_name
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.
hwloc_memattr_get_best_initiator
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_MEMATTR_FLAG_NEED_INITIATOR
@ HWLOC_MEMATTR_FLAG_NEED_INITIATOR
The value returned for this memory attribute depends on the given initiator. For instance Bandwidth a...
Definition: memattrs.h:310
hwloc_memattr_set_value
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.
hwloc_memattr_get_name
int hwloc_memattr_get_name(hwloc_topology_t topology, hwloc_memattr_id_t attribute, const char **name)
Return the name of a memory attribute.
hwloc_memattr_flag_e
hwloc_memattr_flag_e
Memory attribute flags. Given to hwloc_memattr_register() and returned by hwloc_memattr_get_flags().
Definition: memattrs.h:298
HWLOC_MEMATTR_ID_CAPACITY
@ HWLOC_MEMATTR_ID_CAPACITY
"Capacity". The capacity is returned in bytes (local_memory attribute in objects).
Definition: memattrs.h:76
hwloc_memattr_id_t
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:114
hwloc_memattr_get_value
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.
hwloc_memattr_get_initiators
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.
hwloc_obj
Structure of a topology object.
Definition: hwloc.h:395
hwloc_memattr_register
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_MEMATTR_ID_BANDWIDTH
@ HWLOC_MEMATTR_ID_BANDWIDTH
"Bandwidth". The bandwidth is returned in MiB/s, as seen from the given initiator location....
Definition: memattrs.h:98
hwloc_topology_t
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:691
hwloc_location::hwloc_location_u::object
hwloc_obj_t object
Location as an object, when the location type is HWLOC_LOCATION_TYPE_OBJECT.
Definition: memattrs.h:136
hwloc_location::hwloc_location_u
Actual location.
Definition: memattrs.h:134
hwloc_location::location
union hwloc_location::hwloc_location_u location
HWLOC_MEMATTR_ID_LOCALITY
@ HWLOC_MEMATTR_ID_LOCALITY
"Locality". The locality is returned as the number of PUs in that locality (e.g. the weight of its cp...
Definition: memattrs.h:90
hwloc_local_numanode_flag_e
hwloc_local_numanode_flag_e
Flags for selecting target NUMA nodes.
Definition: memattrs.h:144
hwloc_location::HWLOC_LOCATION_TYPE_OBJECT
@ HWLOC_LOCATION_TYPE_OBJECT
Location is given as an object, in the location object union field.
Definition: memattrs.h:129
HWLOC_MEMATTR_ID_LATENCY
@ HWLOC_MEMATTR_ID_LATENCY
"Latency". The latency is returned as nanoseconds, as seen from the given initiator location....
Definition: memattrs.h:106
hwloc_location::hwloc_location_type_e
hwloc_location_type_e
Type of location.
Definition: memattrs.h:127
HWLOC_MEMATTR_FLAG_LOWER_FIRST
@ HWLOC_MEMATTR_FLAG_LOWER_FIRST
The best nodes for this memory attribute are those with the lower values. For instance Latency.
Definition: memattrs.h:306
HWLOC_LOCAL_NUMANODE_FLAG_SMALLER_LOCALITY
@ HWLOC_LOCAL_NUMANODE_FLAG_SMALLER_LOCALITY
Select NUMA nodes whose locality is smaller than the given cpuset. For instance, if a package (or its...
Definition: memattrs.h:155