Skip to content

Commit 6e8270f

Browse files
committed
Port #390 to Python
1 parent b8be907 commit 6e8270f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: bench_runner/scripts/workflow.py

+5-1
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)