- Chapter 17 (“Coarrays”) of Modern Fortran Explained: Incorporating Fortran 2018, by Michael Metcalf, John Reid, and Malcolm Cohen, Oxford University Press.
- Parallel Programming with Co-arrays, by Robert W. Numrich, Chapman and Hall/CRC.
Summary
- Fortran refers to any parallel process as an image, whether it’s a physical core or an operating system thread.
- All images execute the same copy of the program in parallel, independent from one another.
- The built-in functions
this_imageandnum_imagesallow you to identify different images. - Use these functions in
ifbranches to control the flow of the program for each image. - Coarrays are the key mechanism for copying data between images.
- Use the
syncallstatement to synchronize all images. - The higher the ratio of computation versus communication between images, the more efficient your parallel program will be.
Further reading