Skip to main content
GPU Programming

Parallel Programming Tutorial with Examples.

Parallel programming tutorial with examples: task and data parallelism, race conditions, synchronisation and common parallel patterns.

Beginner

Start here — no prior experience needed

2 lessons

Intermediate

For developers with core concepts down

5 lessons
parallel-programming intermediate
5 min read

Three runs of the same unsynchronized parallel sum produce three different wrong totals — reduction(+:sum) fixes it correctly and is 115x faster than the naive #pragma omp critical alternative, measured.

parallel-programming intermediate
5 min read

#pragma omp atomic is nearly 5x faster than a lock for a plain increment — but it only protects the single write it's attached to, not the if-check before it. Three widened-race runs give three different wrong answers to prove it.

parallel-programming intermediate
5 min read

Two ranks calling MPI_Send before MPI_Recv works fine for a single int — and hangs forever for a half-million-element array. The same bug, passing at small scale and deadlocking in production.

parallel-programming intermediate
5 min read

MPI_Reduce computes the right answer and hands it to exactly one rank — every other rank's result buffer is untouched. MPI_Allreduce is the one-line fix when everyone needs the answer.

parallel-programming intermediate
5 min read

MPI ranks and OpenMP threads compose cleanly in one program — until each rank's thread count multiplies against the rank count and quietly oversubscribes the machine's real core count, measured at 1.8x slower.

Advanced

Production-grade patterns for experienced engineers

1 lesson

Also part of Parallel Programming

Taught in other topics. Each link opens the lesson in its home topic.

2 lessons