|
36 | 36 |
|
37 | 37 |
|
38 | 38 | def get_cpu_model():
|
| 39 | + env = os.environ.copy() |
| 40 | + env["LANG"] = "C" |
| 41 | + |
39 | 42 | system = platform.system()
|
40 | 43 | if system == "Windows":
|
41 | 44 | return platform.processor()
|
42 | 45 | elif system == "Darwin":
|
43 | 46 | os.environ['PATH'] = os.environ['PATH'] + os.pathsep + '/usr/sbin'
|
44 | 47 | 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() |
46 | 49 | elif system == "Linux":
|
47 |
| - output = subprocess.check_output(["lscpu"], text=True) |
| 50 | + output = subprocess.check_output(["lscpu"], env=env, text=True) |
48 | 51 | model_name = None
|
49 | 52 | architecture = None
|
50 | 53 | for line in output.splitlines():
|
@@ -78,14 +81,21 @@ def process_job(label, cmd_args, flags):
|
78 | 81 | # Build output file name
|
79 | 82 | flag_label = ''.join([f.strip('-') for f in flags]) or 'none'
|
80 | 83 | 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) |
83 | 88 |
|
84 |
| - # Write to file |
| 89 | + # Write LaTeX table to file |
85 | 90 | tex_content = generate_latex_table(output)
|
86 |
| - with open(out_path, 'w') as f: |
| 91 | + with open(out_path_tex, 'w') as f: |
87 | 92 | 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) |
89 | 99 |
|
90 | 100 |
|
91 | 101 | if __name__ == '__main__':
|
|
0 commit comments