-
Notifications
You must be signed in to change notification settings - Fork 188
/
runner.sh
64 lines (56 loc) · 2.04 KB
/
runner.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
#!/usr/bin/env bash
#
# Copyright (C) 2018-2022 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ESPResSo is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
abort() {
echo "An error occurred in runner.sh, exiting now" >&2
echo "Command that failed: ${BASH_COMMAND}" >&2
exit 1
}
trap abort EXIT
set -e
# manage configuration files with different features
configs="maxset.hpp default.hpp empty.hpp"
cp ../maintainer/configs/empty.hpp .
cp ../src/config/myconfig-default.hpp default.hpp
cp ../maintainer/configs/maxset.hpp .
# process configuration files
for config in ${configs}; do
# add minimal features for the benchmarks to run
sed -i '1 i\#define ELECTROSTATICS\n#define LENNARD_JONES\n#define MASS\n' "${config}"
# remove checks
sed -ri "/#define\s+ADDITIONAL_CHECKS/d" "${config}"
done
cat > benchmarks.csv << EOF
"config","script","arguments","cores","mean","ci","nsteps","duration","label"
EOF
# run benchmarks
for config in ${configs}; do
echo "### ${config}" | tee -a benchmarks.log
cp ${config} myconfig.hpp
rm -rf src/ maintainer/
cmake -D ESPRESSO_BUILD_BENCHMARKS=ON -D ESPRESSO_TEST_TIMEOUT=1200 -D ESPRESSO_BUILD_WITH_CUDA=OFF -D ESPRESSO_BUILD_WITH_WALBERLA=ON -D ESPRESSO_BUILD_WITH_CCACHE=OFF ..
make -j$(nproc)
rm -f benchmarks.csv.part
touch benchmarks.csv.part
make benchmark 2>&1 | tee -a benchmarks.log
sed -ri "s/^/\"$(basename ${config})\",/" benchmarks.csv.part
cat benchmarks.csv.part >> benchmarks.csv
done
rm benchmarks.csv.part
trap : EXIT