From c0f94fc9e6bb4874c3715d339ac945b45ab8858a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=C3=ABl=20Champagne=20Gareau?= Date: Tue, 15 Jul 2025 12:15:44 -0400 Subject: [PATCH 1/3] ensure CC is set in addition to CXX when building --- scripts/aws_tests.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/aws_tests.bash b/scripts/aws_tests.bash index 03b65ad..52901dc 100755 --- a/scripts/aws_tests.bash +++ b/scripts/aws_tests.bash @@ -193,13 +193,13 @@ process_instance() { clang++ --version > outputs/clang++.txt echo "Building project with g++ and running the benchmarks..." - CXX=g++ cmake -B build . && cmake --build build + CC=gcc CXX=g++ cmake -B build . && cmake --build build ./scripts/generate_multiple_tables.py g++ rm -rf build echo "Building project with clang++ and running the benchmarks..." - CXX=clang++ cmake -B build . && cmake --build build + CC=clang CXX=clang++ cmake -B build . && cmake --build build ./scripts/generate_multiple_tables.py clang++ EOF From 0a01dcd210599102dfc3f1b1155426eace1da8c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=C3=ABl=20Champagne=20Gareau?= Date: Tue, 15 Jul 2025 12:16:03 -0400 Subject: [PATCH 2/3] add missing instructions for aws script --- scripts/README.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/scripts/README.md b/scripts/README.md index 8762f8a..4805f9d 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -12,8 +12,28 @@ cmake -B build Process the raw output: ``` - ./scripts/latex_table.py myresults.txt +./scripts/latex_table.py myresults.txt ``` -This will print out to std out the table. The numbers are already rounded to two significant digits, -ready to be included in a scientific manuscript. \ No newline at end of file +This will print to stdout the table. +The numbers are already rounded to two significant digits, ready to be included in a scientific manuscript. + +It is also possible to create multiple LaTeX tables at once with: + +``` +./scripts/generate_multiple_tables.py ` +``` + +## Running tests on Amazon AWS + +It is possible to generate tests on Amazon AWS: + +``` +./scripts/aws_tests.py +``` + +This script will create new EC2 instances, run +`./scripts/generate_multiple_tables.py` script on both g++ and clang++ builds, +save each output to a separate folder, and then terminate the instance. + +Prerequisites and some user configurable variables are in the script itself. From 58714c62a5f99a1012009012c1404c8a582f6b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=C3=ABl=20Champagne=20Gareau?= Date: Tue, 15 Jul 2025 12:16:34 -0400 Subject: [PATCH 3/3] save raw output in addition to latex tables --- scripts/generate_multiple_tables.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/scripts/generate_multiple_tables.py b/scripts/generate_multiple_tables.py index a118550..f79cf83 100755 --- a/scripts/generate_multiple_tables.py +++ b/scripts/generate_multiple_tables.py @@ -36,15 +36,18 @@ def get_cpu_model(): + env = os.environ.copy() + env["LANG"] = "C" + system = platform.system() if system == "Windows": return platform.processor() elif system == "Darwin": os.environ['PATH'] = os.environ['PATH'] + os.pathsep + '/usr/sbin' command = ["sysctl", "-n", "machdep.cpu.brand_string"] - return subprocess.check_output(command, text=True).strip() + return subprocess.check_output(command, env=env, text=True).strip() elif system == "Linux": - output = subprocess.check_output(["lscpu"], text=True) + output = subprocess.check_output(["lscpu"], env=env, text=True) model_name = None architecture = None for line in output.splitlines(): @@ -78,14 +81,21 @@ def process_job(label, cmd_args, flags): # Build output file name flag_label = ''.join([f.strip('-') for f in flags]) or 'none' safe_label = label.replace('.', '_') - filename = f"{CPUModel}_{CompilerLabel}_{safe_label}_{flag_label}.tex" - out_path = os.path.join(output_dir, filename) + filename_tex = f"{CPUModel}_{CompilerLabel}_{safe_label}_{flag_label}.tex" + filename_raw = filename_tex[:-4] + '.raw' # replace .tex with .raw + out_path_tex = os.path.join(output_dir, filename_tex) + out_path_raw = os.path.join(output_dir, filename_raw) - # Write to file + # Write LaTeX table to file tex_content = generate_latex_table(output) - with open(out_path, 'w') as f: + with open(out_path_tex, 'w') as f: f.write(tex_content) - print(f"Written: {out_path}\n", flush=True) + print(f"Written: {out_path_tex}", flush=True) + + # Write raw output to .raw file + with open(out_path_raw, 'w') as f: + f.write(output) + print(f"Written: {out_path_raw}\n", flush=True) if __name__ == '__main__':