From 743e4966560437bc726d801bd69e08726dc9d7de Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Fri, 8 Jan 2021 17:35:03 +0100 Subject: [PATCH 1/6] Support CUDA Fortran file extensions in SingleSource * Support the '.cuf' and '.CUF' file extensions when guessing the programming language in the `SingleSource` build system. * Use the CUDA Fortran extension in corresponding regression test. --- .../prgenv/cuda-fortran/cuda_fortran_check.py | 20 +++++++++---------- .../src/{vecAdd_cuda.f90 => vecAdd_cuda.cuf} | 0 reframe/core/buildsystems.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) rename cscs-checks/prgenv/cuda-fortran/src/{vecAdd_cuda.f90 => vecAdd_cuda.cuf} (100%) diff --git a/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py b/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py index ecca6260d1..36033ceae5 100644 --- a/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py +++ b/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py @@ -13,9 +13,10 @@ class CUDAFortranCheck(rfm.RegressionTest): def __init__(self): self.valid_systems = ['daint:gpu', 'dom:gpu'] self.valid_prog_environs = ['PrgEnv-pgi'] - self.sourcepath = 'vecAdd_cuda.f90' + self.sourcepath = 'vecAdd_cuda.cuf' self.modules = ['craype-accel-nvidia60'] self.build_system = 'SingleSource' + self.build_system.fflags = ['-ta=tesla:cc60'] self.num_gpus_per_node = 1 result = sn.extractsingle(r'final result:\s+(?P\d+\.?\d*)', self.stdout, 'result', float) @@ -24,13 +25,12 @@ def __init__(self): self.tags = {'production', 'craype'} @rfm.run_before('compile') - def cdt2006_pgi_workaround(self): - cdt = osext.cray_cdt_version() - if not cdt: - return + def cdt2008_pgi_workaround(self): + cdt = osext.cray_cdt_version() + if not cdt: + return - if (self.current_environ.name == 'PrgEnv-pgi' and cdt == '20.08'): - self.build_system.fflags = [ - 'CUDA_HOME=$CUDATOOLKIT_HOME', - '-ta=tesla:cc60', '-Mcuda=cuda10.2' - ] + if (self.current_environ.name == 'PrgEnv-pgi' and cdt == '20.08'): + self.build_system.fflags += [ + 'CUDA_HOME=$CUDATOOLKIT_HOME', '-Mcuda=cuda10.2' + ] diff --git a/cscs-checks/prgenv/cuda-fortran/src/vecAdd_cuda.f90 b/cscs-checks/prgenv/cuda-fortran/src/vecAdd_cuda.cuf similarity index 100% rename from cscs-checks/prgenv/cuda-fortran/src/vecAdd_cuda.f90 rename to cscs-checks/prgenv/cuda-fortran/src/vecAdd_cuda.cuf diff --git a/reframe/core/buildsystems.py b/reframe/core/buildsystems.py index 3360398176..c1bbcd0ce5 100644 --- a/reframe/core/buildsystems.py +++ b/reframe/core/buildsystems.py @@ -448,7 +448,7 @@ def _guess_language(self, filename): if ext in ['.f', '.for', '.ftn', '.F', '.FOR', '.fpp', '.FPP', '.FTN', '.f90', '.f95', '.f03', '.f08', - '.F90', '.F95', '.F03', '.F08']: + '.F90', '.F95', '.F03', '.F08', '.cuf', '.CUF']: return 'Fortran' if ext in ['.cu']: From 77d9d7948fcec21c62c6870805c1197943f3cc8c Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Fri, 8 Jan 2021 17:44:08 +0100 Subject: [PATCH 2/6] Correct indentation --- .../prgenv/cuda-fortran/cuda_fortran_check.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py b/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py index 36033ceae5..b98609f252 100644 --- a/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py +++ b/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py @@ -26,11 +26,11 @@ def __init__(self): @rfm.run_before('compile') def cdt2008_pgi_workaround(self): - cdt = osext.cray_cdt_version() - if not cdt: - return + cdt = osext.cray_cdt_version() + if not cdt: + return - if (self.current_environ.name == 'PrgEnv-pgi' and cdt == '20.08'): - self.build_system.fflags += [ - 'CUDA_HOME=$CUDATOOLKIT_HOME', '-Mcuda=cuda10.2' - ] + if (self.current_environ.name == 'PrgEnv-pgi' and cdt == '20.08'): + self.build_system.fflags += [ + 'CUDA_HOME=$CUDATOOLKIT_HOME', '-Mcuda=cuda10.2' + ] From b9c30ec792a49782eb28c46984d08df294766350 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Mon, 11 Jan 2021 11:18:39 +0100 Subject: [PATCH 3/6] Add workaround for CUDA 11.0 --- cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py b/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py index b98609f252..9b3358320e 100644 --- a/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py +++ b/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py @@ -25,12 +25,15 @@ def __init__(self): self.tags = {'production', 'craype'} @rfm.run_before('compile') - def cdt2008_pgi_workaround(self): + def cdt_pgi_workaround(self): cdt = osext.cray_cdt_version() if not cdt: return - if (self.current_environ.name == 'PrgEnv-pgi' and cdt == '20.08'): + if cdt == '20.08': self.build_system.fflags += [ 'CUDA_HOME=$CUDATOOLKIT_HOME', '-Mcuda=cuda10.2' ] + else: + #FIXME: workaround when CUDA 11.0 is the default version + self.modules += ['cudatoolkit/10.2.89_3.29-7.0.2.1_3.5__g67354b4'] From 9928a11036d230a085735285aafb38be1befd2a1 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Mon, 11 Jan 2021 11:20:30 +0100 Subject: [PATCH 4/6] Fix pep8 for FIXME --- cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py b/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py index 9b3358320e..6428c14095 100644 --- a/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py +++ b/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py @@ -35,5 +35,5 @@ def cdt_pgi_workaround(self): 'CUDA_HOME=$CUDATOOLKIT_HOME', '-Mcuda=cuda10.2' ] else: - #FIXME: workaround when CUDA 11.0 is the default version + # FIXME: workaround when CUDA 11.0 is the default version self.modules += ['cudatoolkit/10.2.89_3.29-7.0.2.1_3.5__g67354b4'] From 42854786db192abb2e4fa4fc5a39c61b41bf707e Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Tue, 12 Jan 2021 13:14:40 +0100 Subject: [PATCH 5/6] Add case number to FIXME --- cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py b/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py index 6428c14095..4c40c4e386 100644 --- a/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py +++ b/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py @@ -35,5 +35,5 @@ def cdt_pgi_workaround(self): 'CUDA_HOME=$CUDATOOLKIT_HOME', '-Mcuda=cuda10.2' ] else: - # FIXME: workaround when CUDA 11.0 is the default version + # FIXME: PGI 20.1 does not support CUDA 11.0, see case #275674 self.modules += ['cudatoolkit/10.2.89_3.29-7.0.2.1_3.5__g67354b4'] From 2d4512db0028ede1fc8a8bd6f085f897605b57e3 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Tue, 12 Jan 2021 13:25:35 +0100 Subject: [PATCH 6/6] Further comment improvement --- cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py b/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py index 4c40c4e386..1b9db6976b 100644 --- a/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py +++ b/cscs-checks/prgenv/cuda-fortran/cuda_fortran_check.py @@ -35,5 +35,5 @@ def cdt_pgi_workaround(self): 'CUDA_HOME=$CUDATOOLKIT_HOME', '-Mcuda=cuda10.2' ] else: - # FIXME: PGI 20.1 does not support CUDA 11.0, see case #275674 + # FIXME: PGI 20.x does not support CUDA 11, see case #275674 self.modules += ['cudatoolkit/10.2.89_3.29-7.0.2.1_3.5__g67354b4']