Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use readonly_files #220

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions CI/run_reframe.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash
# Author: Caspar van Leeuwen
# Description: This script can be used to do regular runs of the ReFrame test suite, e.g. from a cronjob.
# Setup instructions: make sure you have your github access key configured in your .ssh/config
# i.e. configure an entry with HostName github.com and IdentityFile pointing to the ssh key registered with Github
# Setup instructions:
# 1) make sure you have your github access key configured in your .ssh/config
# i.e. configure an entry with HostName github.com and IdentityFile pointing to the ssh key registered with Github
# 2) set environment variable EESSI_CI_TEMPROOT, a path in a shared filesystem in which the temporary directory will be created
# if $EESSI_CI_TEMPROOT is not set, $HOME will be used.

# Print on which host this CI is running
echo "Running CI on host $(hostname)"
Expand All @@ -27,7 +30,7 @@ fi

# Create temporary directory
if [ -z "${TEMPDIR}" ]; then
TEMPDIR=$(mktemp --directory --tmpdir=/tmp -t rfm.XXXXXXXXXX)
TEMPDIR=$(mktemp --directory --tmpdir=${EESSI_CI_TEMPROOT:-HOME} -t rfm.XXXXXXXXXX)
fi

# Set the CI configuration for this system
Expand Down
4 changes: 2 additions & 2 deletions eessi/testsuite/common_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

import reframe.core.logging as rlog
import reframe.core.logging as rflog

perflog_format = '|'.join([
'%(check_job_completion_time)s',
Expand Down Expand Up @@ -97,7 +97,7 @@ def common_eessi_init(eessi_version=None):
eessi_cvmfs_repo = os.getenv('EESSI_CVMFS_REPO', None)

if eessi_cvmfs_repo is None:
rlog.getlogger().warning('\n'.join([
rflog.getlogger().warning(' '.join([
"Environment variable 'EESSI_CVMFS_REPO' is not defined.",
"If you do not intend to use the EESSI software stack, this is perfectly fine.",
"To use EESSI, initialize the EESSI environment before running the test suite.",
Expand Down
8 changes: 8 additions & 0 deletions eessi/testsuite/eessi_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ def __init_subclass__(cls, **kwargs):
cls.valid_systems = ['*']
if not cls.time_limit:
cls.time_limit = '1h'
if not cls.readonly_files:
msg = ' '.join([
"Built-in attribute `readonly_files` is empty. To avoid excessive duplication, it's highly recommended",
"to add all files and/or dirs in `sourcesdir` that are needed but not modified during the test,",
"thus can be symlinked into the stage dir. If you are sure there are no such files,",
"set `readonly_files = ['']`.",
])
raise ReframeFatalError(msg)

# Helper function to validate if an attribute is present it item_dict.
# If not, print it's current name, value, and the valid_values
Expand Down
2 changes: 2 additions & 0 deletions eessi/testsuite/tests/apps/MetalWalls.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class EESSI_MetalWalls_MW(MetalWallsCheck):
valid_systems = ['*']
valid_prog_environs = ['default']
time_limit = '60m'
# input files are downloaded
readonly_files = ['']

module_name = parameter(find_modules('MetalWalls'))
# For now, MetalWalls is being build for CPU targets only
Expand Down
1 change: 1 addition & 0 deletions eessi/testsuite/tests/apps/PyTorch/PyTorch_torchvision.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class EESSI_PyTorch_torchvision(rfm.RunOnlyRegressionTest):
valid_systems = ['*']

time_limit = '30m'
readonly_files = ['get_free_socket.py', 'pytorch_synthetic_benchmark.py']

@run_after('init')
def prepare_test(self):
Expand Down
Empty file.
1 change: 1 addition & 0 deletions eessi/testsuite/tests/apps/QuantumESPRESSO.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class EESSI_QuantumESPRESSO_PW(QEspressoPWCheck):
# For now, QE is being build for CPU targets only
# compute_device = parameter([DEVICE_TYPES[CPU], DEVICE_TYPES[GPU]])
compute_device = parameter([DEVICE_TYPES[CPU], ])
readonly_files = ['']

@run_after('init')
def run_after_init(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Input files for the CP2K test
# Input files for the CP2K test in src/QS

The following input files have been copied from the v2024.1 sources under benchmarks/QS,
but with `&SCF` option `IGNORE_CONVERGENCE_FAILURE` commented out as this option is only supported in versions >= 2023.1
Expand Down
8 changes: 3 additions & 5 deletions eessi/testsuite/tests/apps/cp2k/cp2k.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import reframe as rfm
from reframe.core.builtins import parameter, run_after, performance_function, sanity_function, fixture
from reframe.core.builtins import parameter, run_after, performance_function, sanity_function
import reframe.utility.sanity as sn

from eessi.testsuite.constants import SCALES, COMPUTE_UNIT, DEVICE_TYPES, CPU
from eessi.testsuite.eessi_mixin import EESSI_Mixin
from eessi.testsuite.utils import find_modules
from eessi.testsuite.tests.apps.cp2k.cp2k_staging.cp2k_stage_input import EESSI_CP2K_stage_input


@rfm.simple_test
class EESSI_CP2K(rfm.RunOnlyRegressionTest, EESSI_Mixin):

stage_files = fixture(EESSI_CP2K_stage_input, scope='session')

benchmark_info = parameter([
# (bench_name, energy_ref, energy_tol)
('QS/H2O-32', -550.5055, 1e-4),
Expand All @@ -28,6 +25,7 @@ class EESSI_CP2K(rfm.RunOnlyRegressionTest, EESSI_Mixin):
device_type = DEVICE_TYPES[CPU]
compute_unit = COMPUTE_UNIT[CPU]
bench_name_ci = 'QS/H2O-32' # set CI on smallest benchmark
readonly_files = ['QS']

def required_mem_per_node(self):
mems = {
Expand All @@ -45,7 +43,7 @@ def set_bench_name(self):

@run_after('setup')
def prepare_test(self):
self.executable_opts += ['-i', f'{self.stage_files.stagedir}/{self.bench_name}.inp']
self.executable_opts += ['-i', f'{self.bench_name}.inp']

@sanity_function
def assert_energy(self):
Expand Down
24 changes: 0 additions & 24 deletions eessi/testsuite/tests/apps/cp2k/cp2k_staging/cp2k_stage_input.py

This file was deleted.

4 changes: 4 additions & 0 deletions eessi/testsuite/tests/apps/espresso/espresso.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ class EESSI_ESPRESSO_P3M_IONIC_CRYSTALS(EESSI_ESPRESSO):
time_limit = '300m'

executable = 'python3 madelung.py'
sourcesdir = 'src/p3m'
readonly_files = ['madelung.py']

default_weak_scaling_system_size = 6

Expand Down Expand Up @@ -161,6 +163,8 @@ class EESSI_ESPRESSO_LJ_PARTICLES(EESSI_ESPRESSO):
time_limit = '300m'

executable = 'python3 lj.py'
sourcesdir = 'src/lj'
readonly_files = ['lj.py']

@run_after('init')
def set_tag_ci(self):
Expand Down
Empty file.
2 changes: 2 additions & 0 deletions eessi/testsuite/tests/apps/gromacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class EESSI_GROMACS(EESSI_GROMACS_base, EESSI_Mixin):
time_limit = '30m'
module_name = parameter(find_modules('GROMACS'))
bench_name_ci = 'HECBioSim/Crambin'
# input files are downloaded
readonly_files = ['']

def required_mem_per_node(self):
return self.num_tasks_per_node * 1024
Expand Down
20 changes: 5 additions & 15 deletions eessi/testsuite/tests/apps/lammps/lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
from eessi.testsuite.constants import * # noqa
from eessi.testsuite.eessi_mixin import EESSI_Mixin

from eessi.testsuite.tests.apps.lammps.lammps_staging.lammps_stage_input import EESSI_LAMMPS_stage_input


class EESSI_LAMMPS_base(rfm.RunOnlyRegressionTest, EESSI_Mixin):
class EESSI_LAMMPS_base(rfm.RunOnlyRegressionTest):
time_limit = '30m'
device_type = parameter([DEVICE_TYPES[CPU], DEVICE_TYPES[GPU]])

Expand Down Expand Up @@ -64,10 +62,11 @@ def set_compute_unit(self):


@rfm.simple_test
class EESSI_LAMMPS_lj(EESSI_LAMMPS_base):
class EESSI_LAMMPS_lj(EESSI_LAMMPS_base, EESSI_Mixin):
tags = {TAGS['CI']}

sourcesdir = 'src/lj'
readonly_files = ['in.lj']
executable = 'lmp -in in.lj'

@deferrable
Expand Down Expand Up @@ -125,19 +124,10 @@ def set_executable_opts(self):


@rfm.simple_test
class EESSI_LAMMPS_rhodo(EESSI_LAMMPS_base):
class EESSI_LAMMPS_rhodo(EESSI_LAMMPS_base, EESSI_Mixin):
sourcesdir = 'src/rhodo'
executable = 'lmp -in in.rhodo'

stage_input = fixture(EESSI_LAMMPS_stage_input, scope='session')

@run_after('setup')
def symlink_lammps_data(self):
'''Create a symlink to the data.rhodo file staged by the EESSI_LAMMPS_stage_input fixture.
Lammps needs this in the current working directory'''
self.prerun_cmds = [
f'ln -s {self.stage_input.stagedir}/rhodo/data.rhodo data.rhodo'
]
readonly_files = ['data.rhodo', 'in.rhodo']

@deferrable
def check_number_neighbors(self):
Expand Down

This file was deleted.

Empty file.
1 change: 1 addition & 0 deletions eessi/testsuite/tests/apps/osu.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class EESSI_OSU_Micro_Benchmarks_pt2pt(osu_benchmark):
device_type = parameter([DEVICE_TYPES[CPU], DEVICE_TYPES[GPU]])
# unset num_tasks_per_node from the hpctestlib.
num_tasks_per_node = None
readonly_files = ['']

# Set num_warmup_iters to 5 to reduce execution time, especially on slower interconnects
num_warmup_iters = 5
Expand Down
Empty file.
1 change: 1 addition & 0 deletions eessi/testsuite/tests/apps/tensorflow/tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class EESSI_TensorFlow(rfm.RunOnlyRegressionTest):
device_type = parameter(['cpu', 'gpu'])

executable = 'python tf_test.py'
readonly_files = ['mnist_setup.py', 'tf_test.py']

time_limit = '30m'

Expand Down
Loading