Co-array Fortran is a small extension to Fortran 95. It is a simple, explicit notation for data decomposition, such as that often used in message-passing models, expressed in a natural Fortran-like syntax. The syntax is architecture-independent and may be implemented not only on distributed memory machines but also on shared memory machines and even on clustered machines.

The ISO Fortran Committee decided in May 2005 to include co-arrays in the next revision of the Fortran standard.

A full description of the original co-array syntax appeared in Numrich and Reid (1998), Co-Array Fortran for Parallel Programming, ACM Fortran Forum, volume **17**, no 2, pp 1-31 (get from ACM portal here). It is also available as a Rutherford Lab report here. Since some of the details of the version adopted by WG5 differ from the 1998 version, a new description recently appeared in Numrich and Reid (2005), Co-arrays in the next Fortran Standard, ACM Fortran Forum, volume **24**, no 2, pp 4-17 (get from ACM portal here). It is also available as WG5 paper N1642. The proposal itself is item UK-001 in WG5 document N1626.

For more information see:

- A short introduction to Co-Array Fortran
- The complete (1998) language definition
- New features since 1998
- I/O in Co-Array Fortran
- Why not just use MPI?
- A subset easy to translate into OpenMP Fortran
- A Subset Co-Array Fortran to OpenMP Fortran translator

Implementations:

- Co-array syntax has been a supported feature of Cray Fortran 90 since release 3.1 (via the -Z compiler option on Cray T3E and Cray X1). See chapeter 9 of Cray's Fortran Language Reference Manual, Volume 3 (S-3694-54), available on-line here. or see the ARSC T3E User's Newsletter No. 153 for a short introduction. The Army HPC Research Center (AHPCRC) is holding a hands-on Workshop on Co-Array Fortran from 24-26 October 2005. This is free, and includes access to a Cray X1, but is limited to 20 participants.
- The Los Alamos Computer Science Institute (LACSI), at Rice University, is working on an open-source, portable, retargetable, high-quality Co-Array Fortran compiler suitable for use with production codes. Their compiler uses the Open64/SL Fortran 90 source to source infrastructure to translate Co-Array Fortran into Fortran 90 plus calls to ARMCI or GASNet, two multi-platform libraries for one-sided communication. It is available for (i.e. has been tested on) SGI Origin 2000 and Altix 3000, Compaq Alphaserver SC (Quadrics switch), Linux Itanium 2 with Myrinet 2000 or Quadrics II switches, and Linux Pentium with Ethernet.
- The Subset Co-Array Fortran translator is not a compiler, but almost all Co-Array Fortran programs require only minor style changes to allow the translator to produce an equivalent SPMD OpenMP Fortran 90/95 program. OpenMP Fortran compilers are available for several platforms. Since Co-Array Fortran is applicable to a wider range of machine architectures than OpenMP Fortran, programs should be writen and maintained in Subset Co-Array Fortran and translated into OpenMP as part of the compilation process.

Example Co-Array Fortran programs:

- An illustration of domain decomposition using a simple Jacobi Helmholtz's equation solver is here in full. For more information on linear equation solvers, see the Templates on-line book.
- Details of a class library by Bob Numrich are here.
- The reference implementation of Co-Array intrinsics for OpenMP is bundled with the caf2omp translator and several Subset Co-Array Fortran programs (including the Jacobi solver) it successfully translates into OpenMP Fortran.
- The user-level implementation of the Co-Array intrinsics missing from CF90 3.1 includes the same set of Co-Array Fortran programs modified for the T3E. The source code for
`sync_team`illustrates how to write your own synchronization routine in Co-Array Fortran. - Appendix 3 of Numrich and Reid (1998) shows how
`sync_memory`can be used to implement`sync_all`and`sync_team`. Here is an expanded version of the module. Compare it to the similar CF90 module.

There are several papers describing co-array syntax and applications written using it. These do not necessarily conform to the latest language definition, but the changes required for conformance are relatively minor.

- Definition of the F-- Extension to Fortran 90
- F--: A Simple Parallel Extension to Fortran 90
- F--: A Parallel Extension to Cray Fortran
- Writing a Multigrid Solver Using Co-Array Fortran
- A Parallel 'Class Library' for Co-Array Fortran
- An Algebraic Theory of Parallel Algorithms with examples from Co-Array Fortran
- SPMD OpenMP vs MPI for Ocean Models (uses the CAF2OMP translator)
- A Comparison of Co-Array Fortran and OpenMP Fortran for SPMD Programming
- A Multi-platform Co-Array Fortran Compiler (one of several pubs/presentations on Rice's web page here)
- The LINPACK Benchmark in Co-Array Fortran

Co-Array Fortran is an example of a Partitioned Global Address Space language. Just as Co-Array Fortran is based on Fortran, UPC and Titanium are PGAS extensions to C and Java respectively. A Workshop on **New Methods for Developing Peta-scalable Codes** was held at Pittsburgh Supercomputing Center On May 3-4, 2004. It included presentations (available at the workshop web site) on Co-Array Fortran, UPC and Tritium. A recent Army HPC Research Center (AHPCRC) Bulletin (2004-Vol 14 No. 4) is devoted to this subject. AHPCRC and DARPA recently sponsored the **Parallel Global Address Space (PGAS) Programming Models Conference**. This was on partitioned PGAS languages, like Co-Array Fortran, and on new higher-level parallel languages, that provide a non-partitioned global view of objects, which are under development by DARPA's HPCS program. AHPCRC is also holding a hands-on Workshop on Co-Array Fortran from 24-26 October 2005. This is free but limited to 20 participants.

UPC (Unified Parallel C) is a parallel extension to C, similar in concept to Co-Array Fortran. See the book: "UPC: Distributed Shared Memory Programming"; by Tarek El-Ghazawi, William Carlson, Thomas Sterling, and Katherine Yelick; ISBN: 0-471-22048-5; Published by John Wiley and Sons - May, 2005.

Titanium is another Partitioned Global Address Space language, based on Java. It uses the same low level network layer, GASNet, as the Berkeley UPC compiler (one of several available UPC implementations). GASNet can also be used by Rice's Co-Array Fortran compiler.

Co-Array Fortran greatly simplifies SPMD parallel programming, but a typical single processor program will still require modification - perhaps at the algorithmic level. General references on parallel programming include:

These pages are maintained by Alan Wallcraft. Please send e-mail for more information, or to suggest additions/changes. Of particular interest are new links to programs or papers using Co-Array Fortran.