Complete the onboarding exercise
Work from your copy of the UWHPC onboarding template. Read the problem statement completely before implementing either component.
Requirements
Section titled “Requirements”The checked-in build configuration requires:
- CMake 3.21 or newer
- Ninja
- A compiler with C++17 support
Permitted edit scope
Section titled “Permitted edit scope”Edit one file: src/submission.hpp. Both the Grid class and apply_stencil
go there.
Do not edit the benchmark harness (bench/main.cpp), CMakeLists.txt,
CMakePresets.json, or the GitHub Actions workflow. The evaluator depends on
the supplied interfaces and harness behavior.
Preserve the declared Grid interface — see the
problem statement. The template ships it without
implementations, so the project will not link until you supply them.
Configure and build
Section titled “Configure and build”Run these commands from the template repository root:
cmake --preset benchmarkcmake --build --preset benchmarkThe first command configures a Release build with the template’s benchmark
preset. The second builds the supplied benchmark target, which includes your
src/submission.hpp.
Run the correctness test
Section titled “Run the correctness test”ctest --preset benchmark --output-on-failureThis runs the benchmark binary’s --check mode. It steps your implementation
and an independent reference implementation forward in lockstep, then compares
the two final fields cell by cell, over five public cases:
| Case | Grid | Steps | Initial condition |
|---|---|---|---|
public/square-32 | 32 × 32 | 20 | Center block |
public/nonsquare-48x80 | 48 × 80 | 40 | Linear gradient |
public/checker-64 | 64 × 64 | 30 | Checkerboard |
public/one-step-50 | 50 × 50 | 1 | Center block |
public/nonsquare-boundary-80x50 | 80 × 50 | 10 | Linear gradient |
A case passes when the largest absolute difference from the reference is at
most 1e-6. Note the non-square cases: they will catch a layout that assumes
rows and columns are interchangeable, and one that confuses the width of a row
with the distance between rows.
The evaluator runs these same public cases plus private cases you cannot see here, so passing locally is necessary but not sufficient. Do not treat a successful compilation as completion.
Run the benchmark
Section titled “Run the benchmark”./build/benchmark/uwhpc_benchmarkWith no arguments, the binary benchmarks a 1024 × 1024 grid over 200 time steps and prints one line of JSON:
{ "runtime_ms": 148.404, "memory_mb": 16.777, "score": 1.293 }score is the harness’s reference time divided by yours, so a higher score is
a faster run. The reference is deliberately naive — treat it as a floor to
clear rather than a design to imitate. Local results vary by machine; the
submitted result is measured on team infrastructure.
Run the benchmark several times and compare distributions, not one favorable measurement. Change one design decision at a time so you can explain which change affected performance. A fast result does not make undefined behavior, an invalid aliasing promise, or unsafe resource ownership acceptable.