Skip to content
Snippets Groups Projects
Commit 95b6f292 authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 29/08/2023: OpenACC: work around for a problem with NVHPC 23.7 (not...

Philippe 29/08/2023: OpenACC: work around for a problem with NVHPC 23.7 (not present in older versions)

(cherry picked from commit ce39d7dc)
parent 07458945
No related branches found
No related tags found
1 merge request!4Jean Wurtz 30/04/2025 : Bugfixes mainly for TEB and for simple precision
...@@ -1102,13 +1102,18 @@ END IF ...@@ -1102,13 +1102,18 @@ END IF
#else #else
IF ( KRRL >= 1 ) THEN IF ( KRRL >= 1 ) THEN
IF ( KRRI >= 1 ) THEN IF ( KRRI >= 1 ) THEN
!Remark: to work around a problem with NVHPC 23.7 (not present in previous NVHPC versions),
! the computation of ZTMP1_DEVICE and ZTMP2_DEVICE has been split in 2 different kernels
!$acc kernels
!dir$ concurrent
ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:) * PATHETA(:,:,:) * 2. * PSRCM(:,:,:)
!$acc end kernels
#ifdef MNH_COMPILER_CCE #ifdef MNH_COMPILER_CCE
!$acc kernels present(ZTMP2_DEVICE) !$acc kernels present(ZTMP2_DEVICE)
#else #else
!$acc kernels !$acc kernels
#endif #endif
!dir$ concurrent !dir$ concurrent
ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:) * PATHETA(:,:,:) * 2. * PSRCM(:,:,:)
ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:) / PDZZ(:,:,:) ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:) / PDZZ(:,:,:)
!$acc end kernels !$acc end kernels
CALL DZF_DEVICE( ZTMP2_DEVICE, ZTMP3_DEVICE ) CALL DZF_DEVICE( ZTMP2_DEVICE, ZTMP3_DEVICE )
...@@ -1117,13 +1122,18 @@ IF ( KRRL >= 1 ) THEN ...@@ -1117,13 +1122,18 @@ IF ( KRRL >= 1 ) THEN
PRRS(:,:,:,4) = PRRS(:,:,:,4) - ZTMP1_DEVICE(:,:,:) * ZTMP3_DEVICE * PFRAC_ICE(:,:,:) PRRS(:,:,:,4) = PRRS(:,:,:,4) - ZTMP1_DEVICE(:,:,:) * ZTMP3_DEVICE * PFRAC_ICE(:,:,:)
!$acc end kernels !$acc end kernels
ELSE ELSE
!Remark: to work around a problem with NVHPC 23.7 (not present in previous NVHPC versions),
! the computation of ZTMP1_DEVICE and ZTMP2_DEVICE has been split in 2 different kernels
!$acc kernels
!dir$ concurrent
ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:) * PATHETA(:,:,:) * 2. * PSRCM(:,:,:)
!$acc end kernels
#ifdef MNH_COMPILER_CCE #ifdef MNH_COMPILER_CCE
!$acc kernels present(ZTMP2_DEVICE) !$acc kernels present(ZTMP2_DEVICE)
#else #else
!$acc kernels !$acc kernels
#endif #endif
!dir$ concurrent !dir$ concurrent
ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:) * PATHETA(:,:,:) * 2. * PSRCM(:,:,:)
ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:) / PDZZ(:,:,:) ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:) / PDZZ(:,:,:)
!$acc end kernels !$acc end kernels
CALL DZF_DEVICE( ZTMP2_DEVICE, ZTMP3_DEVICE ) CALL DZF_DEVICE( ZTMP2_DEVICE, ZTMP3_DEVICE )
...@@ -1596,28 +1606,38 @@ IF (KRR /= 0) THEN ...@@ -1596,28 +1606,38 @@ IF (KRR /= 0) THEN
#else #else
IF ( KRRL >= 1 ) THEN IF ( KRRL >= 1 ) THEN
IF ( KRRI >= 1 ) THEN IF ( KRRI >= 1 ) THEN
!Remark: to work around a problem with NVHPC 23.7 (not present in previous NVHPC versions),
! the computation of ZTMP1_DEVICE and ZTMP2_DEVICE has been split in 2 different kernels
!$acc kernels
!dir$ concurrent
ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:)*PAMOIST(:,:,:)*2.*PSRCM(:,:,:)
!$acc end kernels
#ifdef MNH_COMPILER_CCE #ifdef MNH_COMPILER_CCE
!$acc kernels present(ZTMP2_DEVICE) !$acc kernels present(ZTMP2_DEVICE)
#else #else
!$acc kernels !$acc kernels
#endif #endif
!dir$ concurrent !dir$ concurrent
ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:)*PAMOIST(:,:,:)*2.*PSRCM(:,:,:)
ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:)/PDZZ(:,:,:) ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:)/PDZZ(:,:,:)
!$acc end kernels !$acc end kernels
CALL DZF_DEVICE( ZTMP2_DEVICE, ZTMP3_DEVICE ) CALL DZF_DEVICE( ZTMP2_DEVICE, ZTMP3_DEVICE )
!$acc kernels !$acc kernels
PRRS(:,:,:,2) = PRRS(:,:,:,2) - ZTMP1_DEVICE(:,:,:) * ZTMP3_DEVICE(:,:,:) * (1.0-PFRAC_ICE(:,:,:)) PRRS(:,:,:,2) = PRRS(:,:,:,2) - ZTMP1_DEVICE(:,:,:) * ZTMP3_DEVICE(:,:,:) * (1.0-PFRAC_ICE(:,:,:))
PRRS(:,:,:,4) = PRRS(:,:,:,4) - ZTMP1_DEVICE(:,:,:) * ZTMP3_DEVICE(:,:,:) * PFRAC_ICE(:,:,:) PRRS(:,:,:,4) = PRRS(:,:,:,4) - ZTMP1_DEVICE(:,:,:) * ZTMP3_DEVICE(:,:,:) * PFRAC_ICE(:,:,:)
!$acc end kernels !$acc end kernels
ELSE ELSE
!Remark: to work around a problem with NVHPC 23.7 (not present in previous NVHPC versions),
! the computation of ZTMP1_DEVICE and ZTMP2_DEVICE has been split in 2 different kernels
!$acc kernels
!dir$ concurrent
ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:)*PAMOIST(:,:,:)*2.*PSRCM(:,:,:)
!$acc end kernels
#ifdef MNH_COMPILER_CCE #ifdef MNH_COMPILER_CCE
!$acc kernels present(ZTMP2_DEVICE) !$acc kernels present(ZTMP2_DEVICE)
#else #else
!$acc kernels !$acc kernels
#endif #endif
!dir$ concurrent !dir$ concurrent
ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:)*PAMOIST(:,:,:)*2.*PSRCM(:,:,:)
ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:)/PDZZ(:,:,:) ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:)/PDZZ(:,:,:)
!$acc end kernels !$acc end kernels
CALL DZF_DEVICE( ZTMP2_DEVICE, ZTMP3_DEVICE ) CALL DZF_DEVICE( ZTMP2_DEVICE, ZTMP3_DEVICE )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment