Co-array Fortran

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

Coarray a Fortran program is interpreted as if they were replicated n times and all copies would be executed asynchronously. Each copy has its own data objects and image (" image" ) called. The field syntax of Fortran is extended by square brackets containing the image index, which can be accessed as the data of another image ( the process).

The Co -array Fortran extension has been around since the 1990s and it is in some Fortrancompilern support such as the Cray ( since version 3.1). Since then Coarrays are part of Fortran 2008, increasing the number of implementation; the first open source compiler that Coarrays is supported according to the Fortran 2008 standard G95.

Example

Program Hallo_Welt    implicit none    integer :: i! Local variables    character ( len = 20) :: name [* ]! scalar Coarray   ! Note: "name" is the local variable whereas "name [ ] "   ! on the variable of another process ( Image) accesses     ! Communicate with other users on Image 1    if ( this_image () == 1 ) then      write ( *, ' ( a) ', advance = 'no ') ' Enter your name '      read ( *, ' ( a) ' ) name       ! Distributing the information to the other processes      do i = 2, num_images ()        name [ i] = name      end do    end if      sync all! Barrier so that the data is really there     ! Input and output of all processes    write ( *, ' (3a, i0 ) ') 'Hello', trim (name), ' Image of ' this_image () end program Hallo_Welt see also

Credentials

  • ISO Fortran Committee
  • Coarrays in the next Fortran Standard
  • Rationale for Co - arrays in Fortran 2008
  • Final Draft International Standard ( FDIS ) of the ISO Fortran 2008 standard ( 7.9MB, 621 pages)
  • Co - Array Fortran homepage ( Warning: Obsolete syntax)
  • Programming language
194975
de