176
H. Sakagami
51
...
52
physval(..,ix,iy,iz) = ... &
53
physval(..,ix,iy,iz-1) ... physval(..,ix,iy,iz+1)
54
...
55 ...
56 !$OMP PARALLEL DO REDUCTION(max:ram) PRIVATE(iy,ix)
57 do iz = 1, lsz
58 do iy = 1, lsy
59 do ix = 1, lsx
60
ram = max( ram, ... )
61 ...
62 ramc = ram
63 SYNC ALL
64 if( limgn .eq. 1 ) then
65 rami(1) = ram
66 do i = 2, nx * ny * nz
67 rami(i) = ramc[i]
68 end do
69 ram = max( rami )
70 ramc = ram
71 end if
72 SYNC ALL
73 if( limgn .ne. 1 ) then
74 ram = ramc[1]
75 end if
Listing 5 Reduction operations can be replaced by an intrinsic subroutine
1 ...
2 call CO_MAX( ram )
3 ...
Differences of programs between put and get communications are only in Coarray assignment and related sync all statements, and the other parts are completely
same. Ttypical XMP Fortran programs related with get communications are shown
in Listing 6. Note that related sync all statement must be written after put or before
get communications.
Listing 6 Typical XMP programs using the local-view programming model with get communications for all of X, Y, and Z domain decomposition method
1 ...
2 SYNC ALL
3 physval(:,lsx+1,:,:) = physval1(:,1,:,:)[linxp]
4 physval(:,0,:,:) = physval1(:,lsx,:,:)[linxm]
5 ...
6 SYNC ALL
7 physval(:,:,lsy+1,:) = physval1(:,:,1,:)[linyp]
8 physval(:,:,0,:) = physval1(:,:,lsy,:)[linym]
Précédent

- 182/265

Suivant