libnuma - data types problems

Fabio Tordini <[email protected]> Mon, 07 Jan 2013 11:46:36 +0100
Newsgroups org.kernel.vger.linux-numa
Message-ID <[email protected]>
Hello,

I'm using libnuma for an enhanced NUMA-aware allocator. There are some 
functions which do not work as explained in the 'numa man page' or 
libnuma APIs. Precisely, I'm having problems with these functions: 
|numa_get_run_node_mask()| and |numa_node_to_cpus()|.

Concerning the former, reading the API and the manual, it returns a 
|struct bitmask *|, while the compiler asks for a |nodemask_t|.

The latter is supposed to require two parameters, as from API 
definition, but the compiler asks for three. If I pass three arguments 
as it asks - |(int node, unsigned long *buffer, int bufferlen) -| I get 
a /segfault/ every time, no matter the /bufferlen/ I use.

Maybe I'm doing something wrong, but I can't see what, since I'm 
trivially following APIs directives. I wonder whether there are some 
discrepancies between APIs and source code that have changed through 
libnuma versions. (btw, how do I check which libnuma/numactl is running 
on the machine? I working remotely on a server and |numactl| doesn't 
seem to have a |--version| option!)

Kind regards,

-- 

Fabio Tordini

PhD Candidate,
Computer Science Department
University of Torino - Italy