144
A. Tabuchi et al.
By contrast, XACC requires smaller code changes (“e”) because XACC is also
directive-based language as OpenACC.
In many cases, a parallel code for an accelerated cluster is based on an existing
serial code. The code changes to the existing serial code are likely to trigger program
bugs. Therefore, XACC is designed to reuse an existing code as possible.
6.2 Quantitative Evaluation by Delta Source Lines of Codes
As one of metrics for productivity, Delta Source Lines of Codes (DSLOC) is
proposed[10]. The DSLOC indicates how the codes change from a corresponding
implementation. The DSLOC is the sum of three components: how many lines are
added, deleted, and modified. When the DSLOC is small, the programming costs
and the possibility of program bugs will be small as well. We use the DSLOC to
count the amount of change required to implement an accelerated cluster code from
a serial code.
Table 2 shows the DSLOC where lowercase characters correspond to Fig. 24. The
DSLOC of XACC (b + e) is smaller than MPI+CUDA (a + c) and MPI+OpenACC (b
+ d). The difference between XACC and MPI+CUDA is 420.0%, and that between
XACC and MPI+OpenACC is 39.4%.
6.3 Discussion
In “e” of Table 2, four lines for modification are required to implement the XACC
code from the OpenACC code. Figures 25 and 26 show the modification, which
is a part of WD() of Fig. 17. A variable tt is used to be an index for halo region.
The tt is modified from line 6 of Fig. 25 to line 7 of Fig. 26. In Fig. 25, when a
value of a variable t is “NT-1,” that of the variable tt becomes “0” which is the
lower bound index of the first dimension of the array v_out. On the other hand, in
Fig. 26, communication of the halo is performed before execution of WD() by the
reflect directive shown in Fig. 16. Thus, the variable tt need only be incremented
in Fig. 26. There are four such modifications in WD(). Note that XACC does not
keep the semantics of the base code perfectly in this case in exchange for simplified
Table 2 DSLOC of Lattice QCD implementations
a
b
c
d
e
a + c
b + d
b+e
DSLOC
552
22
280
201
138
832
223
160
Add
137
20
185
140
134
322
160
154
Delete
73
0
0
0
0
73
0
0
Modify
342
2
95
61
4
437
63
6
Précédent

- 151/265

Suivant