This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgomp/58642] gomp regression: not "honoring" anymore task set and numactl
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 06 Oct 2013 18:02:12 +0000
- Subject: [Bug libgomp/58642] gomp regression: not "honoring" anymore task set and numactl
- Auto-submitted: auto-generated
- References: <bug-58642-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58642
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, looking at kernel sources, it seems it returns EINVAL:
if ((len * BITS_PER_BYTE) < nr_cpu_ids)
return -EINVAL;
so the question is how to find what your nr_cpu_ids is and how to (cheaply)
query it from userland.
I was using sysconf (_SC_NPROCESSORS_CONF) for that, which is what I saw when
googling around for what upper bound to pass to pthread_getaffinity_np when I
want to dynamically support more than 1024 CPUs, but thought it would work fine
to pass just CPU_ALLOC_SIZE of the sysconf return value.
What do you get from
getconf -a | grep _NPROCESSORS
? What is the minimum cpusetsize that pthread_getaffinity_np doesn't fail
with?
ls -l /sys/devices/system/cpu/
? I'd strongly prefer not to use say minimum of CPU_ALLOC_SIZE (sysconf
(_SC_NPROCESSORS_CONF)) and CPUSETSIZE, I need cpusetsize sized bitmap for
every place in the OMP_PLACES list (or every thread, core resp. socket), so
having to allocate 128 bytes per each rather than say 8 on <= 64 CPU box sounds
overkill to me.