Fix: Honor OMP_DYNAMIC and env binary hash in replay runner

Pin OMP_DYNAMIC=FALSE so thread counts stay deterministic, record it in
the command line, and locate the binary hash correctly when the command
is wrapped in env with inline assignments.
This commit is contained in:
wyj committed 2026-09-14 19:15:56 -04:00
1 parent ce691b11ad
commit a88ec56097
1 file changed
+9 -3
+9 -3
View File
@@ -21,12 +21,18 @@ def run(name, command, seconds=45):
logfile = Path(__file__).parent / (name + '.log')
if logfile.exists():
raise RuntimeError(f'refusing to overwrite {logfile}')
env = dict(os.environ, OMP_NUM_THREADS='16')
env = dict(os.environ, OMP_NUM_THREADS='16', OMP_DYNAMIC='FALSE')
with logfile.open('x') as out:
out.write('COMMAND OMP_NUM_THREADS=16 ' + shlex.join(command) + '\n')
out.write('COMMAND OMP_NUM_THREADS=16 OMP_DYNAMIC=FALSE ' +
shlex.join(command) + '\n')
out.write(f'TIMEOUT {seconds}s\n')
out.write('GIT ' + subprocess.check_output(['git','rev-parse','HEAD'],cwd=root,text=True))
binary = Path(command[0])
binary_index = 0
if command[0] == 'env':
binary_index = 1
while binary_index < len(command) and '=' in command[binary_index]:
binary_index += 1
binary = Path(command[binary_index]) if binary_index < len(command) else Path()
if binary.is_file():
out.write('BINARY_SHA256 ' + hashlib.sha256(binary.read_bytes()).hexdigest() + '\n')
out.flush()