Skip to content

Commit

Permalink
Prepare Daint shutdown (#982)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
3 people committed Aug 6, 2024
1 parent 8d5c9a1 commit a38faf2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
13 changes: 4 additions & 9 deletions repos/c2sm/packages/int2lm/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions repos/c2sm/packages/libgrib1/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ class Libgrib1(MakefilePackage):
version('master', branch='master')
version('22-01-2020', commit='3d3db9a9a090f6798c2fd4290c271dd58ff694e0')

# conflicts('@22-01-2020', when='%[email protected]')
# conflicts('@22-01-2020', when='%[email protected]')

def edit(self, spec, prefix):
_makefile_name = 'Makefile.linux'
if self.compiler.name == 'gcc':
Expand All @@ -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):
Expand Down
21 changes: 8 additions & 13 deletions test/system_test.py
Original file line number Diff line number Diff line change
@@ -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__)),
Expand Down Expand Up @@ -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'[email protected]', test_root=False)
spack_install(f'[email protected]%nvhpc', test_root=False)


@pytest.mark.eccodes
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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} ^[email protected]%{nvidia_compiler}'
)
f'int2lm @int2lm-3.00 %{nvidia_compiler} ^[email protected]%{nvidia_compiler}',
test_root='balfrin' not in machine_name())


@pytest.mark.no_tsa # Test is too expensive. It takes over 5h.
Expand All @@ -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
Expand All @@ -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')
Expand Down

0 comments on commit a38faf2

Please sign in to comment.