Modules

COSC 365 · Fall 2026

We will work through these modules together in class. Check the schedule for what we are covering. Readings refer to Pacheco and Malensek, An Introduction to Parallel Programming, 2nd edition.

Getting started

Connect to the cluster, use shell commands, and edit files.

Textbook: Read Chapter 1.

Compile C programs, measure runtime, and explore memory locality.

Distributed memory with MPI

Run multiple processes, send messages, and combine partial results.

Textbook: Read §3.1 (pp. 90–100); skim §3.2 (pp. 100–105).

Share input, combine results, and estimate an area; optional parallel timing.

Textbook: Read §§3.4.1–3.4.5 (pp. 108–116).

Use scatter and gather to work on pieces of an array.

Textbook: Read §§3.4.6–3.4.8 (pp. 116–120).

Exchange boundary values and model one step of heat flow.

Textbook: Read the MPI_Sendrecv discussion in §3.7.

Estimate pi with a Monte Carlo simulation, reduction, and timing.

Textbook: Chapter 3, programming assignment 3.2 (pp. 155–156).

Revisit the book’s trapezoid program and sort values through neighbor exchanges.

Shared memory with Pthreads

Create and join threads, compare shared memory with MPI processes, and divide a sum safely.

Textbook: Read §§4.1–4.3.

Protect shared updates and combine local work with a short critical section.

Textbook: Read §§4.4 and 4.6.

Coordinate producers and consumers using condition variables and a bounded buffer.

Textbook: Read §4.8.3.

Publish shared results, synchronize phases, and repeat a neighbor-averaging calculation.

Textbook: Review §4.8.

Shared memory with OpenMP

Start a team of threads with a parallel directive, tell shared from private variables, and combine results with critical and reduction.

Textbook: Read §§5.1–5.4 (pp. 221–237).

Back to top