98
H. Iwashita and M. Nakao
merged into the global-view XMP language and must exhibit high performance,
comparable to that of MPI.
The Omni XMP compiler is an open-source implementation developed at RIKEN
and the University of Tsukuba [4]. The kernel of the Omni XMP compiler is a
source-to-source compiler that converts an XMP program into a Fortran program
by calling a runtime library. The coarray translator has been implemented on the
Omni XMP compiler. Since the images are mapped one-to-one to XMP nodes, each
image was implemented as a process, and the definition and reference to coarrays
were implemented as inter-node one-sided communications.
This chapter describes the techniques used in the coarray compiler and the
runtime library, and a comparison to MPI message passing. The remainder of this
chapter is organized as follows. Section 2 introduces the requirements of the coarray
features. Section 3 describes the implementation used to solve the requirements, and
Sect. 4 evaluates the performance and productivity of coarray programs. Related
research is described in Sect. 5, and Sect. 6 concludes this chapter.
2 Requirements from Language Specifications
The XMP Fortran language specification [1] supports many of the coarray features
defined in the Fortran 2008 standard [2], and intrinsic procedures CO_SUM,
CO_MAX, CO_MIN, and CO_BROADCAST defined in the Fortran 2018 standard [3]
are supported. In addition, the XMP C language specification was extended to
support coarray features.
This section introduces the coarray features and what is required of the compiler
in order to implement the coarray features.
2.1 Images Mapped to XMP Nodes
In the Fortran standard, an image is defined as an instance of a program. Each
image executes the same program and has its own individual data. Each image has
a different image index k. While the Fortran standard itself does not specify where
each image is executed, XMP specifies that images are mapped to executing nodes
on a one-to-one basis. Therefore, image k is always executed on executing node k,
where 1 ≤ k ≤ n, and n is the number of images as well as the number of executing
nodes. Since each MPI rank number of MPI_COMM_WORLD (0-origin) is always
mapped to an XMP node number in order, image k corresponds to rank (k − 1).
Note that the executing nodes can be a subset of the entire (initial) node set. For
example, two distinct node sets can execute two coarray subprograms concurrently.
The first executing images at the start of the program are entire images. Coarray
features are compatible with those of the Fortran standard, unless the TASK and END
TASK directives are used. If the execution encounters a TASK directive specified
H. Iwashita and M. Nakao
merged into the global-view XMP language and must exhibit high performance,
comparable to that of MPI.
The Omni XMP compiler is an open-source implementation developed at RIKEN
and the University of Tsukuba [4]. The kernel of the Omni XMP compiler is a
source-to-source compiler that converts an XMP program into a Fortran program
by calling a runtime library. The coarray translator has been implemented on the
Omni XMP compiler. Since the images are mapped one-to-one to XMP nodes, each
image was implemented as a process, and the definition and reference to coarrays
were implemented as inter-node one-sided communications.
This chapter describes the techniques used in the coarray compiler and the
runtime library, and a comparison to MPI message passing. The remainder of this
chapter is organized as follows. Section 2 introduces the requirements of the coarray
features. Section 3 describes the implementation used to solve the requirements, and
Sect. 4 evaluates the performance and productivity of coarray programs. Related
research is described in Sect. 5, and Sect. 6 concludes this chapter.
2 Requirements from Language Specifications
The XMP Fortran language specification [1] supports many of the coarray features
defined in the Fortran 2008 standard [2], and intrinsic procedures CO_SUM,
CO_MAX, CO_MIN, and CO_BROADCAST defined in the Fortran 2018 standard [3]
are supported. In addition, the XMP C language specification was extended to
support coarray features.
This section introduces the coarray features and what is required of the compiler
in order to implement the coarray features.
2.1 Images Mapped to XMP Nodes
In the Fortran standard, an image is defined as an instance of a program. Each
image executes the same program and has its own individual data. Each image has
a different image index k. While the Fortran standard itself does not specify where
each image is executed, XMP specifies that images are mapped to executing nodes
on a one-to-one basis. Therefore, image k is always executed on executing node k,
where 1 ≤ k ≤ n, and n is the number of images as well as the number of executing
nodes. Since each MPI rank number of MPI_COMM_WORLD (0-origin) is always
mapped to an XMP node number in order, image k corresponds to rank (k − 1).
Note that the executing nodes can be a subset of the entire (initial) node set. For
example, two distinct node sets can execute two coarray subprograms concurrently.
The first executing images at the start of the program are entire images. Coarray
features are compatible with those of the Fortran standard, unless the TASK and END
TASK directives are used. If the execution encounters a TASK directive specified
