merge with kernels from MH's master thesis
[LbmBenchmarkKernelsPublic.git] / src / test.sh
CommitLineData
10988083
MW
1#!/bin/bash -l
2# --------------------------------------------------------------------------
3#
4# Copyright
5# Markus Wittmann, 2016-2017
6# RRZE, University of Erlangen-Nuremberg, Germany
7# markus.wittmann -at- fau.de or hpc -at- rrze.fau.de
8#
9# Viktor Haag, 2016
10# LSS, University of Erlangen-Nuremberg, Germany
11#
12# This file is part of the Lattice Boltzmann Benchmark Kernels (LbmBenchKernels).
13#
14# LbmBenchKernels is free software: you can redistribute it and/or modify
15# it under the terms of the GNU General Public License as published by
16# the Free Software Foundation, either version 3 of the License, or
17# (at your option) any later version.
18#
19# LbmBenchKernels is distributed in the hope that it will be useful,
20# but WITHOUT ANY WARRANTY; without even the implied warranty of
21# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22# GNU General Public License for more details.
23#
24# You should have received a copy of the GNU General Public License
25# along with LbmBenchKernels. If not, see <http://www.gnu.org/licenses/>.
26#
27# --------------------------------------------------------------------------
28set -u
29set -e
30
31XTag="-test"
32
0fde6e45
MW
33# How many parallel processes during make.
34NProc="10"
35
10988083
MW
36Build=release
37
483c13d2
MW
38if [ "$#" -lt 1 ]; then
39 echo "Compiles and runs several test cases."
40 echo ""
41 echo "Usage: test.sh <config>"
42 echo ""
43 echo "Select a configuration via config: linux-gcc or linux-intel."
44 exit 1
45fi
46
47if [ "$1" == "-h" -o "$1" == "-help" -o "$1" == "--help" ]; then
48 echo "Compiles and runs several test cases."
49 echo ""
50 echo "Usage: test.sh <config>"
51 echo ""
52 echo "Select a configuration via config: linux-gcc or linux-intel."
53 exit 1
54fi
55
56Config="$1"
10988083 57
8cafd9ea
MW
58# make clean-all
59#
60# make -j $NProc PRECISION=dp CONFIG=$Config TAG=$XTag-debug
61# make -j $NProc PRECISION=dp CONFIG=$Config BUILD=$Build TAG=$XTag-v VERIFICATION=on
62# make -j $NProc PRECISION=dp CONFIG=$Config BUILD=$Build TAG=$XTag-b BENCHMARK=on
63#
64# BinaryVDp="../bin/lbmbenchk-$Config-$Build-dp$XTag-v"
65# BinaryBDp="../bin/lbmbenchk-$Config-$Build-dp$XTag-b"
0fde6e45
MW
66
67
68make -j $NProc PRECISION=sp CONFIG=$Config TAG=$XTag-debug
69make -j $NProc PRECISION=sp CONFIG=$Config BUILD=$Build TAG=$XTag-v VERIFICATION=on
70make -j $NProc PRECISION=sp CONFIG=$Config BUILD=$Build TAG=$XTag-b BENCHMARK=on
71
72BinaryVSp="../bin/lbmbenchk-$Config-$Build-sp$XTag-v"
73BinaryBSp="../bin/lbmbenchk-$Config-$Build-sp$XTag-b"
74
75
76echo "#"
77echo "# [test.sh] ./test-verification.sh \"$BinaryVDp\""
78echo "#"
79
80./test-verification.sh "$BinaryVDp"
81
82ExitCodeDp="$?"
83
84echo "#"
85echo "# [test.sh] ./test-verification.sh \"$BinaryVSp\""
86echo "#"
87
88./test-verification.sh "$BinaryVSp"
89
90ExitCodeSp="$?"
91
92ResultDp="errors occurred"
93ResultSp="errors occurred"
94
95if [ "$ExitCodeDp" == "0" ]; then ResultDp="OK"; fi
96if [ "$ExitCodeSp" == "0" ]; then ResultSp="OK"; fi
97
98echo "#"
99echo "# [test.sh] test double precision: $ResultDp single precision: $ResultSp"
100echo "#"
101
102ExitCode="0"
103
104if [ "$ExitCodeDp" != 0 -o "$ExitCodeSp" != 0 ]; then
105 ExitCode="1"
106fi
107
108exit "$ExitCode"
10988083 109
This page took 0.093816 seconds and 5 git commands to generate.