[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2014-10-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- resolution: - out of date stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17444 ___

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2014-02-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: The current os.cpu_count implementation calls sysconf(_SC_NPROCESSORS_ONLN), which is apparently defined under OS X, and returns the number of online CPUs (logical?):

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2014-01-31 Thread Yury Selivanov
Yury Selivanov added the comment: bump? -- nosy: +yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17444 ___ ___ Python-bugs-list mailing

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2013-03-19 Thread STINNER Victor
STINNER Victor added the comment: I like the idea of a new function in the os module because I don't like having to import the multiprocessing module just to known the number of CPUs. I'm using such function to set MAKEFLAGS envrionment variable on Linux: -j8 par example. 2013/3/19 Trent Nelson

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2013-03-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: I also like the os.cpu_count() function, the information is useful sometimes outside of multiprocessing, and calling out to external scripts to gather the information (as multiprocessing currently does) feels yucky. That should probably be a new issue, the

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2013-03-19 Thread John Szakmeister
John Szakmeister added the comment: Actually, Trent's version looks at hw.logicalcpu and then falls back to hw.ncpu, if there was an error. Given the state of the documentation on these parameters, it's hard to say whether it's right or wrong, but at least hw.logicalcpu scales correctly if I

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2013-03-19 Thread Trent Nelson
Trent Nelson added the comment: On Tue, Mar 19, 2013 at 01:58:59AM -0700, John Szakmeister wrote: John Szakmeister added the comment: Actually, Trent's version looks at hw.logicalcpu and then falls back to hw.ncpu, if there was an error. Given the state of the documentation on these

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2013-03-18 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'm not sure if hw.availcpu is the right value to use as it is not documented at all (neither in a manpage, nor in a headerfile). hw.activecpu seems to be the one that should be used: it is documented as The number of processors currently available for

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2013-03-18 Thread John Szakmeister
John Szakmeister added the comment: Ronald: it is mentioned in some books (a Google search can turn them up), but they don't really offer much description behind the intent. When I looked into this several years ago, it was very unclear what `hw.activecpu` was intended for. It sounded more

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2013-03-18 Thread STINNER Victor
STINNER Victor added the comment: Here is an interesting, but old (2007), email on darwin-dev: http://lists.apple.com/archives/darwin-dev/2007/Jun/msg00088.html This can all change in the future, but currently: hw.ncpu is a wart; consider it to be deprecated. hw.physicalcpu is the number of

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2013-03-18 Thread Trent Nelson
Trent Nelson added the comment: I remember looking at what multiprocessing did and not really liking it; I ended up writing a C version that works across a wider range of platforms, accessible via posixmodule.c:posix_cpu_count() (os.cpu_count()):

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2013-03-17 Thread John Szakmeister
New submission from John Szakmeister: While trying to test a fix for Nose, I discovered that multiprocessing is picking up the CPU count incorrectly. It should be using hw.availcpu instead of hw.ncpu. The latter is the number of cpus installed in the system, but the former is the number

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2013-03-17 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17444 ___ ___ Python-bugs-list mailing

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2013-03-17 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- stage: - patch review versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17444 ___

[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2013-03-17 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +ned.deily, ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17444 ___ ___