Skip to content

Commit

Permalink
Merge pull request #46 from RuiApostolo/20240906_module_paths
Browse files Browse the repository at this point in the history
Adds module path test
  • Loading branch information
JPRichings authored Sep 20, 2024
2 parents 6d7cdaa + e079c59 commit 518b122
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Python Black
uses: cytopia/[email protected]
- uses: psf/black@stable
with:
path: 'tests/'
options: "--check --verbose"
src: "./tests/"
6 changes: 3 additions & 3 deletions tests/apps/lammps/ethanol.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def setup_nnodes(self):
@run_after("setup")
def setup_gpu_options(self):
"""sets up different resources for gpu systems"""
self.env_vars[
"PARAMS"
] = f'"--exclusive --ntasks={self.num_tasks_per_node} --tasks-per-node={self.num_tasks_per_node}"'
self.env_vars["PARAMS"] = (
f'"--exclusive --ntasks={self.num_tasks_per_node} --tasks-per-node={self.num_tasks_per_node}"'
)
# Cirru slurm demands it be done this way.
# Trying to add $PARAMS directly to job.launcher.options fails.
if self.current_system.name in ["cirrus"]:
Expand Down
1 change: 1 addition & 0 deletions tests/apps/lammps/exaalt_ref.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ReFrame script for lammps dipole test"""

import reframe as rfm

from lammps_base import LAMMPSBase
Expand Down
1 change: 1 addition & 0 deletions tests/apps/lammps/exaalt_small.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ReFrame script for lammps dipole test"""

import reframe as rfm

from lammps_base import LAMMPSBase
Expand Down
1 change: 1 addition & 0 deletions tests/apps/lammps/lammps_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ReFrame base module for LAMMPS tests"""

import reframe as rfm
import reframe.utility.sanity as sn

Expand Down
1 change: 1 addition & 0 deletions tests/compile/hello/hello.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Compilation tests"""

import reframe as rfm
import reframe.utility.sanity as sn

Expand Down
1 change: 1 addition & 0 deletions tests/k8s/cuda_job.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""k8s cuda job tests"""

import reframe as rfm
import reframe.utility.sanity as sn

Expand Down
81 changes: 81 additions & 0 deletions tests/modules/module_paths.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/usr/bin/env python3
"""Reframe test to whether module locations are readable"""

import reframe as rfm
import reframe.utility.sanity as sn


class ModulePathTestBase(rfm.RunOnlyRegressionTest):
"""Checks if module file locations are readable"""

descr = "Check that all module file locations are readable" ""
valid_prog_environs = ["Default"]
sourcesdir = None
executable = "test -r"
maintainers = ["[email protected]"]

@sanity_function
def assert_exists(self):
"""Checks exit code"""
return sn.assert_eq(self.job.exitcode, 0)


class ARCHER2Paths(rfm.RegressionMixin):
"""Mixin class with ARCHER2 paths"""

path = parameter(
[
"/work/y07/shared/archer2-lmod/utils/compiler/crayclang/10.0", # Darshan
"/work/y07/shared/archer2-lmod/python/core", # python
"/work/y07/shared/archer2-lmod/libs/core", # cse libraries
"/work/y07/shared/archer2-lmod/apps/core", # cse apps
"/work/y07/shared/archer2-lmod/utils/core", # cse utils
"/opt/cray/pe/lmod/modulefiles/mpi/crayclang/14.0/ofi/1.0/cray-mpich/8.0", # cray parallel hdf5/netcdf
"/opt/cray/pe/lmod/modulefiles/comnet/crayclang/14.0/ofi/1.0", # cray mpich
"/opt/cray/pe/lmod/modulefiles/compiler/crayclang/14.0", # cray hdf5
"/opt/cray/pe/lmod/modulefiles/mix_compilers", # cray mixed compilers
"/opt/cray/pe/lmod/modulefiles/perftools/22.12.0", # cray performance tools
"/opt/cray/pe/lmod/modulefiles/net/ofi/1.0", # cray openshmem
"/opt/cray/pe/lmod/modulefiles/cpu/x86-rome/1.0", # cray fftw
"/opt/cray/pe/lmod/lmod/modulefiles/Core", # cray lmod
"/opt/cray/pe/lmod/modulefiles/core", # cray PrgEnvs and libsci
"/opt/cray/pe/lmod/modulefiles/craype-targets/default", # cray targets
"/usr/local/share/modulefiles", # epcc module
"/opt/cray/modulefiles", # cray lustre and rocm
]
)


class CirrusPaths(rfm.RegressionMixin):
"""Mixin class with cirrus paths"""

path = parameter(
[
"/work/y07/shared/cirrus-modulefiles", # epcc modules
"/usr/share/Modules/modulefiles", # default
]
)


@rfm.simple_test
class ModulePathTestARCHER2(ModulePathTestBase, ARCHER2Paths):
"""ARCHER2 test class"""

valid_systems = ["archer2:login"]

@run_after("init")
def setup_path(self):
"""add path to exe"""
self.executable_opts = [self.path]


@rfm.simple_test
class ModulePathTestCirrus(ModulePathTestBase, CirrusPaths):
"""Cirrus test class"""

valid_systems = ["cirrus:login"]

@run_after("init")
def setup_path(self):
"""add path to exe"""
self.executable_opts = [self.path]
2 changes: 0 additions & 2 deletions tests/utils/xthi/hetjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

@rfm.simple_test
class SharedCommWorldTest(rfm.RunOnlyRegressionTest):

"""
SLURM hetjob with 3 nodes (no OpenMP) as per first example
https://docs.archer2.ac.uk/user-guide/scheduler/#heterogeneous-jobs
Expand Down Expand Up @@ -50,7 +49,6 @@ def sanity_check_run(self):

@rfm.simple_test
class SharedCommWorldWithOpenMPTest(rfm.RunOnlyRegressionTest):

"""
SLURM hetjob with shared MPI_COMM_WORLD and OpenMP as per
the mixed MPI/OpenMP example at
Expand Down

0 comments on commit 518b122

Please sign in to comment.