Parallelize a Fortran array model with coarrays
8 steps · about 2 h 50 min · Intermediate
- Orient yourself to coarray execution (guide, OpenCoarrays documentation, 30 min)
Understand images, coarrays and the single-program multiple-data execution model before changing code.
- Configure a coarray build (guide, GNU Fortran documentation, 25 min)
Choose a supported compiler mode and learn how the executable is launched across images.
- Declare and run distributed arrays (guide, GNU Fortran documentation, 25 min)
Configure shared-memory coarrays and inspect local and remote portions without confusing array and image indices.
- Partition work by image (reference, GNU Fortran documentation, 15 min)
Assign each image a deterministic slice of the model using its stable index.
- Adapt to the image count (reference, GNU Fortran documentation, 15 min)
Make the partition work for one image and for several without hard-coded process counts.
- Map image coordinates deliberately (reference, GNU Fortran documentation, 20 min)
Relate cosubscripts to image indices before placing synchronization around remote reads.
- Reduce partial results (reference, GNU Fortran documentation, 20 min)
Combine per-image contributions with a standard collective and define which images need the result.
- Fail the parallel check clearly (reference, GNU Fortran documentation, 20 min)
Understand collective error termination before using an intentional diagnostic on a baseline mismatch.