Comment 1 for bug 1251209

Revision history for this message
James Hunt (jamesodhunt) wrote :

Hi Dave,

> There's currently no report of CPU/memory affinity I can see.
You're right!

> It's probably useful at least to report the cpus_allowed_list and
> mems_allowed_list from proc's status file on Linux, but it would be
> better to use the hwloc library to report it portably
> in terms of logical topology, if you don't mind the extra dependency. I
> could do an hwloc version.
I've now got some code to display cpu affinity (using sched_getaffinity()).

NUMA looks slightly more awkward for 2 reasons:

1) Although I've got some code that uses get_mempolicy(), that syscall requires libnuma (!) seemingly in my case only to give
    the correct platform-specific syscall number for get_mempolicy(). This seems to be somewhat overkill but I'll take a closer
    look tomorrow.

2) Testing: get_mempolicy() returns ENOSYS on non-NUMA systems (like mine :) Do you have access to NUMA hardware?

Would the above suffice do you think or is there a compelling reason to use libhwloc? As you've deduced, I'm trying to minimise dependencies on additional libraries. That said, I don't want to reinvent too many wheels and have been wondering about libcpuid for displaying proper virtualisation details (although this doesn't seem to be widely packaged yet).