Skip to content

Commit

Permalink
Added case tests to CI setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
bartvstratum committed Oct 25, 2024
1 parent e8d4d01 commit 8220afc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 41 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ jobs:
pip3 install --user numpy netcdf4
# Configure and build without MPI
- name: Configure and build (no MPI)
- name: Configure and build DP + CPU
run: |
mkdir build_dp_cpu
cd build_dp_cpu
cmake -DSYST=ubuntu_20lts ..
make -j 4
cd ..
## Configure and build without MPI, in SP
#- name: Configure and build (no MPI)
# run: |
# mkdir build_dp_cpu
# cd build_dp_cpu
# cmake -DSYST=ubuntu_20lts -DUSESP=true ..
# make -j 4
# cd ..
# Configure and build without MPI, in SP
- name: Configure and build SP + CPU
run: |
mkdir build_sp_cpu
cd build_sp_cpu
cmake -DSYST=ubuntu_20lts -DUSESP=true ..
make -j 4
cd ..
## Configure and build with MPI
#- name: Configure and build (with MPI)
Expand All @@ -60,8 +60,8 @@ jobs:
# cd ..

# Run tests
#- name: Run tests
# run: |
# cd cases
# python3 run_travis.py
- name: Run tests
run: |
cd cases
python3 run_ci_tests.py
49 changes: 21 additions & 28 deletions cases/run_travis.py → cases/run_ci_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,19 @@
sys.path.append('../python/')
import microhh_tools as mht

modes = ['cpu', 'cpumpi']
precs = ['dp'] # ['dp', 'sp']
modes = ['cpu']
precs = ['dp', 'sp']

#
# Link executables to working directory
#
for prec in precs:
for mode in modes:
src = '../build_{}_{}/microhh'.format(prec, mode)
dst = 'microhh_{}_{}'.format(prec, mode)
if not os.path.exists(dst):
os.symlink(src, dst)

#
# Short tests of init + run phase, to test if cases start
#
les_cases = ['arm', 'bomex', 'drycblles', 'eady', 'gabls1', 'rico', 'sullivan2011'] # dycoms+lasso+rcemip missing
les_cases = ['arm', 'bomex', 'drycblles', 'gabls1', 'rico', 'sullivan2011'] # dycoms+lasso+rcemip missing
dns_cases = ['drycbl', 'ekman', 'drycblslope', 'moser180', 'moser600'] # prandtlslope missing

les_options = {
Expand Down Expand Up @@ -55,9 +51,8 @@
dns_options, mpi_options,
microhh_exec, mode, case, experiment)

#

# Restart tests for a DNS + LES case
#
no_stats = {
'stats': {'swstats': 0}, 'cross': {'swcross': 0}, 'column': {'swcolumn': 0}}

Expand All @@ -70,29 +65,27 @@

les_perturbations = {
'default': {},
'vapor': {'thermo': {'swthermo': 'vapor'}},
'fixed_basestate': {'thermo': {'swupdatebasestate': 0}},
'advec_2i3': {'advec': {'swadvec': '2i3'}},
'advec_2i4': {'advec': {'swadvec': '2i4'}}}
'advec_2i5': {'advec': {'swadvec': '2i5'}}}

les_options.update(no_stats)

#print('---------------------')
#print('Running restart tests')
#print('---------------------')
#
#for prec in precs:
# for mode in modes:
# microhh_exec = 'microhh_{}_{}'.format(prec, mode)
# experiment = '{}_{}'.format(prec, mode)
#
# err += mht.run_restart('drycbl',
# dns_options, mpi_options, dns_perturbations,
# microhh_exec, mode, 'drycbl', experiment)
#
# err += mht.run_restart('bomex',
# les_options, mpi_options, les_perturbations,
# microhh_exec, mode, 'bomex', experiment)
print('---------------------')
print('Running restart tests')
print('---------------------')

for prec in precs:
for mode in modes:
microhh_exec = 'microhh_{}_{}'.format(prec, mode)
experiment = '{}_{}'.format(prec, mode)

err += mht.run_restart('drycbl',
dns_options, mpi_options, dns_perturbations,
microhh_exec, mode, 'drycbl', experiment)

err += mht.run_restart('bomex',
les_options, mpi_options, les_perturbations,
microhh_exec, mode, 'bomex', experiment)

if err > 0:
sys.exit('One of more travis case tests failed!')

0 comments on commit 8220afc

Please sign in to comment.