1PMEM2_SOURCE_NUMA_NODE(3)  PMDK Programmer's Manual  PMEM2_SOURCE_NUMA_NODE(3)
2
3
4

NAME

6       pmem2_source_numa_node() - returns data source numa node
7

SYNOPSIS

9              #include <libpmem2.h>
10
11              struct pmem2_source;
12              int pmem2_source_numa_node(const struct pmem2_source *source, int *numa_node);
13

DESCRIPTION

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

RETURN VALUE

21       The pmem2_source_numa_node() function returns 0  on  success.   If  the
22       function  fails, the *numa_node variable is left unmodified and a nega‐
23       tive error code is returned.
24

ERRORS

26       The pmem2_source_numa_node() can fail with the following errors:
27
28       On all systems:
29
30PMEM2_E_NOSUPP - source type or operating system not  supported  (see
31         #caveats for details.)
32
33       on Linux:
34
35PMEM2_E_DAX_REGION_NOT_FOUND  -  no  ndctl_region could be determined
36         for the source.
37
38PMEM2_E_INVALID_FILE_TYPE - if the source points to a directory.
39
40       • -errno set by failing ndctl_new, while trying to create  a  new  con‐
41         text.
42

CAVEATS

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

SEE ALSO

51       errno(3),           ndctl_new(3),          pmem2_source_from_handle(3),
52       pmem2_source_from_fd(3), libpmem2(7), libndctl(7) and <https://pmem.io>
53
54
55
56PMDK - pmem2 API version 1.0      2022-05-24         PMEM2_SOURCE_NUMA_NODE(3)
Impressum