104
H. Iwashita and M. Nakao
• The runtime allocation (RA) method allocates and registers a large memory for
all static coarrays at the initialization phase. The RA method also allocates and
registers each allocatable coarray at runtime.
• The compiler allocation (CA) method allocates all coarray objects by the
Fortran system (at compile time or at runtime), and the address is passed to the
runtime library to be registered.
For the RS and RA methods, since the allocated memory address is determined
in the runtime library, the object code must accept the address allocated inside the
runtime system as an address of a regal Fortran variable. To make this connection,
it was necessary to use the Cray pointer, which is not in the Fortran standard. In
the case of the CA method, the runtime library accepts the address allocated in the
Fortran system and registers to the communication library.
3.2.2 Initial Allocation for Static Coarrays
Static coarrays are allocated and registered in the initialization subroutines
xmpf_init_foo.
In the RS and RA methods, static coarrays are initialized before execution of the
user program, as follows.
• In the first pass, all sizes of static (non-allocatable) coarrays are summed. The
size of each static coarray is evaluated form the lower and upper bounds specified
in the dimension declaration statement of each coarray. The lower and upper
bound expressions, possibly including binary and unary operations, references
to names of constants, and basic intrinsic functions, such as min/max and sum,
are evaluated by constant folding. Since the size of the structure that contains
allocatable or pointer components differs depending on the target compiler,
the coarray translator obtains the necessary parameters to calculate the size of
structures at build time.
• Then, the total size of static coarrays is allocated and the address and size are
registered to the underlying communication library.
• In the second pass, the addresses of all of the coarrays are calculated to share
the registered data. Due to the language specification, the sizes of the same
coarray are the same among all images (nodes). Therefore, the offset from the
base address of the registered data for each coarray can be the same among all
images.
In the RS method, allocatable coarrays also share the registered memory. The total
size of the memory to be registered should be specified with an environment variable
by the user. In the RA method, the total size is fully calculated by the runtime
library, and no information is required of the user because allocatable coarrays will
be dynamically allocated on the other memories.
In the CA method, the Fortran processor allocates each coarray, and the runtime
library then registers the address. Each static coarray is converted into a common
H. Iwashita and M. Nakao
• The runtime allocation (RA) method allocates and registers a large memory for
all static coarrays at the initialization phase. The RA method also allocates and
registers each allocatable coarray at runtime.
• The compiler allocation (CA) method allocates all coarray objects by the
Fortran system (at compile time or at runtime), and the address is passed to the
runtime library to be registered.
For the RS and RA methods, since the allocated memory address is determined
in the runtime library, the object code must accept the address allocated inside the
runtime system as an address of a regal Fortran variable. To make this connection,
it was necessary to use the Cray pointer, which is not in the Fortran standard. In
the case of the CA method, the runtime library accepts the address allocated in the
Fortran system and registers to the communication library.
3.2.2 Initial Allocation for Static Coarrays
Static coarrays are allocated and registered in the initialization subroutines
xmpf_init_foo.
In the RS and RA methods, static coarrays are initialized before execution of the
user program, as follows.
• In the first pass, all sizes of static (non-allocatable) coarrays are summed. The
size of each static coarray is evaluated form the lower and upper bounds specified
in the dimension declaration statement of each coarray. The lower and upper
bound expressions, possibly including binary and unary operations, references
to names of constants, and basic intrinsic functions, such as min/max and sum,
are evaluated by constant folding. Since the size of the structure that contains
allocatable or pointer components differs depending on the target compiler,
the coarray translator obtains the necessary parameters to calculate the size of
structures at build time.
• Then, the total size of static coarrays is allocated and the address and size are
registered to the underlying communication library.
• In the second pass, the addresses of all of the coarrays are calculated to share
the registered data. Due to the language specification, the sizes of the same
coarray are the same among all images (nodes). Therefore, the offset from the
base address of the registered data for each coarray can be the same among all
images.
In the RS method, allocatable coarrays also share the registered memory. The total
size of the memory to be registered should be specified with an environment variable
by the user. In the RA method, the total size is fully calculated by the runtime
library, and no information is required of the user because allocatable coarrays will
be dynamically allocated on the other memories.
In the CA method, the Fortran processor allocates each coarray, and the runtime
library then registers the address. Each static coarray is converted into a common
