Skip to content

Pvelesko/rename executables to main#159

Open
Geekdude wants to merge 6 commits intomasterfrom
pvelesko/rename-executables-to-main
Open

Pvelesko/rename executables to main#159
Geekdude wants to merge 6 commits intomasterfrom
pvelesko/rename-executables-to-main

Conversation

@Geekdude
Copy link
Copy Markdown
Member

@Geekdude Geekdude commented Apr 6, 2026

Summary

  • Standardize binary names across 189 Makefiles to produce an executable named main instead of various custom names
  • Custom names replaced: AMGMk, MD5Hash, SobolQRNG, rtm8, lulesh, kernel, b+tree.out, xsbench, XSBench, streamcluster, srad, myocyte, leukocyte, kmeans, hybridsort, heartwall, MaxwellsGPU3d, miniFE.x, vj-cpu, snicit, qtclustering, miniDGS, etc.
  • Updated all Makefile variants (.hipcl, .hipsycl, .aomp, .nvc)
  • Updated run:, clean:, and target rules to reference main

Motivation

Most benchmarks already use main as the executable name, but ~60 benchmarks had custom names. This makes automation harder since scripts need to know each benchmark's binary name. With this change, all benchmarks consistently produce ./main, simplifying tooling like autohecbench.py (which already defaults to binary = "main").

Test plan

  • Verify a sample of renamed benchmarks compile and run correctly
  • Confirm make run works for affected benchmarks

pvelesko and others added 6 commits April 6, 2026 16:46
Ensures benchmarks return non-zero exit code when verification fails,
allowing automated test harnesses to detect failures via process exit
codes. Changes are purely additive (insertions only).

Adds `if (condition) exit(1);` after PASS/FAIL output in 838 benchmark
files covering all variants (CUDA, HIP, OpenMP, SYCL). Adds
`#include <cstdlib>` where needed. Preserves original file encoding
(ISO-8859) and line endings (CRLF).
Relocates the failure exit from immediately after the PASS/FAIL print
to just before `return 0;`, ensuring host and device memory are properly
released before the process exits. Changes `exit(1)` to `return 1` in
596 files where free/cudaFree/hipFree/sycl::free calls follow the
verification output.
…ult check

The prefetch() function was missing exit(1) on failure, and main()
referenced testResult which is local to prefetch/naive functions.
Both functions now exit(1) on failure directly.
Standardize binary names across all benchmarks to produce an executable
named 'main' instead of various custom names (AMGMk, MD5Hash, SobolQRNG,
rtm8, lulesh, kernel, b+tree.out, xsbench, XSBench, streamcluster, srad,
myocyte, leukocyte, kmeans, hybridsort, heartwall, MaxwellsGPU3d, etc.).

Changes include:
- Updated program/EXE/BIN_NAME variables in Makefiles
- Changed binary target names and -o flags
- Updated run targets to reference 'main'
- Updated clean targets to remove 'main'
- Fixed all Makefile variants (.hipcl, .hipsycl, .aomp, .nvc)
replace vj-gpu with main
- face-omp (aomp, nvc), face-sycl: restore vj-cpu in program variable,
  rename vj-gpu target to main
- logan-cuda/hip: revert Makefile changes (restore demo target, c++14)
- lsqt-cuda/hip: add missing builddir target for obj_gpu directory
- multimaterial-hip, -hip/hipcl, -sycl, -omp/aomp, -omp/nvc: restore
  multimat and multimat_F targets, rename multimat_FL to main
- projectile-hip: remove accidentally committed Projectile binary
- face-sycl: fix $(program) target override that broke vj-cpu recipe
- multimaterial-sycl: add missing all: target so make builds everything
Copilot AI review requested due to automatic review settings April 6, 2026 21:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Standardizes benchmark build outputs by renaming executables to main across many Makefile variants and aligns runtime automation by ensuring benchmarks return non-zero exit codes on verification failure.

Changes:

  • Renamed numerous Makefile targets/program variables to produce a main executable and updated run/clean rules accordingly.
  • Updated many benchmarks to exit/return non-zero when validation fails (PASS/FAIL now maps to process exit status).
  • Added missing standard headers (e.g., <cstdlib>) in some benchmarks to support exit() usage.

Reviewed changes

Copilot reviewed 300 out of 1021 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/floydwarshall-sycl/main.cpp Exits with non-zero on FAIL (but introduces unreachable code).
src/floydwarshall-omp/main.cpp Exits with non-zero on FAIL (but introduces unreachable code).
src/floydwarshall-hip/main.cu Exits with non-zero on FAIL (but introduces unreachable code).
src/floydwarshall-cuda/main.cu Exits with non-zero on FAIL (but introduces unreachable code).
src/filter-sycl/main.cpp Adds non-zero exit on mismatch (but duplicates the check).
src/dp-sycl/main.cpp Adds non-zero exit on mismatch (but duplicates the check).
src/atomicPerf-sycl/main.cpp Adds non-zero exit on failure (but duplicates the check many times).
src/accuracy-sycl/main.cpp Introduces ok flag for exit status (but likely incorrect scoping/indentation).
src/face-sycl/Makefile Renames GPU target to main but run target still invokes vj-cpu.
src/b+tree-hip/Makefile Renames output to main but clean target doesn’t remove main.
(many additional Makefiles / benchmarks) Similar executable renames and non-zero exit code updates across the suite.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 275 to 280
else
{
printf("FAIL\n");
exit(1);
if (numNodes <= 8)
{
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added exit(1); makes the diagnostic printing block below unreachable. If the intent is to keep printing details on small graphs, move the non-zero exit/return to the end of the else block (after the optional dumps), or replace exit(1) with a flag and return 1 at the end of main.

Copilot uses AI. Check for mistakes.
sycl::free(d_nres, q);

if (!match) return 1;
if (!match) return 1;
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failure check is duplicated. Remove one of the two identical if (!match) return 1; lines to avoid redundancy.

Suggested change
if (!match) return 1;

Copilot uses AI. Check for mistakes.
Comment on lines +183 to +184
if (dst != dst_ref) return 1;
if (dst != dst_ref) return 1;
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same condition is repeated three times. Keep a single check (or use return dst != dst_ref;) to reduce noise and prevent copy/paste artifacts from spreading.

Suggested change
if (dst != dst_ref) return 1;
if (dst != dst_ref) return 1;

Copilot uses AI. Check for mistakes.
Comment on lines +290 to +294
if (fail) return 1;
if (fail) return 1;
if (fail) return 1;
if (fail) return 1;
if (fail) return 1;
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if (fail) return 1; statement is duplicated multiple times. This should be a single check after fail is finalized; remove the extra lines.

Suggested change
if (fail) return 1;
if (fail) return 1;
if (fail) return 1;
if (fail) return 1;
if (fail) return 1;

Copilot uses AI. Check for mistakes.

int count;
q.memcpy(&count, d_count, sizeof(int)).wait();
bool ok = (count == count_ref);
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added ok declaration appears to be introduced with inconsistent indentation (tab) and may be scoped too narrowly (e.g., inside a loop/block) while being used later for the final exit status. Declare ok in the outer scope of main and assign to it (do not redeclare) so the final if (!ok) return 1; reliably reflects the verification result.

Copilot uses AI. Check for mistakes.
free(label);
free(data);

if (!ok) return 1;
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added ok declaration appears to be introduced with inconsistent indentation (tab) and may be scoped too narrowly (e.g., inside a loop/block) while being used later for the final exit status. Declare ok in the outer scope of main and assign to it (do not redeclare) so the final if (!ok) return 1; reliably reflects the verification result.

Copilot uses AI. Check for mistakes.
#===============================================================================

program = vj-cpu vj-gpu
program = main vj-cpu
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Makefile introduces a main target but the run target still invokes only ./vj-cpu. Given the PR goal of standardizing on main and other face Makefile variants run the GPU version via ./main, consider updating run here to execute ./main for the GPU path (or add a separate run step for it) to keep behavior consistent.

Copilot uses AI. Check for mistakes.
Comment on lines 107 to 108
run: build
$(LAUNCHER) ./vj-cpu ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-cpu.pgm
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Makefile introduces a main target but the run target still invokes only ./vj-cpu. Given the PR goal of standardizing on main and other face Makefile variants run the GPU version via ./main, consider updating run here to execute ./main for the GPU path (or add a separate run step for it) to keep behavior consistent.

Copilot uses AI. Check for mistakes.
$(LAUNCHER) ./main file ../data/b+tree/mil.txt command ../data/b+tree/command.txt

clean:
rm -rf *.o *.out \
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build output is renamed to main, but clean still removes *.out and does not remove the main executable. Update the clean rule to delete main so make clean restores a clean workspace.

Suggested change
rm -rf *.o *.out \
rm -rf *.o *.out main \

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants