Affiliate disclosure
Book titles on this page link to Amazon. As an Amazon Associate, DataField.Dev earns from qualifying purchases — at no additional cost to you.
Further Reading: OpenMP
OpenMP is one of the best-documented parallel APIs in existence, and its primary source — the specification —
is unusually readable for a standard. Sources are tagged Tier 1 (works we are confident exist and
recommend) and Tier 2 (real and worth seeking; confirm the current edition or URL yourself). Read enough
to make data scoping and the reduction/race distinction reflexive, because those are the ninety percent of
OpenMP you will use every day.
The primary source
- The OpenMP Application Programming Interface specification (
openmp.org). The definitive document, and more approachable than most standards — the data-sharing rules of §33.3 are spelled out precisely here, and the Fortran examples are worth reading directly. Start with the specification's own Examples document, which is a guided tour of every construct. Tier 1. - The OpenMP reference guide ("cheat sheet") from the ARB (
openmp.org/resources). A two-page card of every directive and clause; the fastest lookup for "what were the arguments toscheduleagain?" Keep it beside you. Tier 1.
Books
- Milan Curcic, Modern Fortran: Building Efficient Parallel Applications (Manning). The natural companion for this whole part; carries OpenMP and coarrays into real, running Fortran with the same project-driven spirit as this book. Tier 1.
- Metcalf, Reid, and Cohen, Modern Fortran Explained (Oxford University Press). The definitive language reference; its treatment of parallelism and how OpenMP interacts with modern Fortran arrays and procedures is the place to settle a fine point of semantics. Tier 1.
- Chapman, Jost, and van der Pas, Using OpenMP: Portable Shared Memory Parallel Programming (MIT Press). A thorough, example-led treatment of OpenMP itself (C/C++/Fortran) by authors close to the standard; strong on scheduling, data scoping, and performance. Tier 2 (verify the edition; a newer "Using OpenMP — The Next Step" covers tasks and SIMD).
Free and online
fortran-lang.org— the OpenMP and parallel-programming tutorials. Current, community-maintained introductions to!$ompfrom Fortran, with runnable examples and the Discourse forum for questions. Tier 1.- The GCC / gfortran OpenMP documentation. Which OpenMP version gfortran supports, the
-fopenmpflag, theomp_libmodule, and gfortran-specific notes. The reference for the compiler you are using. Tier 1. - Compiler Explorer (
godbolt.org). Selectgfortran, add-fopenmp -O3, and watch how a!$omp parallel doand an!$omp simdchange the generated code. By now (Chapter 27) you can read enough of it to see the vectorization. Tier 1.
On the ideas around it
- The OpenMP and MPI specifications, read side by side (
openmp.org,mpi-forum.org). The best way to feel the shared-memory vs. distributed-memory split of Chapter 31: OpenMP shares variables and hides the threads; MPI (Chapter 34) passes messages and exposes every process. Tier 1.
Suggested order
- Skim the OpenMP cheat sheet now, then read the specification's Examples for
parallel do,reduction, andschedule— the constructs of §33.2–33.4. - Keep Curcic open as you extend the solver; it mirrors this part's serial-to-parallel progression.
- Bookmark the gfortran OpenMP docs and Godbolt for the practical "does my compiler do what I think?" questions.
- When you need the exact rule for a tricky scoping case, go to the specification itself — for OpenMP, the primary source really is the friendliest reference.