EPCCed / epcc-reframe

Repository for Reframe configuration and tests for EPCC systems
GNU General Public License v3.0
6 stars 14 forks source link

Update existing tests to use new parameterisation setup #12

Closed aturner-epcc closed 1 year ago

aturner-epcc commented 2 years ago

ReFrame has changed how parameterised tests are specified in more recent versions and existing tests need to be updated to use the new syntax. Documentation on the new syntax can be found at:

https://reframe-hpc.readthedocs.io/en/stable/tutorial_advanced.html

JPRichings commented 1 year ago

Current list of warnings from the most recent run from /work/z19/shared/reframe-checks/slurm-3010380.out

1) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/compile/hello/hello.py:5: WARNING: the @parameterized_test decorator is deprecated; please use the parameter() built-in instead @rfm.parameterized_test(['c'],['cpp'],['f90'])

2) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/synth/dstream/dstream.py:62: WARNING: using the @rfm.run_before decorator from the rfm module is deprecated; please use the built-in decorator @run_before instead. @rfm.run_before('run')

3) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/env/mpi.py:10: WARNING: the '@required_version' decorator is deprecated; please set the 'require_version' parameter in the class definition instead @rfm.required_version('>=2.14')

4) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/env/mpi.py:10: WARNING: the version string '2.14' is deprecated; please use the conformant '2.14.0' @rfm.required_version('>=2.14')

5) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/env/mpi.py:11: WARNING: the @parameterized_test decorator is deprecated; please use the parameter() built-in instead @rfm.parameterized_test(['single'], ['funneled'], ['serialized'], ['multiple'])

6) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/env/mpi.py:89: WARNING: using the @sn.sanity_function decorator from the sn module is deprecated; please use the built-in decorator @deferrable instead. def num_tasks_assigned(self):

7) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/env/module_check.py:41: WARNING: using the @sn.sanity_function decorator from the sn module is deprecated; please use the built-in decorator @deferrable instead. def env_module_patt(self):

8) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/apps/cp2k/cp2k_check.py:70: WARNING: using the @rfm.run_before decorator from the rfm module is deprecated; please use the built-in decorator @run_before instead. @rfm.run_before('run')

9) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/affinity/affinity_check.py:17: WARNING: using the @rfm.run_before decorator from the rfm module is deprecated; please use the built-in decorator @run_before instead. @rfm.run_before('sanity')

10) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/affinity/affinity_check.py:38: WARNING: the @parameterized_test decorator is deprecated; please use the parameter() built-in instead @rfm.parameterized_test(['omp_bind_threads'])

11) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/affinity/affinity_check.py:58: WARNING: using the @rfm.run_before decorator from the rfm module is deprecated; please use the built-in decorator @run_before instead. @rfm.run_before('run')

12) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/affinity/affinity_check.py:69: WARNING: the @parameterized_test decorator is deprecated; please use the parameter() built-in instead @rfm.parameterized_test(['fully_populated_nosmt'],

13) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/affinity/affinity_check.py:105: WARNING: using the @rfm.run_before decorator from the rfm module is deprecated; please use the built-in decorator @run_before instead. @rfm.run_before('run')

14) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/libs/blas/blas.py:4: WARNING: the @parameterized_test decorator is deprecated; please use the parameter() built-in instead @rfm.parameterized_test(['libsci'],['mkl'])

15) /mnt/lustre/a2fs-work1/work/y07/shared/utils/core/epcc-reframe/tests/known-issues/gcc-mpi_f08/gcc-mpi_f08.py:12: WARNING: the @parameterized_test decorator is deprecated; please use the parameter() built-in instead @rfm.parameterized_test(['f90'])

JPRichings commented 1 year ago

This is a list of all of the types of changes to syntax we need to make:

1) @rfm.parameterized_test => use built in parameter() function 2) @rfm.run_before => @run_before change in decorator 3) @rfm.required_version => set required version parameter in the class definition 4) Version string 2.14 is deprecated use 2.14.0 format. 5) @sn.sanity_function => @deferrable change of decorator

JPRichings commented 1 year ago

Solution to @rfm.parameterized_test => use built in parameter() function

replace @rfm.parameterized_test with @rfm.simpl_test and add a new variable to the class X = parameter()

e.g. BLAS

@rfm.simple_test
class BlasTest(rfm.RegressionTest):
    variant = parameter(['libsci', 'mkl'])
JPRichings commented 1 year ago

Additional warnings when running with version 4.0.4

1) WARNING: skipping test file '/mnt/lustre/a2fs-work2/work/z19/z19/jpr/Projects/Reframe/epcc-reframe/tests/utils/xthi/hetjob.py': name error: ../../epcc-reframe/tests/utils/xthi/hetjob.py:46: name 'self' is not defined 'qos': {'qos': 'standard'} (rerun with '-v' for more information)

2) WARNING: skipping test 'LAMMPSARCHER2LargeCheck': attribute error: ../../epcc-reframe/tests/apps/lammps/dipole_large.py:46: can't set attribute self.name = 'LAMMPS_1024node_ARCHER2_test' (rerun with '-v' for more information)

3) WARNING: skipping test 'GromacsCPUCheck': attribute error: ../../epcc-reframe/tests/apps/gromacs/gromacs_check.py:49: can't set attribute self.name = 'gromacs_cpu_check' (rerun with '-v' for more information)

4) WARNING: skipping test 'CASTEPCPUCheck': attribute error: ../../epcc-reframe/tests/apps/castep/castep_check.py:49: can't set attribute self.name = 'castep_cpu_check' (rerun with '-v' for more information)

5) /mnt/lustre/a2fs-work2/work/z19/z19/jpr/Projects/Reframe/epcc-reframe/tests/apps/cp2k/cp2k_check.py:59: WARNING: the use of 'variables' is deprecated; please use 'env_vars' instead 'OMP_PLACES': 'cores'

6) WARNING: skipping test file '/mnt/lustre/a2fs-work2/work/z19/z19/jpr/Projects/Reframe/epcc-reframe/tests/synth/mpi_osu/osu_benchmarks.py': name error: ../../epcc-reframe/tests/synth/mpi_osu/osu_benchmarks.py:23: name 'self' is not defined 'qos': {'qos': 'standard'} (rerun with '-v' for more information)

7) /mnt/lustre/a2fs-work2/work/z19/z19/jpr/Projects/Reframe/epcc-reframe/tests/affinity/affinity_check.py:69: WARNING: the use of 'variables' is deprecated; please use 'env_vars' instead 'OMP_PLACES': self.cases[self.variant]['OMP_PLACES']

8) /mnt/lustre/a2fs-work2/work/z19/z19/jpr/Projects/Reframe/epcc-reframe/tests/affinity/affinity_check.py:69: WARNING: the use of 'variables' is deprecated; please use 'env_vars' instead 'OMP_PLACES': self.cases[self.variant]['OMP_PLACES']

9) /mnt/lustre/a2fs-work2/work/z19/z19/jpr/Projects/Reframe/epcc-reframe/tests/affinity/affinity_check.py:69: WARNING: the use of 'variables' is deprecated; please use 'env_vars' instead 'OMP_PLACES': self.cases[self.variant]['OMP_PLACES']

10) /mnt/lustre/a2fs-work2/work/z19/z19/jpr/Projects/Reframe/epcc-reframe/tests/utils/xthi/hetjob.py:43: WARNING: the use of 'variables' is deprecated; please use 'env_vars' instead self.variables = {"OMP_PLACES": "cores"}

11) /mnt/lustre/a2fs-work2/work/z19/z19/jpr/Projects/Reframe/epcc-reframe/tests/utils/xthi/hetjob.py:80: WARNING: the use of 'variables' is deprecated; please use 'env_vars' instead self.variables = {"OMP_PLACES": "cores"}

12) /mnt/lustre/a2fs-work2/work/z19/z19/jpr/Projects/Reframe/epcc-reframe/tests/apps/lammps/dipole_large.py:54: WARNING: the use of 'variables' is deprecated; please use 'env_vars' instead 'OMP_NUM_THREADS': str(self.num_cpus_per_task)

13) /mnt/lustre/a2fs-work2/work/z19/z19/jpr/Projects/Reframe/epcc-reframe/tests/apps/gromacs/gromacs_check.py:58: WARNING: the use of 'variables' is deprecated; please use 'env_vars' instead 'OMP_NUM_THREADS': str(self.num_cpus_per_task)

14) /mnt/lustre/a2fs-work2/work/z19/z19/jpr/Projects/Reframe/epcc-reframe/tests/apps/cp2k/cp2k_check.py:59: WARNING: the use of 'variables' is deprecated; please use 'env_vars' instead 'OMP_PLACES': 'cores'

JPRichings commented 1 year ago

Soultion to @rfm.required_version => set required version parameter in the class definition

replace decorator with class parameter; def __init__(self, require_version='>=2.14.0'):

JPRichings commented 1 year ago

list of additional syntax changes

1) use of 'variables' is deprecated; please use 'env_vars' instead

2) can't set attribute self.name => name read only