Message167403
| Author |
vstinner |
| Recipients |
amaury.forgeotdarc, anacrolix, benjamin.peterson, georg.brandl, giampaolo.rodola, neologix, pitrou, python-dev, rosslagerwall, vstinner |
| Date |
2012年08月04日.13:00:57 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<CAMpsgwbBefKDouCGmad_T7+-CqTDTyfcD0O4soNGUSyrqAyMOw@mail.gmail.com> |
| In-reply-to |
<1344078791.62.0.253376763697.issue12655@psf.upfronthosting.co.za> |
| Content |
sched_getaffinity() does not fail if the set is smaller than the
number of CPU. Try with an initial value of ncpus=1. So we cannot
start the heuristic with ncpus=16, because it would only return 16
even if the computer has more cpus.
Instead of this heuristic, why not simply alway using ncpus = CPU_SETSIZE?
I don't know if CPU_SETSIZE is part of the standard (POSIX?).
You may also use a constant size (CPU_SETSIZE) of the set used by
sched_setaffinity() to simplify the code. |
|