[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: I like the feature, but I would prefer to use a syntax like --affinity=0-2 to use cores 0, 1 and 2, rather than having to compute manually a binary mask (--affinity=3). It's a builtin feature of taskset: just use --cpu-list. -- nosy: +haypo

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread Florin Papa
New submission from Florin Papa: Hi all, This is Florin Papa from the Dynamic Scripting Languages Optimizations Team from Intel Corporation. The patch submitted adds an affinity feature to the Grand Unified Python Benchmarks suite to allow running benchmarks on a given CPU/set of CPUs. It is

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
Changes by STINNER Victor : -- type: -> performance ___ Python tracker ___ ___

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread Florin Papa
Florin Papa added the comment: Thank you for the feedback. Please see the updated patch. -- Added file: http://bugs.python.org/file41791/affinity_v2.patch ___ Python tracker

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread Florin Papa
Florin Papa added the comment: I was thinking that a warning might go unnoticed, that is why I chose to end the program if taskset is not found. It would force the user to install missing packages. Otherwise the patch looks ok. -- ___ Python

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread Florin Papa
Florin Papa added the comment: I have updated the patch to throw an exception if the taskset command is not available. Not checking that taskset works will generate an ambiguous error (if there is no taskset on the system) that does not explicitly point to the problem. I believe that users

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: Florent: "I was thinking that a warning might go unnoticed, that is why I chose to end the program if taskset is not found." Oh right, I kept your behaviour and pushed a change. --- changeset: 238:a97acad3bbf7 tag: tip user:Victor Stinner

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: I don't think that it's useful to check at runtime that taskset works. At least, I expect an error if the option is used and the command fails. To use CPU affinity you need to know your hardware and your platform. For most stable results you may even configure

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread Florin Papa
Florin Papa added the comment: No problem :) -- resolution: fixed -> status: closed -> open ___ Python tracker ___

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: "Florent" oops, Florin, sorry :-p -- ___ Python tracker ___ ___

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: Thanks for your contribution ;-) -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +yselivanov ___ Python tracker ___ ___

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: Hum, I modified your change: * only display a warning if the option is used but taskset doesn't work * remove check on Linux: taskset might be available on other platforms, it doesn't really matter to check the OS, we already check if the command works * try