Skip to content

Commit 4f84f80

Browse files
committed
Port #390 to Python
1 parent eb43dc3 commit 4f84f80

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

bench_runner/scripts/workflow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,11 @@ def tune_system(venv: PathLike, perf: bool) -> None:
219219
if not sys.platform.startswith("linux"):
220220
return
221221

222-
run_in_venv(venv, "pyperf", ["system", perf and "reset" or "tune"], sudo=True)
222+
args = ["system", perf and "reset" or "tune"]
223+
if cpu_affinity := os.environ.get("CPU_AFFINITY"):
224+
args.append(f'--affinity="{cpu_affinity}"')
225+
226+
run_in_venv(venv, "pyperf", args, sudo=True)
223227

224228
if perf:
225229
subprocess.check_call(

0 commit comments

Comments
 (0)