Open MPI logo

Portable Hardware Locality (hwloc) Documentation: v2.9.0

  |   Home   |   Support   |   FAQ   |  
memattrs.h
1 /*
2  * Copyright © 2019-2022 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 
182 HWLOC_DECLSPEC int
184  const char *name,
185  hwloc_memattr_id_t *id);
186 
187 
194 };
195 
207 };
208 
209 
218 
225 
231 };
232 
262 HWLOC_DECLSPEC int
264  struct hwloc_location *location,
265  unsigned *nr,
266  hwloc_obj_t *nodes,
267  unsigned long flags);
268 
269 
270 
285 HWLOC_DECLSPEC int
287  hwloc_memattr_id_t attribute,
288  hwloc_obj_t target_node,
289  struct hwloc_location *initiator,
290  unsigned long flags,
291  hwloc_uint64_t *value);
292 
318 HWLOC_DECLSPEC int
320  hwloc_memattr_id_t attribute,
321  struct hwloc_location *initiator,
322  unsigned long flags,
323  hwloc_obj_t *best_target, hwloc_uint64_t *value);
324 
347 HWLOC_DECLSPEC int
349  hwloc_memattr_id_t attribute,
350  hwloc_obj_t target,
351  unsigned long flags,
352  struct hwloc_location *best_initiator, hwloc_uint64_t *value);
353 
363 HWLOC_DECLSPEC int
365  hwloc_memattr_id_t attribute,
366  const char **name);
367 
372 HWLOC_DECLSPEC int
374  hwloc_memattr_id_t attribute,
375  unsigned long *flags);
376 
393 };
394 
401 HWLOC_DECLSPEC int
403  const char *name,
404  unsigned long flags,
405  hwloc_memattr_id_t *id);
406 
425 HWLOC_DECLSPEC int
427  hwloc_memattr_id_t attribute,
428  hwloc_obj_t target_node,
429  struct hwloc_location *initiator,
430  unsigned long flags,
431  hwloc_uint64_t value);
432 
469 HWLOC_DECLSPEC int
471  hwloc_memattr_id_t attribute,
472  struct hwloc_location *initiator,
473  unsigned long flags,
474  unsigned *nr, hwloc_obj_t *targets, hwloc_uint64_t *values);
475 
505 HWLOC_DECLSPEC int
507  hwloc_memattr_id_t attribute,
508  hwloc_obj_t target_node,
509  unsigned long flags,
510  unsigned *nr, struct hwloc_location *initiators, hwloc_uint64_t *values);
513 #ifdef __cplusplus
514 } /* extern "C" */
515 #endif
516 
517 
518 #endif /* HWLOC_MEMATTR_H */
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
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:692
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_location_type_e
Type of location.
Definition: memattrs.h:189
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.
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.
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.
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_id_e
Memory node attributes.
Definition: memattrs.h:69
hwloc_local_numanode_flag_e
Flags for selecting target NUMA nodes.
Definition: memattrs.h:211
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
@ HWLOC_LOCATION_TYPE_CPUSET
Location is given as a cpuset, in the location cpuset union field.
Definition: memattrs.h:191
@ HWLOC_LOCATION_TYPE_OBJECT
Location is given as an object, in the location object union field.
Definition: memattrs.h:193
@ HWLOC_MEMATTR_ID_BANDWIDTH
The "Bandwidth" is returned in MiB/s, as seen from the given initiator location.
Definition: memattrs.h:109
@ HWLOC_MEMATTR_ID_WRITE_BANDWIDTH
The "WriteBandwidth" is returned in MiB/s, as seen from the given initiator location.
Definition: memattrs.h:131
@ HWLOC_MEMATTR_ID_READ_LATENCY
The "ReadLatency" is returned as nanoseconds, as seen from the given initiator location.
Definition: memattrs.h:157
@ HWLOC_MEMATTR_ID_LOCALITY
The "Locality" is returned as the number of PUs in that locality (e.g. the weight of its cpuset).
Definition: memattrs.h:94
@ HWLOC_MEMATTR_ID_CAPACITY
The "Capacity" is returned in bytes (local_memory attribute in objects).
Definition: memattrs.h:79
@ HWLOC_MEMATTR_ID_WRITE_LATENCY
The "WriteLatency" is returned as nanoseconds, as seen from the given initiator location.
Definition: memattrs.h:168
@ HWLOC_MEMATTR_ID_READ_BANDWIDTH
The "ReadBandwidth" is returned in MiB/s, as seen from the given initiator location.
Definition: memattrs.h:120
@ HWLOC_MEMATTR_ID_LATENCY
The "Latency" is returned as nanoseconds, as seen from the given initiator location.
Definition: memattrs.h:146
@ 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:217
@ 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:224
@ HWLOC_LOCAL_NUMANODE_FLAG_ALL
Select all NUMA nodes in the topology. The initiator initiator is ignored.
Definition: memattrs.h:230
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_get_flags(hwloc_topology_t topology, hwloc_memattr_id_t attribute, unsigned long *flags)
Return the flags of the given attribute.
int hwloc_memattr_get_name(hwloc_topology_t topology, hwloc_memattr_id_t attribute, const char **name)
Return the name of a memory attribute.
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_flag_e
Memory attribute flags. Given to hwloc_memattr_register() and returned by hwloc_memattr_get_flags().
Definition: memattrs.h:380
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_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.
@ HWLOC_MEMATTR_FLAG_LOWER_FIRST
The best nodes for this memory attribute are those with the lower values. For instance Latency.
Definition: memattrs.h:388
@ HWLOC_MEMATTR_FLAG_NEED_INITIATOR
The value returned for this memory attribute depends on the given initiator. For instance Bandwidth a...
Definition: memattrs.h:392
@ HWLOC_MEMATTR_FLAG_HIGHER_FIRST
The best nodes for this memory attribute are those with the higher values. For instance Bandwidth.
Definition: memattrs.h:384
Structure of a topology object.
Definition: hwloc.h:396
Where to measure attributes from.
Definition: memattrs.h:197
union hwloc_location::hwloc_location_u location
enum hwloc_location_type_e type
Type of location.
Definition: memattrs.h:199
Actual location.
Definition: memattrs.h:201
hwloc_cpuset_t cpuset
Location as a cpuset, when the location type is HWLOC_LOCATION_TYPE_CPUSET.
Definition: memattrs.h:203
hwloc_obj_t object
Location as an object, when the location type is HWLOC_LOCATION_TYPE_OBJECT.
Definition: memattrs.h:205