-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmesa-run-test-suite.sh
76 lines (54 loc) · 1.85 KB
/
mesa-run-test-suite.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
#SBATCH -N 1
#SBATCH -c 12
#SBATCH -t 6:00:00
#SBATCH --mem 16gb
#SBATCH -J mesatestmod
#SBATCH --no-requeue
#SBATCH --exclude=helios-cn007,helios-cn001
source ~/.bashrc
{
echo $SLURM_JOB_NODELIST
echo $SLURM_LOCALID
echo $SLURM_NODE_ALIASES
echo $SLURM_NODEID
echo $SLURM_JOB_ID
echo $SLURMD_NODENAME
echo $MESA_DIR
echo $MODULE $SLURM_ARRAY_TASK_ID
#Set variables
source ~/data/mesa/mesa-helios-test/mesa_vars.sh
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
# Where we will run one test case
mkdir -p /hddstore/rfarmer
export MESA_CACHES_DIR=$(mktemp -d -p /hddstore/rfarmer)
echo $MESA_CACHES_DIR
ID=$SLURM_ARRAY_TASK_ID
cd "${MESA_DIR}/${MODULE}/test_suite"
# Map id number to MESA test case name
folder=$(./list_tests $ID)
echo $folder $ID
# Skip optionals?
if [[ $SKIP_OPTS -eq 1 ]]; then
export MESA_SKIP_OPTIONAL=1
fi
# We want to run mesa on a local hard drive but store MESA_DIR
# on the network.
# This moves the folder onto the local hard drive,
# then soft links back to MESA_DIR so mesa_test does not get confused about missing test cases
# Then we need to fix the inlists now that we are running outside of MESA_DIR
mv "$folder" "${MESA_CACHES_DIR}/${folder}"
ln -sf "${MESA_CACHES_DIR}/${folder}" "${MESA_DIR}/${MODULE}/test_suite/${folder}"
sed -i '/mesa_dir/Id' "${folder}"/inlist*
sed -i '/^mesa_dir/Id' "${folder}/make/makefile"
sed -i '/^mesa_dir/Id' "${folder}/rn"
sed -i '/^mesa_dir/Id' "${folder}/ck"
if [[ $FPE_ON -eq 1 ]];then
export MESA_FPE_CHECKS_ON=1
fi
~/bin/mesa_test $MESA_TEST_VERSION test -m=$MODULE --mesadir=$MESA_DIR $ID
cp "${MESA_DIR}/${MODULE}/test_suite/${folder}/out.txt" "${OUT_FOLD}/${folder}".txt
cp "${MESA_DIR}/${MODULE}/test_suite/${folder}/err.txt" "${OUT_FOLD}/${folder}".err.txt
cp "${MESA_DIR}/${MODULE}/test_suite/${folder}/testhub.yml" "${OUT_FOLD}/${folder}".testhub.yml
rm -rf "${MESA_CACHES_DIR}"
}