190
K. Tsugane et al.
1 #define n_t 2
2 /* Number of the toroidal domain decomposition */
3 #define n_r 4
4 /* Number of the radial domain decomposition. */
5 #define n_rp 2
6 /* Number of the particle decomposition. */
7
8 #define nloc_over 107722
9
10 double phitmp[nloc_over_all][2*n_t];
11 int b[n_r*n_rp]
12 = {10967,10967,14086,14086,16164,16164,12644,12644};
13 /* Block size of each process in the "gblock" distribution. */
14
15 #pragma xmp nodes P2(n_r * n_rp, n_t)
16 /* Number of processes (nodes). */
17 #pragma xmp template T(0:nloc_over−1, 0:2*n_t−1)
18 /* Template length. */
19 #pragma xmp distribute T(gblock(b), block) onto P2
20 /* Distribution format of the template. */
21 #pragma xmp align phitmp[i][j] with T(i, j)
22 /* Alignment of an array with a template.*/
23 #pragma xmp shadow phitmp[0][1:0]
24 /* Assignment of the sleeve area. */
25 /* ... */
26 #pragma xmp loop (i, j) on T(i, j)
27 #pragma omp parallel for
28
for (i = 0; i < nloc_over; i++)
29
for (j = 0; j < mzeta; j++)
30
phitmp[i][j] = func(i, j);
Fig. 9 Exchange of grid points using the reflect directive in GTC-P
1 #pragma xmp reflect (phitmp) width (0,/periodic/1:0)
Fig. 10 Example showing GTC-P implementation using the XMP global-view programming
model
Précédent

- 195/265

Suivant