From a38faf203c44270aee5cd9d09b0be219d3a87cea Mon Sep 17 00:00:00 2001 From: juckerj <39263956+jonasjucker@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:15:03 +0200 Subject: [PATCH] Prepare Daint shutdown (#982) * make libgrib1 compatible with nvhpc * activate more tests on Balfrin * compile only serial int2lm on Balfrin * GitHub Action: Apply Pep8-formatting * fix typo * remove failing test * fix int2lm recipe for balfrin * GitHub Action: Apply Pep8-formatting * fix wrong logfilename * GitHub Action: Apply Pep8-formatting --------- Co-authored-by: Jonas Jucker Co-authored-by: github-actions --- repos/c2sm/packages/int2lm/package.py | 13 ++++--------- repos/c2sm/packages/libgrib1/package.py | 8 +++++--- test/system_test.py | 21 ++++++++------------- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/repos/c2sm/packages/int2lm/package.py b/repos/c2sm/packages/int2lm/package.py index 6b3202757a..4ca75fba02 100644 --- a/repos/c2sm/packages/int2lm/package.py +++ b/repos/c2sm/packages/int2lm/package.py @@ -60,6 +60,8 @@ class Int2lm(MakefilePackage): msg= 'int2lm-org is currently broken with pollen, set variant pollen=False') + conflicts('%cce', msg='cce compiler not supported for int2lm') + build_directory = 'TESTSUITE' def setup_build_environment(self, env): @@ -108,21 +110,14 @@ def setup_build_environment(self, env): if self.spec['mpi'].name == 'openmpi': env.set('MPIL', '-L' + self.spec['mpi'].prefix + ' -lmpi_mpifh') env.set('MPII', '-I' + self.spec['mpi'].prefix + '/include') - else: - env.set('MPII', '-I' + self.spec['mpi'].prefix + '/include') - if self.compiler.name != 'gcc': - env.set('MPIL', '-L' + self.spec['mpi'].prefix + ' -lmpich') # Compiler & linker variables if self.compiler.name == 'pgi': env.set('F90', 'pgf90 -D__PGI_FORTRAN__') env.set('LD', 'pgf90 -D__PGI_FORTRAN__') elif self.compiler.name == 'nvhpc': - env.set('F90', 'nvfortran -D__PGI_FORTRAN__') - env.set('LD', 'nvfortran -D__PGI_FORTRAN__') - elif self.compiler.name == 'cce': - env.set('F90', 'ftn -D__CRAY_FORTRAN__') - env.set('LD', 'ftn -D__CRAY_FORTRAN__') + env.set('F90', self.spec['mpi'].mpifc + ' -D__PGI_FORTRAN__') + env.set('LD', self.spec['mpi'].mpifc + ' -D__PGI_FORTRAN__') else: env.set('F90', self.spec['mpi'].mpifc) env.set('LD', self.spec['mpi'].mpifc) diff --git a/repos/c2sm/packages/libgrib1/package.py b/repos/c2sm/packages/libgrib1/package.py index f1e7f4f777..e15873661c 100644 --- a/repos/c2sm/packages/libgrib1/package.py +++ b/repos/c2sm/packages/libgrib1/package.py @@ -35,9 +35,6 @@ class Libgrib1(MakefilePackage): version('master', branch='master') version('22-01-2020', commit='3d3db9a9a090f6798c2fd4290c271dd58ff694e0') - # conflicts('@22-01-2020', when='%gcc@11.3.0') - # conflicts('@22-01-2020', when='%nvhpc@22.7') - def edit(self, spec, prefix): _makefile_name = 'Makefile.linux' if self.compiler.name == 'gcc': @@ -57,6 +54,11 @@ def build(self, spec, prefix): MakeFileFilter.filter('LIBDIR =.*', 'LIBDIR = {0}/lib'.format(stage_path)) options = ['-f', self._makefile_name] + + if self.compiler.name in ('nvhpc'): + MakeFileFilter.filter('pgf90', 'nvfortran') + MakeFileFilter.filter('pgcc', 'nvc') + make(*options) def install(self, spec, prefix): diff --git a/test/system_test.py b/test/system_test.py index 95b2514c06..f6f19757c8 100644 --- a/test/system_test.py +++ b/test/system_test.py @@ -1,11 +1,9 @@ -import unittest import pytest import subprocess import sys import os import uuid import shutil -from pathlib import Path import inspect spack_c2sm_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), @@ -84,10 +82,9 @@ def test_install_cosmo_eccodes_definitions_version(version): @pytest.mark.no_tsa -@pytest.mark.no_balfrin @pytest.mark.cosmo def test_install_cosmo_6_0(): - spack_install(f'cosmo@6.0', test_root=False) + spack_install(f'cosmo@6.0%nvhpc', test_root=False) @pytest.mark.eccodes @@ -172,14 +169,15 @@ def icon_env_test(spack_env: str, out_of_source: bool = False): check=True, shell=True) + log_filename = sanitized_filename(spack_env) if out_of_source: build_dir = os.path.join(unique_folder, 'build') os.makedirs(build_dir, exist_ok=True) shutil.copytree(os.path.join(unique_folder, 'config'), os.path.join(build_dir, 'config')) unique_folder = build_dir + log_filename += '_out_of_source' - log_filename = sanitized_filename(spack_env) + '_out_of_source' log_with_spack('spack install -n -v', 'system_test', log_filename, @@ -244,11 +242,10 @@ def test_install_int2ml_version_3_00_gcc(): @pytest.mark.int2lm -@pytest.mark.no_balfrin # fails because libgrib1 master fails def test_install_int2lm_version_3_00_nvhpc_fixed_definitions(): spack_install( - f'int2lm @int2lm-3.00 %{nvidia_compiler} ^cosmo-eccodes-definitions@2.19.0.7%{nvidia_compiler}' - ) + f'int2lm @int2lm-3.00 %{nvidia_compiler} ^cosmo-eccodes-definitions@2.19.0.7%{nvidia_compiler}', + test_root='balfrin' not in machine_name()) @pytest.mark.no_tsa # Test is too expensive. It takes over 5h. @@ -257,10 +254,9 @@ def test_install_libcdi_pio_default(): spack_install('libcdi-pio') -@pytest.mark.no_balfrin # This fails with "BOZ literal constant at (1) cannot appear in an array constructor". https://gcc.gnu.org/onlinedocs/gfortran/BOZ-literal-constants.html @pytest.mark.libgrib1 -def test_install_libgrib1_22_01_2020(): - spack_install('libgrib1 @22-01-2020') +def test_install_libgrib1_22_01_2020_nvhpc(): + spack_install(f'libgrib1 @22-01-2020%{nvidia_compiler}') @pytest.mark.makedepf90 @@ -287,8 +283,7 @@ def test_install_default_onnx_runtime(): spack_install('onnx-runtime') -@pytest.mark.no_balfrin # Coupling only needed on Daint -@pytest.mark.no_tsa # Coupling only needed on Daint +@pytest.mark.no_tsa # Coupling not needed on Tsa @pytest.mark.oasis def test_install_oasis_version_4_0_nvhpc(): spack_install('oasis @4.0 %nvhpc')