import os,subprocess,resource,sys,time from pathlib import Path os.chdir(Path(__file__).parent) def cap(): resource.setrlimit(resource.RLIMIT_AS,(2*1024**3,2*1024**3));resource.setrlimit(resource.RLIMIT_CPU,(600,600));os.sched_setaffinity(0,{min(os.sched_getaffinity(0))}) subprocess.run(['g++','-O3','-std=c++17','count_hist.cpp','-o','count_hist'],check=True) t=time.monotonic() with open('histograms.txt','w') as f:subprocess.run(['./count_hist'],stdout=f,check=True,preexec_fn=cap) subprocess.run([sys.executable,'evaluate.py'],check=True,preexec_fn=cap) subprocess.run([sys.executable,'check.py'],check=True,preexec_fn=cap) subprocess.run([sys.executable,'pair_control.py'],check=True,preexec_fn=cap) print(f'scan/check wall_seconds={time.monotonic()-t:.3f}',file=sys.stderr)