Skip to content

Commit 201a466

Browse files
committed
save raw output in addition to latex tables
1 parent edbd961 commit 201a466

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

scripts/generate_multiple_tables.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,18 @@
3636

3737

3838
def get_cpu_model():
39+
env = os.environ.copy()
40+
env["LANG"] = "C"
41+
3942
system = platform.system()
4043
if system == "Windows":
4144
return platform.processor()
4245
elif system == "Darwin":
4346
os.environ['PATH'] = os.environ['PATH'] + os.pathsep + '/usr/sbin'
4447
command = ["sysctl", "-n", "machdep.cpu.brand_string"]
45-
return subprocess.check_output(command, text=True).strip()
48+
return subprocess.check_output(command, env=env, text=True).strip()
4649
elif system == "Linux":
47-
output = subprocess.check_output(["lscpu"], text=True)
50+
output = subprocess.check_output(["lscpu"], env=env, text=True)
4851
model_name = None
4952
architecture = None
5053
for line in output.splitlines():
@@ -78,14 +81,21 @@ def process_job(label, cmd_args, flags):
7881
# Build output file name
7982
flag_label = ''.join([f.strip('-') for f in flags]) or 'none'
8083
safe_label = label.replace('.', '_')
81-
filename = f"{CPUModel}_{CompilerLabel}_{safe_label}_{flag_label}.tex"
82-
out_path = os.path.join(output_dir, filename)
84+
filename_tex = f"{CPUModel}_{CompilerLabel}_{safe_label}_{flag_label}.tex"
85+
filename_raw = filename_tex[:-4] + '.raw' # replace .tex with .raw
86+
out_path_tex = os.path.join(output_dir, filename_tex)
87+
out_path_raw = os.path.join(output_dir, filename_raw)
8388

84-
# Write to file
89+
# Write LaTeX table to file
8590
tex_content = generate_latex_table(output)
86-
with open(out_path, 'w') as f:
91+
with open(out_path_tex, 'w') as f:
8792
f.write(tex_content)
88-
print(f"Written: {out_path}\n", flush=True)
93+
print(f"Written: {out_path_tex}", flush=True)
94+
95+
# Write raw output to .raw file
96+
with open(out_path_raw, 'w') as f:
97+
f.write(output)
98+
print(f"Written: {out_path_raw}\n", flush=True)
8999

90100

91101
if __name__ == '__main__':

0 commit comments

Comments
 (0)