diff --git a/cscs-checks/mch/automatic_arrays_acc.py b/cscs-checks/mch/automatic_arrays_acc.py index 91adf8db44..6db3567f9e 100644 --- a/cscs-checks/mch/automatic_arrays_acc.py +++ b/cscs-checks/mch/automatic_arrays_acc.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause import reframe as rfm +import reframe.utility.os_ext as os_ext import reframe.utility.sanity as sn @@ -87,6 +88,9 @@ def cray_linker_workaround(self): @rfm.run_before('compile') def cdt2006_pgi_workaround(self): - if (self.current_system.name == 'dom' and - self.current_environ.name == 'PrgEnv-pgi'): + cdt = os_ext.cray_cdt_version() + if not cdt: + return + + if (self.current_environ.name == 'PrgEnv-pgi' and cdt == '20.06'): self.variables.update({'CUDA_HOME': '$CUDATOOLKIT_HOME'}) diff --git a/cscs-checks/mch/gpu_direct_acc.py b/cscs-checks/mch/gpu_direct_acc.py index b72644b3f2..2709efdfdf 100644 --- a/cscs-checks/mch/gpu_direct_acc.py +++ b/cscs-checks/mch/gpu_direct_acc.py @@ -5,6 +5,7 @@ import os import reframe as rfm +import reframe.utility.os_ext as os_ext import reframe.utility.sanity as sn @@ -83,6 +84,9 @@ def cray_linker_workaround(self): @rfm.run_before('compile') def cdt2006_pgi_workaround(self): - if (self.current_system.name == 'dom' and - self.current_environ.name == 'PrgEnv-pgi'): + cdt = os_ext.cray_cdt_version() + if not cdt: + return + + if (self.current_environ.name == 'PrgEnv-pgi' and cdt == '20.06'): self.variables['CUDA_HOME'] = '$CUDATOOLKIT_HOME' diff --git a/cscs-checks/mch/openacc_cuda_mpi_cppstd.py b/cscs-checks/mch/openacc_cuda_mpi_cppstd.py index d8b9f5b368..019b9a9d4f 100644 --- a/cscs-checks/mch/openacc_cuda_mpi_cppstd.py +++ b/cscs-checks/mch/openacc_cuda_mpi_cppstd.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause import reframe as rfm +import reframe.utility.os_ext as os_ext import reframe.utility.sanity as sn @@ -93,6 +94,9 @@ def setflags(self): @rfm.run_before('compile') def cdt2006_pgi_workaround(self): - if (self.current_system.name == 'dom' and - self.current_environ.name == 'PrgEnv-pgi'): + cdt = os_ext.cray_cdt_version() + if not cdt: + return + + if (self.current_environ.name == 'PrgEnv-pgi' and cdt == '20.06'): self.variables.update({'CUDA_HOME': '$CUDATOOLKIT_HOME'}) diff --git a/cscs-checks/prgenv/openacc_checks.py b/cscs-checks/prgenv/openacc_checks.py index 9062ed5d35..be751f4424 100644 --- a/cscs-checks/prgenv/openacc_checks.py +++ b/cscs-checks/prgenv/openacc_checks.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause import reframe as rfm +import reframe.utility.os_ext as os_ext import reframe.utility.sanity as sn @@ -77,6 +78,9 @@ def cray_linker_workaround(self): @rfm.run_before('compile') def cdt2006_pgi_workaround(self): - if (self.current_system.name == 'dom' and - self.current_environ.name == 'PrgEnv-pgi'): + cdt = os_ext.cray_cdt_version() + if not cdt: + return + + if (self.current_environ.name == 'PrgEnv-pgi' and cdt == '20.06'): self.variables.update({'CUDA_HOME': '$CUDATOOLKIT_HOME'}) diff --git a/cscs-checks/prgenv/opencl_check.py b/cscs-checks/prgenv/opencl_check.py index 6a3080f7e4..55d839aeb0 100644 --- a/cscs-checks/prgenv/opencl_check.py +++ b/cscs-checks/prgenv/opencl_check.py @@ -6,6 +6,7 @@ import os import reframe as rfm +import reframe.utility.os_ext as os_ext import reframe.utility.sanity as sn @@ -31,6 +32,9 @@ def setflags(self): @rfm.run_before('compile') def cdt2006_pgi_workaround(self): - if (self.current_system.name == 'dom' and - self.current_environ.name == 'PrgEnv-pgi'): + cdt = os_ext.cray_cdt_version() + if not cdt: + return + + if (self.current_environ.name == 'PrgEnv-pgi' and cdt == '20.06'): self.variables.update({'CUDA_HOME': '$CUDATOOLKIT_HOME'})