pmem2_source_numa_node - Man Page

returns data source numa node

Synopsis

#include <libpmem2.h>

struct pmem2_source;
int pmem2_source_numa_node(const struct pmem2_source *source, int *numa_node);

Description

The pmem2_source_numa_node() function retrieves the numa node of the given data source. The numa node can be used to, e.g., pin threads to near-memory cores. The numa node is stored in *numa_node. It is the same value that is shown as numa_node in ndctl list -v.

Return Value

The pmem2_source_numa_node() function returns 0 on success. If the function fails, the *numa_node variable is left unmodified and a negative error code is returned.

Errors

The pmem2_source_numa_node() can fail with the following errors:

Caveats

This call requires libndctl to retrieve the numa information. It only works for sources that are actually located on persistent memory, i.e., devdax or fsdax. As anonymous sources are not backed by files on persistent memory, this method is not supported for them. It also does not work under systems without libndctl.

See Also

errno(3), ndctl_new(3), pmem2_source_from_fd(3), libpmem2(7), libndctl(7) and <https://pmem.io>

Info

2024-01-25 PMDK - PMDK Programmer's Manual