Re: getting processor numbers

Paul Jackson
2007-04-04T02:58:50Z

Ulrich wrote:
> But all this of course does not solve the issue sysconf() has. In
> sysconf we cannot use sched_getaffinity since all the systems CPUs must
> be reported.

Good point. Yes, sysconf(_SC_NPROCESSORS_CONF) really needs to continue
returning the number of CPUs online, to maintain compatibility with the
current implementation, and because with a name like that, just about
anything else would be "surprising".

And OpenMPI shouldn't be calling sysconf(_SC_NPROCESSORS_CONF), as it does
not want to know how much hardware is there, but rather how much hardware
it is allowed to use. Something based on sched_getaffinity() would seem
to be ideal for its purposes.

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.925.600.0401