Fortran 2008 coarrays

Fortran 2008 coarrays
复制标题

DOI:
10.1145/2754942.2754944
复制
发表时间:
2015-04
期刊:
ACM Sigplan Fortran Forum
影响因子:
--
通讯作者:
A. Shterenlikht;L. Margetts;L. Cebamanos;D. Henty
A. Shterenlikht;L. Margetts;L. Cebamanos;D. Henty
中科院分区:
其他
文献类型:
--
作者:
A. Shterenlikht;L. Margetts;L. Cebamanos;D. Henty

文献摘要

相似文献

共数组是用于SIMD类型并行编程的Fortran 2008标准功能。运行时环境在多个处理器上启动多个相同的协阵列程序的可执行映像,这些处理器可以是实际的物理处理器或线程。每个映像都有一个唯一的编号及其私有地址空间。普通变量是图像的私有变量。共数组变量可用于从任何其他映像进行读/写访问。共阵列通信是“单面”类型的,即从Imagea到图像B的远程调用不需要伴随图像B中的相应调用。这一特征使共阵列编程比MPI简单得多。该标准提供了同步内部机制,以帮助避免竞争条件或死锁。任何普通变量都可以变成一个协数组--标量、数组、内部或派生数据类型、指针、可分配对象都是允许的。共数组可以在过程中声明并传递给过程。因此,共阵列非常灵活,可用于多种目的。例如,来自所有或部分图像的共阵列的集合可以被认为是一个大的单个阵列。这恰恰与MPI程序中典型的模型分区逻辑相反。共阵列程序也可以利用功能并行性,通过将不同的任务委托给独立的图像或图像组来实现。Coarray集合有望成为下一个版本的Fortran标准的一部分。共阵列编程的一个主要悬而未决的问题是在Fortran中缺乏标准的并行I/O设施。本文给出了几个简单的完全共阵列程序,并与其他并行技术--OpenMP、MPI和Fortran 2008固有的“DO并发”--进行了比较。给出了图像间的通信方式和数据传输。给出了一个可扩展到32k核的材料微结构模拟共阵列程序的实例。讨论了MPI/共阵I/O混合编程,并用有限元/细胞自动机(CAF)多尺度模型进行了说明。本文最后描述了2015年Fortran标准中预期的新的Coarray语言功能,并简要列出了Coarray语言资源
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 (CAFÃ ) 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