From 7c9ec32628531b8be22d67e4e7959fb73afd7f60 Mon Sep 17 00:00:00 2001 From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr> Date: Wed, 10 Jul 2019 10:43:55 +0200 Subject: [PATCH] Philippe 10/07/2019: OpenACC: add identification of version 2.7 of OpenACC + print properties of ACC_DEVICE_HOST --- src/LIB/SURCOUCHE/src/mode_mnh_world.f90 | 39 +++++++++++++----------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/LIB/SURCOUCHE/src/mode_mnh_world.f90 b/src/LIB/SURCOUCHE/src/mode_mnh_world.f90 index 5b4dd561c..47e15fcfb 100644 --- a/src/LIB/SURCOUCHE/src/mode_mnh_world.f90 +++ b/src/LIB/SURCOUCHE/src/mode_mnh_world.f90 @@ -7,13 +7,12 @@ !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt !MNH_LIC for details. version 1. !----------------------------------------------------------------- -!! MODIFICATIONS -!! ------------- -!! -!! J.Escobar 3/12/2014 : typo form -> from -!! Philippe 03/10/2017: set IP and NPROC in INIT_NMNH_COMM_WORLD -!! Philippe Wautelet: 10/01/2019: use NEWUNIT argument of OPEN -!! +! Modifications: +! J. Escobar 03/12/2014: typo form -> from +! P. Wautelet 03/10/2017: set IP and NPROC in INIT_NMNH_COMM_WORLD +! P. Wautelet 10/01/2019: use NEWUNIT argument of OPEN +! P. Wautelet 10/07/2019: add identification of version 2.7 of OpenACC + print properties of ACC_DEVICE_HOST +!----------------------------------------------------------------- MODULE MODE_MNH_WORLD IMPLICIT NONE CHARACTER(len=*), parameter :: conf_mnh_world="conf_mnh_world.nam" @@ -91,19 +90,23 @@ CONTAINS IF ( irank .EQ. 0 ) THEN PRINT*,"Hello world from rank=",irank," nproc=",IPROC #ifdef _OPENACC - IF ( OPENACC_VERSION == 201111 ) THEN - PRINT *,"Using OpenACC 1.0" - ELSE IF ( OPENACC_VERSION == 201306 ) THEN - PRINT *,"Using OpenACC 2.0" - ELSE IF ( OPENACC_VERSION == 201510 ) THEN - PRINT *,"Using OpenACC 2.5" - ELSE IF ( OPENACC_VERSION == 201711 ) THEN - PRINT *,"Using OpenACC 2.6" - ELSE - PRINT *,"Using OpenACC (unknown version)" - ENDIF + select case ( OPENACC_VERSION ) + case ( 201111 ) + PRINT *,"Using OpenACC 1.0" + case ( 201306 ) + PRINT *,"Using OpenACC 2.0" + case ( 201510 ) + PRINT *,"Using OpenACC 2.5" + case ( 201711 ) + PRINT *,"Using OpenACC 2.6" + case ( 201811 ) + PRINT *,"Using OpenACC 2.7" + case default + PRINT *,"Using OpenACC (unknown version)" + end select CALL MNH_PRINT_DEVICE_PROPERTIES(ACC_DEVICE_NVIDIA, "NVIDIA GPU(s)") CALL MNH_PRINT_DEVICE_PROPERTIES(ACC_DEVICE_RADEON, "Radeon GPU(s)") + CALL MNH_PRINT_DEVICE_PROPERTIES(ACC_DEVICE_HOST, "Host CPU(s)") CALL MNH_PRINT_DEVICE_PROPERTIES(ACC_DEVICE_XEONPHI,"Xeon Phi(s)") #endif OPEN(newunit=ILU,form="formatted",file=conf_mnh_world,STATUS='OLD',iostat=IERR) -- GitLab