2 # --------------------------------------------------------------------------
5 # Markus Wittmann, 2016-2017
6 # RRZE, University of Erlangen-Nuremberg, Germany
7 # markus.wittmann -at- fau.de or hpc -at- rrze.fau.de
10 # LSS, University of Erlangen-Nuremberg, Germany
12 # This file is part of the Lattice Boltzmann Benchmark Kernels (LbmBenchKernels).
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.
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.
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/>.
27 # --------------------------------------------------------------------------
30 Tmp="delme.test.sh.$(hostname).$$.tmp"
31 Binary="../bin/lbmbenchk-linux-intel-release"
38 if [ "$#" -ge "1" ]; then
45 if [ -e "$Tmp" ]; then
46 rm -f "$Tmp" 2>&1 || true
55 local K="$2" # Kernel name
56 local T="$3" # Number of threads
57 local KernelArgs="${4:-""}"
61 echo -n "$Binary -verify -kernel $K -t $T -pin $(seq -s , 0 $((T-1))) ${KernelArgs:+"-- "}$KernelArgs "
63 if [ "$KernelArgs" == "" ]; then
64 $Binary -verify -kernel $K -t $T -pin $(seq -s , 0 $((T-1))) > "$Tmp" 2>&1
66 $Binary -verify -kernel $K -t $T -pin $(seq -s , 0 $((T-1))) -- $KernelArgs > "$Tmp" 2>&1
71 if [ "$ExitCode" != "0" ]; then
74 echo "$Binary -verify -kernel $K"
75 echo "Verification failed. Exit code = $ExitCode."
84 for K in $("$Binary" -list | tail -n +7); do
86 for T in $(seq 1 $NThreads); do
88 run_kernel "$Binary" "$K" "$T"
90 # Check in the usage string, if the kernel accepts parameters for blocking.
92 $Binary -kernel $K -- -h > "$Tmp" 2>&1
94 LineParameterStart="$(grep -n "^Kernel parameters:" "$Tmp" | sed -e 's/:.*//')"
96 if [ "$LineParameterStart" == "" ]; then
100 tail -n +$LineParameterStart "$Tmp" | grep -q -- "-blk"
103 if [ "$ExitCode" == "0" ]; then
104 # Kernel supports blocking
105 run_kernel "$Binary" "$K" "$T" "-blk 7"
113 echo "# Tests toal: $TestsTotal succeeded: $TestsSucceeded failed: $TestsFailed"