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 to schedule again?" Keep it beside you. Tier 1.

Books

Free and online

  • fortran-lang.org — the OpenMP and parallel-programming tutorials. Current, community-maintained introductions to !$omp from Fortran, with runnable examples and the Discourse forum for questions. Tier 1.
  • The GCC / gfortran OpenMP documentation. Which OpenMP version gfortran supports, the -fopenmp flag, the omp_lib module, and gfortran-specific notes. The reference for the compiler you are using. Tier 1.
  • Compiler Explorer (godbolt.org). Select gfortran, add -fopenmp -O3, and watch how a !$omp parallel do and an !$omp simd change 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

  1. Skim the OpenMP cheat sheet now, then read the specification's Examples for parallel do, reduction, and schedule — the constructs of §33.2–33.4.
  2. Keep Curcic open as you extend the solver; it mirrors this part's serial-to-parallel progression.
  3. Bookmark the gfortran OpenMP docs and Godbolt for the practical "does my compiler do what I think?" questions.
  4. 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.