Skip to main content

Tutorial IV – Whole-Grid Applications

The last two lessons of the main sequence put PEs in a rectangle. Lesson 11 splits a 2-D field into blocks, one per PE, exchanges the edges of the blocks with all four neighbours, and measures that cost against the computation and against what a PE has. Lesson 12 turns the same grid into a solver that stops by itself, which needs a sum over every PE after each sweep. Along the way the two lessons teach Paint functions and replication, structs, and roles that a PE takes from its own coordinates.

LessonWhat it teaches
Lesson 11 — A grid of blocks: halo exchange and what it costsBlocks with ghost cells, four colorpairs and a moat ring, define with hstackrep and vstackrep, a PE's budget, exchange against computation
Lesson 12 — A complete iterative solverA sum over a 2-D grid returned to every PE, roles from the ID registers, a parameter struct, a loop that every PE leaves after the same sweep