Fortran 2008: what s in it for high-performance computing

Similar documents
Parallel Programming in Fortran with Coarrays

Fortran Coarrays John Reid, ISO Fortran Convener, JKR Associates and Rutherford Appleton Laboratory

Co-arrays to be included in the Fortran 2008 Standard

Report from WG5 convener

Technical Report on further interoperability with C

Lecture V: Introduction to parallel programming with Fortran coarrays

Coarrays in the next Fortran Standard

Coarrays in the next Fortran Standard

Programming for High Performance Computing in Modern Fortran. Bill Long, Cray Inc. 17-May-2005

Parallel Programming with Coarray Fortran

Migrating A Scientific Application from MPI to Coarrays. John Ashby and John Reid HPCx Consortium Rutherford Appleton Laboratory STFC UK

More Coarray Features. SC10 Tutorial, November 15 th 2010 Parallel Programming with Coarray Fortran

Appendix D. Fortran quick reference

Advanced Features. SC10 Tutorial, November 15 th Parallel Programming with Coarray Fortran

New Programming Paradigms: Partitioned Global Address Space Languages

ISO/IEC : TECHNICAL CORRIGENDUM 2

Technical Specification on further interoperability with C

Proceedings of the GCC Developers Summit

Parallel Programming without MPI Using Coarrays in Fortran SUMMERSCHOOL

Implementation and Evaluation of Coarray Fortran Translator Based on OMNI XcalableMP. October 29, 2015 Hidetoshi Iwashita, RIKEN AICS

Parallel Programming Features in the Fortran Standard. Steve Lionel 12/4/2012

NAGWare f95 Recent and Future Developments

Information technology Programming languages Fortran Part 1: Base language

Chapter 4. Fortran Arrays

Fortran 2003 and Beyond. Bill Long, Cray Inc. 17-May-2005

Additional Parallel Features in Fortran An Overview of ISO/IEC TS 18508

Evolution of Fortran. Presented by: Tauqeer Ahmad. Seminar on Languages for Scientific Computing

Morden Fortran: Concurrency and parallelism

Coarray Fortran: Past, Present, and Future. John Mellor-Crummey Department of Computer Science Rice University

Towards Exascale Computing with Fortran 2015

Introduction to Parallel Programming

Current Developments in Fortran Standards. David Muxworthy 15 June 2012

Parallel Programming Languages. HPC Fall 2010 Prof. Robert van Engelen

Fortran's Relevance Today and in the Future. Peter Crouch, Chairman Fortran Specialist Group Member Groups Convention 5 April 2011

PGI Accelerator Programming Model for Fortran & C

Parallel and High Performance Computing CSE 745

Fortran Bill Long, Cray Inc. 21-May Cray Proprietary

A Comparison of Co-Array Fortran and OpenMP Fortran for SPMD Programming

An Open64-based Compiler and Runtime Implementation for Coarray Fortran

TS Further Interoperability of Fortran with C WG5/N1917

The Complete Compendium on Cooperative Computing using Coarrays. c 2008 Andrew Vaught October 29, 2008

The new features of Fortran 2003

NAGWare f95 and reliable, portable programming.

Control Abstraction. Hwansoo Han

Co-array Fortran for parallel programming

Dangerously Clever X1 Application Tricks

Introduction to the PGAS (Partitioned Global Address Space) Languages Coarray Fortran (CAF) and Unified Parallel C (UPC) Dr. R. Bader Dr. A.

PACKAGE SPECIFICATION HSL 2013

IMPLEMENTATION AND EVALUATION OF ADDITIONAL PARALLEL FEATURES IN COARRAY FORTRAN

First Experiences with Application Development with Fortran Damian Rouson

Co-Array Fortran for parallel programming

Co-array Fortran Performance and Potential: an NPB Experimental Study. Department of Computer Science Rice University

Index. classes, 47, 228 coarray examples, 163, 168 copystring, 122 csam, 125 csaxpy, 119 csaxpyval, 120 csyscall, 127 dfetrf,14 dfetrs, 14

Fortran 90 - A thumbnail sketch

PACKAGE SPECIFICATION HSL 2013

Verification of Fortran Codes

A Coarray Fortran Implementation to Support Data-Intensive Application Development

DRAFT DRAFT DRAFT ISO/IEC JTC 1/SC 22 N0703. Élément introductif Élément principal Partie n: Titre de la partie. Date: ISO/IEC TR

Compiler Support for the Fortran 2003 and 2008 Standards Revision 17

ISO/IEC JTC 1/SC 22/OWGV N 0220

Compiler support for Fortran 2003 and 2008 standards Ian Chivers & Jane Sleightholme Fortranplus

A Comparison of Unified Parallel C, Titanium and Co-Array Fortran. The purpose of this paper is to compare Unified Parallel C, Titanium and Co-

Programming Tips for Plugins

Parallelization of Sequential Programs

Fortran Coding Standards and Style

Programming techniques for heterogeneous architectures. Pietro Bonfa SuperComputing Applications and Innovation Department

PGI Fortran & C Accelerator Programming Model. The Portland Group

C, C++, Fortran: Basics

Titanium. Titanium and Java Parallelism. Java: A Cleaner C++ Java Objects. Java Object Example. Immutable Classes in Titanium

Chapter 9 :: Subroutines and Control Abstraction

Introduction to OpenCL!

CS4961 Parallel Programming. Lecture 16: Introduction to Message Passing 11/3/11. Administrative. Mary Hall November 3, 2011.

Chapter 3. Fortran Statements

Programming with MPI

Fortran Annex to TR 24772, Guidance to Avoiding Vulnerabilities in Programming Languages through Language Selection and Use

The new features of Fortran 2008

Unified Parallel C (UPC)

Examining the Code. [Reading assignment: Chapter 6, pp ]

Chapter 8 :: Composite Types


Brook Spec v0.2. Ian Buck. May 20, What is Brook? 0.2 Streams

SINGLE-SIDED PGAS COMMUNICATIONS LIBRARIES. Basic usage of OpenSHMEM

A Coarray Fortran Implementation to Support Data-Intensive Application Development

Model Viva Questions for Programming in C lab

Extrinsic Procedures. Section 6

Introduction to OpenMP. Tasks. N.M. Maclaren September 2017

Review More Arrays Modules Final Review

Compiler Support for the Fortran 2003 and 2008 Standards Revision 21

KOM3191 Object Oriented Programming Dr Muharrem Mercimek OPERATOR OVERLOADING. KOM3191 Object-Oriented Programming

OpenMP Algoritmi e Calcolo Parallelo. Daniele Loiacono

Parallel Programming Models. Parallel Programming Models. Threads Model. Implementations 3/24/2014. Shared Memory Model (without threads)

Implementing the Standards... including Fortran 2003

Advanced Fortran Programming

Comparing OpenACC 2.5 and OpenMP 4.1 James C Beyer PhD, Sept 29 th 2015

Declaring Pointers. Declaration of pointers <type> *variable <type> *variable = initial-value Examples:

An Open-Source Compiler and Runtime Implementation for Coarray Fortran

Portable, MPI-Interoperable! Coarray Fortran

John Mellor-Crummey Department of Computer Science Center for High Performance Software Research Rice University

OpenACC 2.6 Proposed Features

Chapter 3 Parallel Software

Transcription:

Fortran 2008: what s in it for high-performance computing John Reid, ISO Fortran Convener, JKR Associates and Rutherford Appleton Laboratory Fortran 2008 has been completed and is about to be published. The biggest change is the addition of coarrays, summarized at RAPS 2008. The aim of this talk is to remind you about coarrays and explain other additions that have been designed for enhanced performance. RAPS Workshop, ECMWF, Reading, 3 November 2010.

Summary of coarray model SPMD Single Program, Multiple Data Replicated to a number of images (probably as executables) Number of images fixed during execution Each image has its own set of variables Coarrays are like ordinary variables but have second set of subscripts in [ ] for access between images; have same bounds on all images Images mostly execute asynchronously Programmer responsible for synchronization: sync all, sync images, critical, lock Intrinsics: this_image, num_images, image_index Full summary: WG5 N1824 (Google WG5 N1824)

Examples of coarray syntax real :: r[*], s[0:*]! Scalar coarrays real,save :: x(n)[*]! Array coarray type(u),save :: u2(m,n)[np,*]! Coarrays always have assumed! cosize (equal to number of images) real :: t! Local integer p, q, index(n)! variables : t = s[p] x(:) = x(:)[p]! Reference without [] is to local object x(:)[p] = x(:) u2(i,j)%b(:) = u2(i,j)[p,q]%b(:)

Synchronization With a few exceptions, the images execute asynchronously. If syncs are needed, the user supplies them explicitly. Barrier on all images sync all Wait for others sync images(image-set) Limit execution to one image at a time critical : end critical Limit execution in a more flexible way lock(lock_var[6]) p[6] = p[6] + 1 unlock(lock_var[6]) These are known as image control statements.

Execution segments On an image, the sequence of statements executed before the first image control statement or between two of them is known as a segment. The image control statements produce a partial ordering of the segments: for any two segments, one may precede the other or they may be unordered. Important rule: if a variable is defined in a segment, it must not be referenced, defined, or become undefined in a another segment unless the segments are ordered.

Dynamic coarrays Only dynamic form: the allocatable coarray. real, allocatable :: a(:)[:], s[:,:] : allocate ( a(n)[*], s[-1:p,0:*] ) All images synchronize at an allocate or deallocate statement so that they can all perform their allocations and deallocations in the same order. The bounds, cobounds, and length parameters must not vary between images. A coarray is not allowed to be a pointer.

Dummy arguments A coarray may be associated as an actual argument with a non-coarray dummy argument (nothing special about this). A coindexed object (with square brackets) may be associated as an actual argument with a noncorray dummy argument. Copy-in copy-out is to be expected. A dummy argument may be a coarray. The actual argument must also be a coarray and there are rules to ensure that copy-in copy-out is never needed.

Structure components A coarray may be of a derived type with allocatable or pointer components. Pointers must have targets in their own image: q => z[i]%p! Not allowed allocate(z[i]%p)! Not allowed Provides a simple but powerful mechanism for cases where the size varies from image to image, avoiding loss of optimization.

Input/output Default input (*) is available on image 1 only. Default output (*) and error output are available on every image. The files are separate, but their records will be merged into a single stream or one for the output files and one for the error files. The open statement connects a file to a unit on the executing image only. Whether a file on one image is the same as a file with the same name on another image is processor dependent.

Planned extensions The following features were part of the proposal but have moved into a planned Technical Report on Enhanced Parallel Computing Facilities : 1. The collective intrinsic subroutines. 2. Teams and features that require teams. 3. The notify and query statements. 4. File connected on more than one image, unless default output or default error.

Advantages of coarrays Easy to write code the compiler looks after the communication References to local data are obvious as such. Easy to maintain code more concise than MPI and easy to see what is happening Integrated with Fortran type checking, type conversion on assignment,... The compiler can optimize communication Local optimizations still available Does not make severe demands on the compiler, e.g. for coherency. A subset has been implemented by Cray for some ten years. Coarrays have been added to the g95 compiler, are being added to gfort, and for Intel are at the top of our development list.

Enhanced module facilities (TR) If a huge module is split into several modules: Solution: Internal parts exposed Any change leads to compilation cascade Submodules contain definitions of procedures whose interfaces are in the module itself Users have access these procedures, but no recompilation of user code needed if submodule changes Submodules have full access by host association Submodules can be compiled independently

Enhanced performance contiguous attribute Arrays need not be contiguous in Fortran, e.g. the section a(1:n:2). Can lead to performance loss for pointer and assumedshape arrays. Users can now promise not to let this happen. do concurrent Iterations of the loop are independent. Allows low-level optimizations such as vectorization.

References Reid, John (2010). Coarrays in the next Fortran Standard. ISO/IEC/JTC1/SC22/ WG5 N1824, see ftp://ftp.nag.co.uk/sc22wg5/n1801-n1850 Reid, John (2010). The new features of Fortran 2008. ISO/IEC/JTC1/SC22/ WG5 N1828, see ftp://ftp.nag.co.uk/sc22wg5/n1801-n1850 WG5(2010). FDIS revision of the Fortran Standard. ISO/IEC/JTC1/SC22/ WG5 N1830, see ftp://ftp.nag.co.uk/sc22wg5/n1801-n1850