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

Philippe 13/01/2022: OpenACC: ACC_DEVICE_* is 64 bits for CCE and 32 bits for...

Philippe 13/01/2022: OpenACC: ACC_DEVICE_* is 64 bits for CCE and 32 bits for NVHPC + add detection of AMD GPUs
parent 0cecac65
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,15 @@ ...@@ -2,6 +2,15 @@
#undef MNH_OPENACC #undef MNH_OPENACC
#endif #endif
#ifdef MNH_COMPILER_NVHPC
#define MNH_ACC_SZ MNHINT32
#elif MNH_COMPILER_CCE
#define MNH_ACC_SZ MNHINT64
#else
#define MNH_ACC_SZ KIND(1)
#endif
!MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier !MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
...@@ -31,6 +40,7 @@ CONTAINS ...@@ -31,6 +40,7 @@ CONTAINS
#ifdef MNH_GA #ifdef MNH_GA
USE MODD_MPIF , ONLY : MPI_THREAD_MULTIPLE USE MODD_MPIF , ONLY : MPI_THREAD_MULTIPLE
#endif #endif
USE MODD_PRECISION, ONLY: MNHINT32, MNHINT64
USE MODD_VAR_ll, ONLY : IP, NPROC, NMNH_COMM_WORLD , LMNH_ISINIT USE MODD_VAR_ll, ONLY : IP, NPROC, NMNH_COMM_WORLD , LMNH_ISINIT
!JUANZ !JUANZ
#ifdef MNH_OPENACC #ifdef MNH_OPENACC
...@@ -139,9 +149,12 @@ CONTAINS ...@@ -139,9 +149,12 @@ CONTAINS
case default case default
PRINT *,"Using OpenACC (unknown version)" PRINT *,"Using OpenACC (unknown version)"
end select end select
CALL MNH_PRINT_DEVICE_PROPERTIES(ACC_DEVICE_NVIDIA, "NVIDIA GPU(s)") CALL MNH_PRINT_DEVICE_PROPERTIES( ACC_DEVICE_NVIDIA, "NVIDIA GPU(s)" )
!CALL MNH_PRINT_DEVICE_PROPERTIES(ACC_DEVICE_RADEON, "Radeon GPU(s)") ACC_DEVICE_RADEON was removed from PGI 19.7 !CALL MNH_PRINT_DEVICE_PROPERTIES(ACC_DEVICE_RADEON, "Radeon GPU(s)") ACC_DEVICE_RADEON was removed from PGI 19.7
CALL MNH_PRINT_DEVICE_PROPERTIES(ACC_DEVICE_HOST, "Host CPU(s)") #ifdef MNH_COMPILER_CCE
CALL MNH_PRINT_DEVICE_PROPERTIES( ACC_DEVICE_AMD, "AMD GPU(s)" )
#endif
CALL MNH_PRINT_DEVICE_PROPERTIES( ACC_DEVICE_HOST, "Host CPU(s)")
!CALL MNH_PRINT_DEVICE_PROPERTIES(ACC_DEVICE_XEONPHI,"Xeon Phi(s)") ACC_DEVICE_XEONPHI was removed from PGI 19.7 !CALL MNH_PRINT_DEVICE_PROPERTIES(ACC_DEVICE_XEONPHI,"Xeon Phi(s)") ACC_DEVICE_XEONPHI was removed from PGI 19.7
#endif #endif
OPEN(newunit=ILU,form="formatted",file=conf_mnh_world,STATUS='OLD',iostat=IERR) OPEN(newunit=ILU,form="formatted",file=conf_mnh_world,STATUS='OLD',iostat=IERR)
...@@ -208,15 +221,15 @@ CONTAINS ...@@ -208,15 +221,15 @@ CONTAINS
CONTAINS CONTAINS
SUBROUTINE MNH_PRINT_DEVICE_PROPERTIES(KDEVTYPE,HMSG) SUBROUTINE MNH_PRINT_DEVICE_PROPERTIES(KDEVTYPE,HMSG)
! !
INTEGER, INTENT(IN) :: KDEVTYPE INTEGER(KIND=MNH_ACC_SZ), INTENT(IN) :: KDEVTYPE
CHARACTER(LEN=*),INTENT(IN) :: HMSG CHARACTER(LEN=*), INTENT(IN) :: HMSG
! !
INTEGER :: INUMDEV, IDXNAMEDEV, IDXVENDORDEV, IDXDRIVERDEV INTEGER :: INUMDEV, IDXNAMEDEV, IDXVENDORDEV, IDXDRIVERDEV
INTEGER(KIND=8) :: IMEMDEV INTEGER(KIND=MNHINT64) :: IMEMDEV
INTEGER :: JI INTEGER :: JI
CHARACTER(LEN=32) :: YNAMEDEV CHARACTER(LEN=32) :: YNAMEDEV
CHARACTER(LEN=16) :: YVENDORDEV CHARACTER(LEN=16) :: YVENDORDEV
CHARACTER(LEN=32) :: YDRIVERDEV CHARACTER(LEN=32) :: YDRIVERDEV
! !
INUMDEV = ACC_GET_NUM_DEVICES(KDEVTYPE) INUMDEV = ACC_GET_NUM_DEVICES(KDEVTYPE)
WRITE(*,*) " with ",INUMDEV," ",TRIM(HMSG)," (for rank 0)" WRITE(*,*) " with ",INUMDEV," ",TRIM(HMSG)," (for rank 0)"
......
...@@ -125,7 +125,7 @@ CPP = cpp -P -Wcomment ...@@ -125,7 +125,7 @@ CPP = cpp -P -Wcomment
# #
CPPFLAGS_C = -DLITTLE_endian CPPFLAGS_C = -DLITTLE_endian
CPPFLAGS_SURFEX = -traditional CPPFLAGS_SURFEX = -traditional
CPPFLAGS_SURCOUCHE = -traditional -DDEV_NULL -DUSE_MPI CPPFLAGS_SURCOUCHE = -traditional -DDEV_NULL -DUSE_MPI -DMNH_COMPILER_CCE
CPPFLAGS_RAD = -traditional CPPFLAGS_RAD = -traditional
CPPFLAGS_NEWLFI = -traditional -DSWAPIO -DLINUX -DLFI_INT=${LFI_INT} CPPFLAGS_NEWLFI = -traditional -DSWAPIO -DLINUX -DLFI_INT=${LFI_INT}
CPPFLAGS_MNH = -traditional -DMNH -DSFX_MNH -DMNH_NO_MPI_LOGICAL48 -DUSE_MPI -DMNH_CRAY CPPFLAGS_MNH = -traditional -DMNH -DSFX_MNH -DMNH_NO_MPI_LOGICAL48 -DUSE_MPI -DMNH_CRAY
......
...@@ -197,7 +197,7 @@ CPP = cpp -P -traditional -Wcomment -D_OPENACC=201711 ...@@ -197,7 +197,7 @@ CPP = cpp -P -traditional -Wcomment -D_OPENACC=201711
# #
CPPFLAGS_C = -DLITTLE_endian CPPFLAGS_C = -DLITTLE_endian
CPPFLAGS_SURFEX = CPPFLAGS_SURFEX =
CPPFLAGS_SURCOUCHE += CPPFLAGS_SURCOUCHE += -DMNH_COMPILER_NVHPC
CPPFLAGS_RAD = CPPFLAGS_RAD =
CPPFLAGS_NEWLFI = -DSWAPIO -DLINUX -DLFI_INT=${LFI_INT} CPPFLAGS_NEWLFI = -DSWAPIO -DLINUX -DLFI_INT=${LFI_INT}
CPPFLAGS_MNH = -DMNH -DMNH_PGI -DSFX_MNH CPPFLAGS_MNH = -DMNH -DMNH_PGI -DSFX_MNH
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment