XcalableMP 2.0 and Future Directions
253
Fig. 6 Example of the tasklet and tasklet gmove directives
runtime system. The chunksize clause can be matched the task dependency
descriptions of users using the dependency generated by the tasklet reflect
directive. When users calculate an array in block units, such as in the cache blocking
technique for a node with data dependency, the user-specified task dependency
and generated data dependency for halo exchange may not identically match. By
specifying the chunksize clause, the halo region is distributed logically to equalsized contiguous chunks, and data dependencies for the halo exchange are generated
automatically by the XMP runtime system based on the specified chunk size.
Figure 6 presents an example of the tasklet gmove directive. In this
example, array A[] with length three is distributed to three nodes in equal-sized
contiguous blocks. This code creates three kinds of tasks. TaskA and taskC are
executed on nodes specified by the on clause. TaskB is executed on nodes 1
and 2, because these nodes have the specified distributed array A[0] or A[1] in
the associated assignment statement under the tasklet gmove directive. There
is a flow dependency between taskA and taskB on node 1 by A[0]. After the
execution of taskA, taskB sends A[0] to node 2, which is determined by the
distributed array A[1]. In node 2, taskB receives A[0] from node 1 in A[1]. When
the receive operation in taskB is finished, taskC is immediately started, because
the flow dependency of A[1] is satisfied. TaskC sends the A[1] to variable B of
node 3. Because the variable B is a local variable for each node, the communication
destination is determined from the execution nodes specified by the on clause.
3.3 Prototype Design of Code Transformation
We have designed a simple code transformation from the code using the proposed
directives to the code with XMP runtime calls using MPI and OpenMP. As for a
253
Fig. 6 Example of the tasklet and tasklet gmove directives
runtime system. The chunksize clause can be matched the task dependency
descriptions of users using the dependency generated by the tasklet reflect
directive. When users calculate an array in block units, such as in the cache blocking
technique for a node with data dependency, the user-specified task dependency
and generated data dependency for halo exchange may not identically match. By
specifying the chunksize clause, the halo region is distributed logically to equalsized contiguous chunks, and data dependencies for the halo exchange are generated
automatically by the XMP runtime system based on the specified chunk size.
Figure 6 presents an example of the tasklet gmove directive. In this
example, array A[] with length three is distributed to three nodes in equal-sized
contiguous blocks. This code creates three kinds of tasks. TaskA and taskC are
executed on nodes specified by the on clause. TaskB is executed on nodes 1
and 2, because these nodes have the specified distributed array A[0] or A[1] in
the associated assignment statement under the tasklet gmove directive. There
is a flow dependency between taskA and taskB on node 1 by A[0]. After the
execution of taskA, taskB sends A[0] to node 2, which is determined by the
distributed array A[1]. In node 2, taskB receives A[0] from node 1 in A[1]. When
the receive operation in taskB is finished, taskC is immediately started, because
the flow dependency of A[1] is satisfied. TaskC sends the A[1] to variable B of
node 3. Because the variable B is a local variable for each node, the communication
destination is determined from the execution nodes specified by the on clause.
3.3 Prototype Design of Code Transformation
We have designed a simple code transformation from the code using the proposed
directives to the code with XMP runtime calls using MPI and OpenMP. As for a
