Skip to content

Commit c47782e

Browse files
committed
Add support for PYPERF_CPU_AFFINITY
1 parent 0dee4d0 commit c47782e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bench_runner/templates/_benchmark.src.yml

Lines changed: 5 additions & 1 deletion
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' }}
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"}' }}
225225
- name: Tune for (Linux) perf
226226
if: ${{ steps.should_run.outputs.should_run != 'false' && inputs.perf }}
227227
run: |
@@ -232,6 +232,10 @@ jobs:
232232
run: |
233233
rm -rf ~/.debug/*
234234
venv/bin/python -m bench_runner run_benchmarks ${{ inputs.perf && 'perf' || 'benchmark' }} cpython/python ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.benchmarks || 'all' }} ${{ env.flags }} --run_id ${{ github.run_id }}
235+
- name: Untune system
236+
if: ${{ steps.should_run.outputs.should_run != 'false' }}
237+
run: |
238+
sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH venv/bin/python -m pyperf system reset
235239
# Pull again, since another job may have committed results in the meantime
236240
- name: Pull benchmarking
237241
if: ${{ steps.should_run.outputs.should_run != 'false' && !inputs.perf }}

0 commit comments

Comments
 (0)