I’ve sent the following material to Dave Norton who promised to forward it to Mat, but for the benefit of the community, it is reproduced here.
We are porting the dynamical core of the evolving ICON climate model to GPUs using OpenACC. The code consists many, many triply nested loops like the one below. The derived types are a problem for OpenACC: variables like p_diag%vn_ie, p_int%c_lin_e, p_prog%w and p_diag%e_kinh all need to be on the GPU. The first question is the time frame for supporting derived types on the GPU. If this is not going to be supported soon, major refactoring has to happen.
!$OMP DO PRIVATE(jb, jk, je, i_startidx, i_endidx)
DO jb = i_startblk, i_endblk
CALL get_indices_e(p_patch, jb, i_startblk, i_endblk, &
i_startidx, i_endidx, rl_start, rl_end)
DO je = i_startidx, i_endidx
DO jk = 1, nlev
! Multiply vn_ie with w interpolated to edges for divergence computation
z_vnw(je,jk,jb) = p_diag%vn_ie(je,jk,jb)* &
( p_int%c_lin_e(je,1,jb) * p_prog%w(icidx(je,jb,1),jk,icblk(je,jb,1)) &
+ p_int%c_lin_e(je,2,jb) * p_prog%w(icidx(je,jb,2),jk,icblk(je,jb,2)) )
! Compute horizontal gradient of horizontal kinetic energy
z_ddxn_ekin_e(je,jk,jb) = p_patch%edges%inv_dual_edge_length(je,jb) * &
(p_diag%e_kinh(icidx(je,jb,2),jk,icblk(je,jb,2)) - &
p_diag%e_kinh(icidx(je,jb,1),jk,icblk(je,jb,1)) )
ENDDO
ENDDO
ENDDO
!$OMP END DO
The second question is whether !$acc declare is currently supported, or will be soon. This feature is crucial for this code. We have 12.4 installed. According to the implementation schedule on
declare should be implemented in 12.3, but it seems unavailable:
!$acc declare create(prog_vn(2,2,3))
PGF90-S-0070-Incorrect sequence of statements (…/…/…/src/atm_dyn_iconam/mo_nonhydro_state.f90: 800)
Could you let us know your timetable for declare?
Thanks,
–Will[/url]