This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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.
History
Date User Action Args
2012-08-04 13:10:54vstinnersetrecipients: + vstinner, georg.brandl, amaury.forgeotdarc, pitrou, giampaolo.rodola, benjamin.peterson, anacrolix, neologix, rosslagerwall, python-dev
2012-08-04 13:10:53vstinnerlinkissue12655 messages
2012-08-04 13:10:53vstinnercreate