Co-array Fortran

Co-array Fortran
Coarray Fortran
Paradigm(s) multi-paradigm: parallel, message passing, imperative (procedural, object-oriented), structured
Designed by Robert Numrich and John Reid
Developer PL22.3 Fortran Committee
Stable release Fortran 2008 (ISO/IEC 1539-1:2010)
Typing discipline strong, static
Major implementations Cray, g95, gfortran, Rice (CAF 2.0), Intel
Influenced by Fortran
OS Cross-platform

Co-array Fortran (CAF), formerly known as F--, is an extension of Fortran 95/2003 for parallel processing created by Robert Numrich and John Reid in 1990s. The Fortran 2008 standard (ISO/IEC 1539-1:2010) now includes coarrays (spelt without hyphen), as decided at the May 2005 meeting of the ISO Fortran Committee; the syntax in the Fortran 2008 standard is slightly different from the original CAF proposal.

A CAF program is interpreted as if it were replicated a number of times and all copies were executed asynchronously. Each copy has its own set of data objects and is termed an image. The array syntax of Fortran is extended with additional trailing subscripts in square brackets to provide a concise representation of references to data that is spread across images.

The CAF extension has been available for a long time and was implemented in some Fortran compilers such as those from Cray (since release 3.1). Since the inclusion of coarrays in the Fortran 2008 standard, the number of implementation is growing. The first open-source compiler which implemented coarrays as specified in the Fortran 2008 standard for Linux architectures is G95.

Contents

Example

program Hello_World
  implicit none
  integer :: i  ! Local variable
  character(len=20) :: name[*] ! scalar coarray, one "name" for each image.
  ! Note: "name" is the local variable while "name[<index>]" accesses the
  ! variable in a specific image; "name[this_image()]" is the same as "name".
 
  ! Interact with the user on Image 1; execution for all others pass by.
  if (this_image() == 1) then   
    write(*,'(a)',advance='no') 'Enter your name: '
    read(*,'(a)') name
 
    ! Distribute information to other images
    do i = 2, num_images()
      name[i] = name
    end do
  end if
 
  sync_all ! Barrier to make sure the data have arrived.
 
  ! I/O from all images, executing in any order, but each record written is intact. 
  write(*,'(3a,i0)') 'Hello ',trim(name),' from image ', this_image()
end program Hello_world

An alternate perspective

A group at Rice University is pursuing an alternate vision of coarray extensions for the Fortran language. Their perspective is that the Fortran 2008 standard committee's design choices were shaped more by the desire to introduce as few modifications to the language as possible than to assemble the best set of extensions to support parallel programming. They don't believe that the set of extensions agreed upon by the committee are the right ones. In their view, both Numrich and Reid's original design and the coarray extensions proposed for Fortran 2008, suffer from the following shortcomings:

  • There is no support for processor subsets; for instance, coarrays must be allocated over all images.
  • The coarray extensions lack any notion of global pointers, which are essential for creating and manipulating any kind of linked data structure.
  • Reliance on named critical sections for mutual exclusion hinders scalable parallelism by associating mutual exclusion with code regions rather than data objects.
  • Fortran 2008's sync images statement doesn't provide a safe synchronization space. As a result, synchronization operations in user's code that are pending when a library call is made can interfere with synchronization in the library call.
  • There are no mechanisms to avoid or tolerate latency when manipulating data on remote images.
  • There is no support for collective communication.

To address these shortcomings, the Rice University group is developing a clean-slate redesign of the Coarray Fortran programming model. Rice's new design for Coarray Fortran, which they call Coarray Fortran 2.0, is an expressive set of coarray-based extensions to Fortran designed to provide a productive parallel programming model. Compared to Fortran 2008, Rice's new coarray-based language extensions include some additional features:

  • process subsets known as teams, which support coarrays, collective communication, and relative indexing of process images for pair-wise operations,
  • topologies, which augment teams with a logical communication structure,
  • dynamic allocation/deallocation of coarrays and other shared data,
  • team-based coarray allocation and deallocation,
  • global pointers in support of dynamic data structures,
  • support for latency hiding and avoidance, and
    • asynchronous copies,
    • asynchronous collective operations, and
    • function shipping.
  • enhanced support for synchronization for fine-grain control over program execution.
    • safe and scalable support for mutual exclusion, including locks and lock sets,
    • events, which provide a safe space for point-to-point synchronization,
    • cofence, which forces local completion of asynchronous operations,
    • finish, a barrier-like SPMD construct that forces completion of asynchronous operations across a team,

See also

References


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Co-array Fortran — Coarray Fortran Paradigmen: prozedural, imperativ, strukturiert, objektorientiert, parallel Entwickler: Robert Numrich and John Reid Aktuelle Version: Fortran 2008 (ISO/IEC 1539 1:2010)  …   Deutsch Wikipedia

  • Fortran — Infobox programming language name = Fortran caption = The Fortran Automatic Coding System for the IBM 704 (October 15, 1956), the first Programmer s Reference Manual for Fortran paradigm = multi paradigm: procedural, imperative, structured,… …   Wikipedia

  • Fortran language features — This is a comprehensive overview of features of the Fortran 95 language, the version supported by almost all existing Fortran compilers. Old features that have been superseded by new ones are not described few of those historic features are used… …   Wikipedia

  • Array slicing — In computer programming, array slicing is an operation that extracts certain elements from an array and packages them as another array, possibly with different number of indices (or dimensions) and different index ranges. Two common examples are… …   Wikipedia

  • Array data type — Not to be confused with Array data structure. In computer science, an array type is a data type that is meant to describe a collection of elements (values or variables), each selected by one or more indices that can be computed at run time by the …   Wikipedia

  • Array programming — In computer science, array programming languages (also known as vector or multidimensional languages) generalize operations on scalars to apply transparently to vectors, matrices, and higher dimensional arrays.Array programming primitives… …   Wikipedia

  • Array — In computer science an array [Paul E. Black, array , in Dictionary of Algorithms and Data Structures , Paul E. Black, ed., U.S. National Institute of Standards and Technology. 26 August 2008 (accessed 10 September 2008).… …   Wikipedia

  • Array Theory — From [ftp://ftp.nial.com/nial.com/Papers/Papers.zip Nial Papers] : Array Theory is primarily a theory about the definition and manipulation of array data objects. Every data object in the theory is an array, even numbers and characters, which are …   Wikipedia

  • Comparison of programming languages (array) — Programming language comparisons General comparison Basic syntax Basic instructions Arrays Associative arrays String operations …   Wikipedia

  • ICL Distributed Array Processor — The Distributed Array Processor (DAP) produced by International Computers Limited (ICL) was the world s first commercial massively parallel computer. The original paper study was complete in 1972 and building of the prototype began in 1974. The… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”