Skip to content

Complete the onboarding exercise

Work from your copy of the UWHPC onboarding template. Read the problem statement completely before implementing either component.

The checked-in build configuration requires:

  • CMake 3.21 or newer
  • Ninja
  • A compiler with C++17 support

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.

Run these commands from the template repository root:

Terminal window
cmake --preset benchmark
cmake --build --preset benchmark

The 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.

Terminal window
ctest --preset benchmark --output-on-failure

This 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:

CaseGridStepsInitial condition
public/square-3232 × 3220Center block
public/nonsquare-48x8048 × 8040Linear gradient
public/checker-6464 × 6430Checkerboard
public/one-step-5050 × 501Center block
public/nonsquare-boundary-80x5080 × 5010Linear 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.

Terminal window
./build/benchmark/uwhpc_benchmark

With 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.