Enumerations | |
enum | hwloc_membind_policy_t { HWLOC_MEMBIND_DEFAULT, HWLOC_MEMBIND_FIRSTTOUCH, HWLOC_MEMBIND_BIND, HWLOC_MEMBIND_INTERLEAVE, HWLOC_MEMBIND_REPLICATE, HWLOC_MEMBIND_NEXTTOUCH } |
Memory binding policy. More... | |
enum | hwloc_membind_flags_t { HWLOC_MEMBIND_PROCESS, HWLOC_MEMBIND_THREAD, HWLOC_MEMBIND_STRICT, HWLOC_MEMBIND_MIGRATE, HWLOC_MEMBIND_NOCPUBIND } |
Memory binding flags. More... | |
Functions | |
HWLOC_DECLSPEC int | hwloc_set_membind_nodeset (hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) |
Bind current process memory on the given nodeset nodeset . | |
HWLOC_DECLSPEC int | hwloc_set_membind (hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, hwloc_membind_policy_t policy, int flags) |
Bind current process memory on memory nodes near the given cpuset cpuset . | |
HWLOC_DECLSPEC int | hwloc_get_membind_nodeset (hwloc_topology_t topology, hwloc_nodeset_t nodeset, hwloc_membind_policy_t *policy, int flags) |
Get current process memory binding in nodeset nodeset . | |
HWLOC_DECLSPEC int | hwloc_get_membind (hwloc_topology_t topology, hwloc_cpuset_t cpuset, hwloc_membind_policy_t *policy, int flags) |
Get current process memory binding in cpuset cpuset . | |
HWLOC_DECLSPEC int | hwloc_set_proc_membind_nodeset (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) |
Bind given process memory on the given nodeset nodeset . | |
HWLOC_DECLSPEC int | hwloc_set_proc_membind (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_cpuset_t cpuset, hwloc_membind_policy_t policy, int flags) |
Bind given process memory on memory nodes near the given cpuset cpuset . | |
HWLOC_DECLSPEC int | hwloc_get_proc_membind_nodeset (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_nodeset_t nodeset, hwloc_membind_policy_t *policy, int flags) |
Get current process memory binding in nodeset nodeset . | |
HWLOC_DECLSPEC int | hwloc_get_proc_membind (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t cpuset, hwloc_membind_policy_t *policy, int flags) |
Get current process memory binding in cpuset cpuset . | |
HWLOC_DECLSPEC int | hwloc_set_area_membind_nodeset (hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) |
Bind some memory range on the given nodeset nodeset . | |
HWLOC_DECLSPEC int | hwloc_set_area_membind (hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_cpuset_t cpuset, hwloc_membind_policy_t policy, int flags) |
Bind some memory range on memory nodes near the given cpuset cpuset . | |
HWLOC_DECLSPEC int | hwloc_get_area_membind_nodeset (hwloc_topology_t topology, const void *addr, size_t len, hwloc_nodeset_t nodeset, hwloc_membind_policy_t *policy, int flags) |
Get some memory range memory binding in nodeset nodeset . | |
HWLOC_DECLSPEC int | hwloc_get_area_membind (hwloc_topology_t topology, const void *addr, size_t len, hwloc_cpuset_t cpuset, hwloc_membind_policy_t *policy, int flags) |
Get some memory range memory binding in cpuset cpuset . | |
HWLOC_DECLSPEC void * | hwloc_alloc (hwloc_topology_t topology, size_t len) |
Allocate some memory. | |
HWLOC_DECLSPEC void * | hwloc_alloc_membind_nodeset (hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_malloc |
Allocate some memory on the given nodeset nodeset . | |
HWLOC_DECLSPEC void * | hwloc_alloc_membind (hwloc_topology_t topology, size_t len, hwloc_const_cpuset_t cpuset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_malloc |
Allocate some memory on memory nodes near the given cpuset cpuset . | |
HWLOC_DECLSPEC int | hwloc_free (hwloc_topology_t topology, void *addr, size_t len) |
Free some memory allocated by hwloc_alloc() or hwloc_alloc_membind(). |
The most portable version that should be preferred over the others, whenever possible, is
hwloc_alloc_membind_policy(topology, size, set, HWLOC_MEMBIND_DEFAULT, 0),
which will try to allocate new data bound to the given set, possibly by changing the current memory binding policy, or at worse allocate memory without binding it at all. Since HWLOC_MEMBIND_STRICT is not given, this will even not fail unless a mere malloc() itself would fail, i.e. ENOMEM.
Each binding is available with a CPU set argument or a NUMA memory node set argument. The name of the latter ends with _nodeset. It is also possible to convert between CPU set and node set using hwloc_cpuset_to_nodeset or hwloc_cpuset_from_nodeset.
Memory binding flags.
These flags can be used to refine the binding policy.
Memory binding policy.
These can be used to choose the binding policy.
Note that not all systems support all kinds of binding.
HWLOC_DECLSPEC void* hwloc_alloc | ( | hwloc_topology_t | topology, | |
size_t | len | |||
) |
Allocate some memory.
This is equivalent to malloc(), except it tries to allocated page-aligned memory from the OS.
HWLOC_DECLSPEC void* hwloc_alloc_membind | ( | hwloc_topology_t | topology, | |
size_t | len, | |||
hwloc_const_cpuset_t | cpuset, | |||
hwloc_membind_policy_t | policy, | |||
int | flags | |||
) |
Allocate some memory on memory nodes near the given cpuset cpuset
.
HWLOC_DECLSPEC void* hwloc_alloc_membind_nodeset | ( | hwloc_topology_t | topology, | |
size_t | len, | |||
hwloc_const_nodeset_t | nodeset, | |||
hwloc_membind_policy_t | policy, | |||
int | flags | |||
) |
Allocate some memory on the given nodeset nodeset
.
HWLOC_DECLSPEC int hwloc_free | ( | hwloc_topology_t | topology, | |
void * | addr, | |||
size_t | len | |||
) |
Free some memory allocated by hwloc_alloc() or hwloc_alloc_membind().
HWLOC_DECLSPEC int hwloc_get_area_membind | ( | hwloc_topology_t | topology, | |
const void * | addr, | |||
size_t | len, | |||
hwloc_cpuset_t | cpuset, | |||
hwloc_membind_policy_t * | policy, | |||
int | flags | |||
) |
Get some memory range memory binding in cpuset cpuset
.
HWLOC_DECLSPEC int hwloc_get_area_membind_nodeset | ( | hwloc_topology_t | topology, | |
const void * | addr, | |||
size_t | len, | |||
hwloc_nodeset_t | nodeset, | |||
hwloc_membind_policy_t * | policy, | |||
int | flags | |||
) |
Get some memory range memory binding in nodeset nodeset
.
HWLOC_DECLSPEC int hwloc_get_membind | ( | hwloc_topology_t | topology, | |
hwloc_cpuset_t | cpuset, | |||
hwloc_membind_policy_t * | policy, | |||
int | flags | |||
) |
Get current process memory binding in cpuset cpuset
.
HWLOC_DECLSPEC int hwloc_get_membind_nodeset | ( | hwloc_topology_t | topology, | |
hwloc_nodeset_t | nodeset, | |||
hwloc_membind_policy_t * | policy, | |||
int | flags | |||
) |
Get current process memory binding in nodeset nodeset
.
HWLOC_DECLSPEC int hwloc_get_proc_membind | ( | hwloc_topology_t | topology, | |
hwloc_pid_t | pid, | |||
hwloc_cpuset_t | cpuset, | |||
hwloc_membind_policy_t * | policy, | |||
int | flags | |||
) |
Get current process memory binding in cpuset cpuset
.
HWLOC_DECLSPEC int hwloc_get_proc_membind_nodeset | ( | hwloc_topology_t | topology, | |
hwloc_pid_t | pid, | |||
hwloc_nodeset_t | nodeset, | |||
hwloc_membind_policy_t * | policy, | |||
int | flags | |||
) |
Get current process memory binding in nodeset nodeset
.
HWLOC_DECLSPEC int hwloc_set_area_membind | ( | hwloc_topology_t | topology, | |
const void * | addr, | |||
size_t | len, | |||
hwloc_const_cpuset_t | cpuset, | |||
hwloc_membind_policy_t | policy, | |||
int | flags | |||
) |
Bind some memory range on memory nodes near the given cpuset cpuset
.
HWLOC_DECLSPEC int hwloc_set_area_membind_nodeset | ( | hwloc_topology_t | topology, | |
const void * | addr, | |||
size_t | len, | |||
hwloc_const_nodeset_t | nodeset, | |||
hwloc_membind_policy_t | policy, | |||
int | flags | |||
) |
Bind some memory range on the given nodeset nodeset
.
HWLOC_DECLSPEC int hwloc_set_membind | ( | hwloc_topology_t | topology, | |
hwloc_const_cpuset_t | cpuset, | |||
hwloc_membind_policy_t | policy, | |||
int | flags | |||
) |
Bind current process memory on memory nodes near the given cpuset cpuset
.
HWLOC_DECLSPEC int hwloc_set_membind_nodeset | ( | hwloc_topology_t | topology, | |
hwloc_const_nodeset_t | nodeset, | |||
hwloc_membind_policy_t | policy, | |||
int | flags | |||
) |
Bind current process memory on the given nodeset nodeset
.
HWLOC_DECLSPEC int hwloc_set_proc_membind | ( | hwloc_topology_t | topology, | |
hwloc_pid_t | pid, | |||
hwloc_const_cpuset_t | cpuset, | |||
hwloc_membind_policy_t | policy, | |||
int | flags | |||
) |
Bind given process memory on memory nodes near the given cpuset cpuset
.
HWLOC_DECLSPEC int hwloc_set_proc_membind_nodeset | ( | hwloc_topology_t | topology, | |
hwloc_pid_t | pid, | |||
hwloc_const_nodeset_t | nodeset, | |||
hwloc_membind_policy_t | policy, | |||
int | flags | |||
) |
Bind given process memory on the given nodeset nodeset
.