102
H. Iwashita and M. Nakao
length for which the data is partially contiguous. For example, the contiguous
lengths of a(2,3) and a(2:5,3) are 1 and 4, respectively. a(1:M,1:3) is
two-dimensionally contiguous and has contiguous length 2 × M. a(1:M-1,1:3)
is one-dimensionally contiguous and has a contiguous length (M − 1).
Requirement for the Implementation For high-performance communication, it is
important to find the contiguous length across the dimensions, because thousands of
bytes of contiguous data is needed in order to be comparable to the communication
latency in general, and only the first dimension of the array is not always long
enough.
2.6 Coarray C Language Specifications
The XMP language specification extends the C language to support coarray features.
Array notations, such as subarray and array assignment statements, are adopted in
the C language. In XMP/C, a coarray is a data object but is not a pointer. A coarray
is either (1) of basic type, (2) a structure in which no component is a pointer or (3)
an array of 1, 2, or 3.
XMP/C also has static and allocatable coarrays. Coarray variables declared
directly in the file and declared with the static attribute are static. Coarray
variables can be allocated with intrinsic functions.
3 Implementation
3.1 Omni XMP Compiler Framework
The coarray translator was added to the Omni XMP compiler [4], as shown in
Fig. 1. The Omni XMP compiler is a source-to-source translator that converts XMP
programs into the base language (Fortran or C). The component “coarray translator”
(CAF translator) is located in front of the XMP translator to solve coarray features
previously. The output of the decompiler is a standard Fortran/C program, which
may include calls to the XMP runtime library.
The following procedures are generated in advance or in the coarray translator to
initialize static coarray variables prior to the execution of the user program:
• The built-in main program calls subroutine xmpf_traverse_init, the entry
procedure of initialization subroutines, before executing the user main program.
• Subroutine xmpf_traverse_init is generated by the coarray translator to
call initialization subroutines corresponding to all user-defined procedures.
H. Iwashita and M. Nakao
length for which the data is partially contiguous. For example, the contiguous
lengths of a(2,3) and a(2:5,3) are 1 and 4, respectively. a(1:M,1:3) is
two-dimensionally contiguous and has contiguous length 2 × M. a(1:M-1,1:3)
is one-dimensionally contiguous and has a contiguous length (M − 1).
Requirement for the Implementation For high-performance communication, it is
important to find the contiguous length across the dimensions, because thousands of
bytes of contiguous data is needed in order to be comparable to the communication
latency in general, and only the first dimension of the array is not always long
enough.
2.6 Coarray C Language Specifications
The XMP language specification extends the C language to support coarray features.
Array notations, such as subarray and array assignment statements, are adopted in
the C language. In XMP/C, a coarray is a data object but is not a pointer. A coarray
is either (1) of basic type, (2) a structure in which no component is a pointer or (3)
an array of 1, 2, or 3.
XMP/C also has static and allocatable coarrays. Coarray variables declared
directly in the file and declared with the static attribute are static. Coarray
variables can be allocated with intrinsic functions.
3 Implementation
3.1 Omni XMP Compiler Framework
The coarray translator was added to the Omni XMP compiler [4], as shown in
Fig. 1. The Omni XMP compiler is a source-to-source translator that converts XMP
programs into the base language (Fortran or C). The component “coarray translator”
(CAF translator) is located in front of the XMP translator to solve coarray features
previously. The output of the decompiler is a standard Fortran/C program, which
may include calls to the XMP runtime library.
The following procedures are generated in advance or in the coarray translator to
initialize static coarray variables prior to the execution of the user program:
• The built-in main program calls subroutine xmpf_traverse_init, the entry
procedure of initialization subroutines, before executing the user main program.
• Subroutine xmpf_traverse_init is generated by the coarray translator to
call initialization subroutines corresponding to all user-defined procedures.
