From 2779c73c1cf7f15c3757e869be50171300a3d152 Mon Sep 17 00:00:00 2001 From: Christopher Bignamini Date: Tue, 7 Jul 2020 16:15:45 +0200 Subject: [PATCH 1/7] Implemented workaround suggested in cray case #263905 --- cscs-checks/libraries/math/trilinos_compile_run.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cscs-checks/libraries/math/trilinos_compile_run.py b/cscs-checks/libraries/math/trilinos_compile_run.py index e97514b2e7..86445d0016 100644 --- a/cscs-checks/libraries/math/trilinos_compile_run.py +++ b/cscs-checks/libraries/math/trilinos_compile_run.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: BSD-3-Clause +import os + import reframe as rfm import reframe.utility.sanity as sn @@ -49,3 +51,12 @@ def __init__(self, linkage): def set_cxxflags(self): flags = self.prgenv_flags[self.current_environ.name] self.build_system.cxxflags = flags + + @rfm.run_before('compile') + def set_prebuild_cmd(self): + if self.current_environ.name.startswith('PrgEnv-intel'): + if '20.06' in os.getenv('MODULERCFILE', ''): + self.modules += ['cray-netcdf-hdf5parallel'] + self.prebuild_cmds = [ + 'ln -s $CRAY_NETCDF_HDF5PARALLEL_PREFIX/lib/pkgconfig/netcdf-cxx4_parallel.pc netcdf_c++4_parallel.pc', + 'export PKG_CONFIG_PATH=`pwd`:$PKG_CONFIG_PATH'] From 3c47180955d8511e7105fc50e7eb3837eb9b4d01 Mon Sep 17 00:00:00 2001 From: Christopher Bignamini Date: Tue, 7 Jul 2020 16:28:41 +0200 Subject: [PATCH 2/7] Coding style fix --- cscs-checks/libraries/math/trilinos_compile_run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cscs-checks/libraries/math/trilinos_compile_run.py b/cscs-checks/libraries/math/trilinos_compile_run.py index 86445d0016..b9328b4e55 100644 --- a/cscs-checks/libraries/math/trilinos_compile_run.py +++ b/cscs-checks/libraries/math/trilinos_compile_run.py @@ -58,5 +58,6 @@ def set_prebuild_cmd(self): if '20.06' in os.getenv('MODULERCFILE', ''): self.modules += ['cray-netcdf-hdf5parallel'] self.prebuild_cmds = [ - 'ln -s $CRAY_NETCDF_HDF5PARALLEL_PREFIX/lib/pkgconfig/netcdf-cxx4_parallel.pc netcdf_c++4_parallel.pc', + 'ln -s $CRAY_NETCDF_HDF5PARALLEL_PREFIX/lib/pkgconfig/'\ + 'netcdf-cxx4_parallel.pc netcdf_c++4_parallel.pc', 'export PKG_CONFIG_PATH=`pwd`:$PKG_CONFIG_PATH'] From 04b4819a8759fae5e555758873d705f5ac66f611 Mon Sep 17 00:00:00 2001 From: Christopher Bignamini Date: Wed, 15 Jul 2020 09:36:25 +0200 Subject: [PATCH 3/7] Function name update Co-authored-by: Vasileios Karakasis --- cscs-checks/libraries/math/trilinos_compile_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cscs-checks/libraries/math/trilinos_compile_run.py b/cscs-checks/libraries/math/trilinos_compile_run.py index b9328b4e55..2bc410540a 100644 --- a/cscs-checks/libraries/math/trilinos_compile_run.py +++ b/cscs-checks/libraries/math/trilinos_compile_run.py @@ -53,7 +53,7 @@ def set_cxxflags(self): self.build_system.cxxflags = flags @rfm.run_before('compile') - def set_prebuild_cmd(self): + def cdt2006_workaround_intel(self): if self.current_environ.name.startswith('PrgEnv-intel'): if '20.06' in os.getenv('MODULERCFILE', ''): self.modules += ['cray-netcdf-hdf5parallel'] From 7e49ca98d52e80ba94defaba6607d63cf10b766b Mon Sep 17 00:00:00 2001 From: Christopher Bignamini Date: Thu, 16 Jul 2020 16:26:09 +0200 Subject: [PATCH 4/7] If condition updated to use cray_cdt_version function and export removed --- cscs-checks/libraries/math/trilinos_compile_run.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cscs-checks/libraries/math/trilinos_compile_run.py b/cscs-checks/libraries/math/trilinos_compile_run.py index 2bc410540a..e308d0b4e8 100644 --- a/cscs-checks/libraries/math/trilinos_compile_run.py +++ b/cscs-checks/libraries/math/trilinos_compile_run.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 @@ -54,10 +55,10 @@ def set_cxxflags(self): @rfm.run_before('compile') def cdt2006_workaround_intel(self): - if self.current_environ.name.startswith('PrgEnv-intel'): - if '20.06' in os.getenv('MODULERCFILE', ''): + if (self.current_environ.name == 'PrgEnv-intel' and + os_ext.cray_cdt_version() == '20.06'): self.modules += ['cray-netcdf-hdf5parallel'] self.prebuild_cmds = [ - 'ln -s $CRAY_NETCDF_HDF5PARALLEL_PREFIX/lib/pkgconfig/'\ - 'netcdf-cxx4_parallel.pc netcdf_c++4_parallel.pc', - 'export PKG_CONFIG_PATH=`pwd`:$PKG_CONFIG_PATH'] + 'ln -s $CRAY_NETCDF_HDF5PARALLEL_PREFIX/lib/pkgconfig/' + 'netcdf-cxx4_parallel.pc netcdf_c++4_parallel.pc'] + self.variables['PKG_CONFIG_PATH'] = '.:$PKG_CONFIG_PATH' From fbcc1a27dd5ad656ab1bde0d6270b5d3ec6067c1 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 16 Jul 2020 21:39:10 +0200 Subject: [PATCH 5/7] Coding style fixes --- cscs-checks/libraries/math/trilinos_compile_run.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cscs-checks/libraries/math/trilinos_compile_run.py b/cscs-checks/libraries/math/trilinos_compile_run.py index e308d0b4e8..4679dfdc4f 100644 --- a/cscs-checks/libraries/math/trilinos_compile_run.py +++ b/cscs-checks/libraries/math/trilinos_compile_run.py @@ -57,8 +57,9 @@ def set_cxxflags(self): def cdt2006_workaround_intel(self): if (self.current_environ.name == 'PrgEnv-intel' and os_ext.cray_cdt_version() == '20.06'): - self.modules += ['cray-netcdf-hdf5parallel'] - self.prebuild_cmds = [ - 'ln -s $CRAY_NETCDF_HDF5PARALLEL_PREFIX/lib/pkgconfig/' - 'netcdf-cxx4_parallel.pc netcdf_c++4_parallel.pc'] - self.variables['PKG_CONFIG_PATH'] = '.:$PKG_CONFIG_PATH' + self.modules += ['cray-netcdf-hdf5parallel'] + self.prebuild_cmds = [ + 'ln -s $CRAY_NETCDF_HDF5PARALLEL_PREFIX/lib/pkgconfig/' + 'netcdf-cxx4_parallel.pc netcdf_c++4_parallel.pc' + ] + self.variables['PKG_CONFIG_PATH'] = '.:$PKG_CONFIG_PATH' From 601cbec574bfc2bf14d91e5e6d6a7a5d8ebd982a Mon Sep 17 00:00:00 2001 From: Christopher Bignamini Date: Fri, 17 Jul 2020 15:51:27 +0200 Subject: [PATCH 6/7] Added workaround for dynamic linking --- .../libraries/math/trilinos_compile_run.py | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/cscs-checks/libraries/math/trilinos_compile_run.py b/cscs-checks/libraries/math/trilinos_compile_run.py index 4679dfdc4f..a9ac44eeba 100644 --- a/cscs-checks/libraries/math/trilinos_compile_run.py +++ b/cscs-checks/libraries/math/trilinos_compile_run.py @@ -21,6 +21,7 @@ def __init__(self, linkage): # NOTE: PrgEnv-cray_classic does not support trilinos if linkage == 'static': self.valid_prog_environs += ['PrgEnv-cray'] + self.linkage = linkage self.build_system = 'SingleSource' self.build_system.ldflags = ['-%s' % linkage, '-lparmetis'] @@ -57,9 +58,17 @@ def set_cxxflags(self): def cdt2006_workaround_intel(self): if (self.current_environ.name == 'PrgEnv-intel' and os_ext.cray_cdt_version() == '20.06'): - self.modules += ['cray-netcdf-hdf5parallel'] - self.prebuild_cmds = [ - 'ln -s $CRAY_NETCDF_HDF5PARALLEL_PREFIX/lib/pkgconfig/' - 'netcdf-cxx4_parallel.pc netcdf_c++4_parallel.pc' - ] - self.variables['PKG_CONFIG_PATH'] = '.:$PKG_CONFIG_PATH' + self.modules += ['cray-netcdf-hdf5parallel'] + self.prebuild_cmds = [ + 'ln -s $CRAY_NETCDF_HDF5PARALLEL_PREFIX/lib/pkgconfig/' + 'netcdf-cxx4_parallel.pc netcdf_c++4_parallel.pc'] + self.variables['PKG_CONFIG_PATH'] = '.:$PKG_CONFIG_PATH' + + @rfm.run_before('compile') + def cdt2006_workaround_dynamic(self): + if (os_ext.cray_cdt_version() == '20.06' and + self.linkage == 'dynamic'): + self.variables['PATH'] = '/opt/cray/pe/cce/10.0.1/cce-clang/x86_64/bin:$PATH' + self.prgenv_flags[self.current_environ.name] += ['-fuse-ld=lld'] + if self.current_environ.name == 'PrgEnv-gnu': + self.modules += ['gcc/9.3.0'] From 72703620bf44242d68409d98054ba2e5096ae63e Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 17 Jul 2020 18:35:55 +0200 Subject: [PATCH 7/7] Minor fixes --- .../libraries/math/trilinos_compile_run.py | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/cscs-checks/libraries/math/trilinos_compile_run.py b/cscs-checks/libraries/math/trilinos_compile_run.py index a9ac44eeba..6ae71232f3 100644 --- a/cscs-checks/libraries/math/trilinos_compile_run.py +++ b/cscs-checks/libraries/math/trilinos_compile_run.py @@ -58,17 +58,23 @@ def set_cxxflags(self): def cdt2006_workaround_intel(self): if (self.current_environ.name == 'PrgEnv-intel' and os_ext.cray_cdt_version() == '20.06'): - self.modules += ['cray-netcdf-hdf5parallel'] - self.prebuild_cmds = [ - 'ln -s $CRAY_NETCDF_HDF5PARALLEL_PREFIX/lib/pkgconfig/' - 'netcdf-cxx4_parallel.pc netcdf_c++4_parallel.pc'] - self.variables['PKG_CONFIG_PATH'] = '.:$PKG_CONFIG_PATH' + self.modules += ['cray-netcdf-hdf5parallel'] + self.prebuild_cmds = [ + 'ln -s $CRAY_NETCDF_HDF5PARALLEL_PREFIX/lib/pkgconfig/' + 'netcdf-cxx4_parallel.pc netcdf_c++4_parallel.pc' + ] + self.variables['PKG_CONFIG_PATH'] = '.:$PKG_CONFIG_PATH' @rfm.run_before('compile') def cdt2006_workaround_dynamic(self): if (os_ext.cray_cdt_version() == '20.06' and - self.linkage == 'dynamic'): - self.variables['PATH'] = '/opt/cray/pe/cce/10.0.1/cce-clang/x86_64/bin:$PATH' + self.linkage == 'dynamic' and + self.current_environ.name == 'PrgEnv-gnu'): + self.variables['PATH'] = ( + '/opt/cray/pe/cce/10.0.1/cce-clang/x86_64/bin:$PATH' + ) self.prgenv_flags[self.current_environ.name] += ['-fuse-ld=lld'] - if self.current_environ.name == 'PrgEnv-gnu': - self.modules += ['gcc/9.3.0'] + + # GCC >= 9 is required for the above option; our CUDA-friendly CDT + # uses GCC 8 as default. + self.modules += ['gcc/9.3.0']