Message167405
| Author |
vstinner |
| Recipients |
amaury.forgeotdarc, anacrolix, benjamin.peterson, georg.brandl, giampaolo.rodola, neologix, pitrou, python-dev, rosslagerwall, vstinner |
| Date |
2012年08月04日.13:10:53 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<CAMpsgwbfPHm6xBWVvwcuaQt1UkVCG6tC4Wfd-rhPqdOpDnzUmA@mail.gmail.com> |
| In-reply-to |
<1344085391.34.0.374671131855.issue12655@psf.upfronthosting.co.za> |
| Content |
>> Try with an initial value of ncpus=1.
> Well, I've tried and it works:
Oh, you're right :-) I only checked ncpus (1), not the final result.
It works because CPU_ALLOC_SIZE() rounds the size using
sizeof(unsigned long) (64 bits on my CPU). So CPU_ALLOC_SIZE(1)
returns 8, and sched_getaffinity() takes the size of the set in bytes,
and not the number of CPU.
sched_getaffinity(0) returns {0, 1, 2, 3, 4, 5, 6, 7} with ncpus=1 and
setsize=8. |
|