Skip to content

Commit 022a5db

Browse files
committed
Run pyperformance with --affinity if CPU_AFFINITY (renamed from
PYPERF_CPU_AFFINITY) is set, as well.
1 parent c47782e commit 022a5db

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: bench_runner/scripts/run_benchmarks.py

+3
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ def run_benchmarks(
8282
if extra_args is None:
8383
extra_args = []
8484

85+
if (affinity := os.environ.get('CPU_AFFINITY')):
86+
extra_args.append(f'--affinity={affinity}')
87+
8588
args = [
8689
sys.executable,
8790
"-m",

Diff for: bench_runner/templates/_benchmark.src.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ jobs:
221221
- name: Tune system
222222
if: ${{ steps.should_run.outputs.should_run != 'false' }}
223223
run: |
224-
sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH venv/bin/python -m pyperf system ${{ inputs.perf && 'reset' || 'tune ${PYPERF_CPU_AFFINITY:+--affinity="$PYPERF_CPU_AFFINITY"}' }}
224+
sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH venv/bin/python -m pyperf system ${{ inputs.perf && 'reset' || 'tune ${CPU_AFFINITY:+--affinity="$CPU_AFFINITY"}' }}
225225
- name: Tune for (Linux) perf
226226
if: ${{ steps.should_run.outputs.should_run != 'false' && inputs.perf }}
227227
run: |

0 commit comments

Comments
 (0)