Fortran 2008 Coarrays

Anton Shterenlikht, Lee Margetts, Luis Cebamanos, David Henty

    Research output: Contribution to journalArticlepeer-review


    Coarrays are a Fortran 2008 standard feature intended for SIMD type parallel programming. The runtime environment starts a number of identical executable images of the coarray program, on multiple processors, which could be actual physical processors or threads. Each image has a unique number and its private address space. Ordinary variables are private to an image. Coarray variables are available for read/write access from any other image. Coarray communications are of "single sided" type, i.e. a remote call from imageA to image B does not need to be accompanied by a corresponding call in image B. This feature makes coarray programming a lot simpler than MPI. The standard provides synchronisation intrinsics to help avoid race conditions or deadlocks. Any ordinary variable can be made into a coarray - scalars, arrays, intrinsic or derived data types, pointers, allocatables are all allowed. Coarrays can be declared in, and passed to, procedures. Coarrays are thus very flexible and can be used for a number of purposes. For example a collection of coarrays from all or some images can be thought of as a large single array. This is precisely the inverse of the model partitioning logic, typical in MPI programs. A coarray program can exploit functional parallelism too, by delegating dis- tinct tasks to separate images or teams of images. Coarray collectives are expected to become a part of the next version of the Fortran standard. A major unresolved problem of coarray programming is the lack of standard parallel I/O facility in Fortran. In this paper several simple complete coarray programs are shown and compared to alternative parallel technologies - OpenMP, MPI and Fortran 2008 intrinsic "do concurrent". Inter image communication patterns and data transfer are illustrated. An example of a materials microstructure simulation coarray program scaled up to 32k cores is shown. Problems with coarray I/O at this scale are highlighted and addressed with the use of MPI-I/O. A hybrid MPI/coarray programming is discussed and illustrated with a finite element/cellular automata (CAFE‰) multi-scale model. The paper completes with a description of the new coarray language features, expected in the 2015 Fortran standard, and with a brief list of coarray resources.
    Original languageEnglish
    Pages (from-to)10-30
    Number of pages20
    JournalACMSIGPLAN Fortran Forum
    Issue number1
    Publication statusPublished - 3 Apr 2015


    • Fortran
    • Fortran 2008
    • Coarray Fortran
    • Cellular Automata
    • Materials
    • Microstructure


    Dive into the research topics of 'Fortran 2008 Coarrays'. Together they form a unique fingerprint.
    • STFC Hartree Centre

      Lee Margetts (Visiting researcher)

      27 Jun 20161 Jul 2016

      Activity: External visiting positions or secondmentsVisiting an external academic institutionResearch

    Cite this