Quantcast
Channel: NUMA: How to check in which part of RAM a C++ array is allocated? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

NUMA: How to check in which part of RAM a C++ array is allocated?

$
0
0

I have a server with 2 CPU's and 64GB of RAM, 32GB per CPU.

I know that each CPU has it's own part of RAM, lets call them RAM1 and RAM2. I would like to make my program know on which RAM (RAM1 or RAM2) it allocates it's data.

I tried to check pointers values:

  // put the thread at i-th CPU, using pthread_setaffinity_npTData *a = new TData[N];...cout << "CPU = "<< i << " adress = "<< a << endl; 

but the output looks random. I suppose that is because addresses are virtual. Is there any correspondence between virtual memory addresses and part of the RAM?

How to check in which RAM my array "a" is allocated?


Viewing all articles
Browse latest Browse all 3

Trending Articles