source: CIVL/examples/omp/dataracebench-1.0.0/check-data-races.sh@ bd6628e

1.23 2.0 main test-branch
Last change on this file since bd6628e was a1acb0c5, checked in by Ziqing Luo <ziqing@…>, 9 years ago

Add the released version of DataRaceBench v1.0.0

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@4394 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100755
File size: 3.9 KB
Line 
1#!/usr/bin/env bash
2
3# Copyright (c) 2017, Lawrence Livermore National Security, LLC.
4# Produced at the Lawrence Livermore National Laboratory
5# Written by Chunhua Liao, Pei-Hung Lin, Joshua Asplund,
6# Markus Schordan, and Ian Karlin
7# (email: liao6@llnl.gov, lin32@llnl.gov, asplund1@llnl.gov,
8# schordan1@llnl.gov, karlin1@llnl.gov)
9# LLNL-CODE-732144
10# All rights reserved.
11#
12# This file is part of DataRaceBench. For details, see
13# https://github.com/LLNL/dataracebench. Please also see the LICENSE file
14# for our additional BSD notice
15#
16# Redistribution of Backstroke and use in source and binary forms, with
17# or without modification, are permitted provided that the following
18# conditions are met:
19#
20# * Redistributions of source code must retain the above copyright
21# notice, this list of conditions and the disclaimer below.
22#
23# * Redistributions in binary form must reproduce the above copyright
24# notice, this list of conditions and the disclaimer (as noted below)
25# in the documentation and/or other materials provided with the
26# distribution.
27#
28# * Neither the name of the LLNS/LLNL nor the names of its contributors
29# may be used to endorse or promote products derived from this
30# software without specific prior written permission.
31#
32# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
33# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
34# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
35# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36# DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL
37# SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE
38# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
39# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
40# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
42# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
43# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
44# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
45# THE POSSIBILITY OF SUCH DAMAGE.
46
47OPTION=$1
48TESTS=$(grep -l main micro-benchmarks/*.c)
49POLYFLAG="micro-benchmarks/utilities/polybench.c -I micro-benchmarks -I micro-benchmarks/utilities -DPOLYBENCH_NO_FLUSH_CACHE -DPOLYBENCH_TIME -D_POSIX_C_SOURCE=200112L"
50
51if [[ -z "$OPTION" || "$OPTION" == "--help" ]]; then
52 echo
53 echo "Usage: $0 [--run] [--help]"
54 echo
55 echo "--help : this option"
56 echo "--small : compile and test all benchmarks using small parameters with Helgrind, ThreadSanitizer, Archer, Intel inspector."
57 echo "--run : compile and run all benchmarks with gcc (no evaluation)"
58 echo "--helgrind : compile and test all benchmarks with Helgrind"
59 echo "--tsan : compile and test all benchmarks with clang ThreadSanitizer"
60 echo "--archer : compile and test all benchmarks with Archer"
61 echo "--inspector: compile and test all benchmarks with Intel Inspector"
62 echo
63 exit
64fi
65
66if [[ "$OPTION" == "--small" ]]; then
67 scripts/test-harness.sh -t 3 -n 2 -d 32 -x helgrind
68 scripts/test-harness.sh -t 3 -n 2 -d 32 -x archer
69 scripts/test-harness.sh -t 3 -n 2 -d 32 -x tsan
70 scripts/test-harness.sh -t 3 -n 2 -d 32 -x inspector-max-resources
71fi
72
73if [[ "$OPTION" == "--run" ]]; then
74 for test in $TESTS; do
75 echo "------------------------------------------"
76 echo "RUNNING: $test"
77 CFLAGS="-g -Wall -std=c99 -fopenmp -lm"
78 if grep -q 'PolyBench' "$test"; then CFLAGS+=" $POLYFLAG"; fi
79 gcc $CFLAGS "$test"
80 ./a.out > /dev/null
81 done
82 rm -f ./a.out
83 exit
84fi
85
86if [[ "$OPTION" == "--helgrind" ]]; then
87 scripts/test-harness.sh -x helgrind
88fi
89
90if [[ "$OPTION" == "--archer" ]]; then
91 scripts/test-harness.sh -x archer
92fi
93
94if [[ "$OPTION" == "--tsan" ]]; then
95 scripts/test-harness.sh -x tsan
96fi
97
98if [[ "$OPTION" == "--inspector" ]]; then
99 scripts/test-harness.sh -x inspector-max-resources
100fi
Note: See TracBrowser for help on using the repository browser.