I\'m using libnuma on Linux. My threads should be aware of the node/core they\'re running on. Is it possible to get the current threads\'s node/core somehow? I\'ve been thro
I found this solution:
#include #include int main(void) { printf("CPU: %d\n", sched_getcpu()); return 0; }
Then, if you need the node of the cpu, you can use numa.h:
int cpu = sched_getcpu(); int node = numa_node_of_cpu(cpu);