Research Article

Using Coarrays to Parallelize Legacy Fortran Applications: Strategy and Case Study

Table 1

Modernization steps: horizontal lines indicate partial ordering.

Step Details

1Set up automated builds via CMake1 and version control via Git2.

2Convert fixed- to free-source format via “convert.f90” by Metcalf3.
3Replace goto with do while for main loop termination.
4Enforce type/kind/rank consistency of arguments and return values by wrapping all procedures in a module.
5Eliminate implicit typing.
6Replace data statements with parameter statements.
7Replace write-access to common blocks with module variables.

8Replace keyboard input with default initializations.
9Set up automated, extensible tests for accuracy and performance via OOP and CTest1.

10Make all procedures outside of the main program pure.
11Eliminate actual/dummy array shape inconsistencies by passing array subsections to assumed-shape arrays.
12Replace static memory allocation with dynamic allocation.

13Replace loops with array assignments.
14Expose greater parallelism by unrolling the nested loops in the particle set-up.
15Balance the work distribution by spreading particles across images during set-up.
16Exploit a Fortran 2015 collective procedure to gather statistics.
17Study and tune performance with TAU4.

http://www.cmake.org/.
2http://git-scm.com/.
ftp://ftp.numerical.rl.ac.uk/pub/MandR/convert.f90.
4http://tau.uoregon.edu/.