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 74 75 76 77 78 79 80 81 82 83 84 85
|
#!/bin/sh
# This file is part of the Score-P software (http://www.score-p.org)
#
# Copyright (c) 2009-2011,
# * RWTH Aachen University, Germany
# * Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany
# * Technische Universitaet Dresden, Germany
# * University of Oregon, Eugene, USA
# * Forschungszentrum Juelich GmbH, Germany
# * German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
# * Technische Universitaet Muenchen, Germany
#
# See the COPYING file in the package base directory for details.
opari_dir=`pwd`
test_dir="../test/tmp"
mkdir -p ${test_dir}
test_data_dir=@abs_srcdir@/data
sed=@SED@
awk=@AWK@
#echo $test_data_dir
#echo $test_dir
cp $test_data_dir/test*.c $test_dir/
if [ ! -f $test_dir/replacePaths_c.awk ]; then
cp $test_data_dir/../replacePaths_c.awk $test_dir/
fi
cd $test_dir
for file in `ls *.c | grep -v mod`
do
base=`basename $file .c`
if [ -n "`echo $file | grep tpd`" ]
then
echo " $file testing --omp-tpd ..."
$opari_dir/opari2 --omp-tpd $file || exit
elif [ -n "`echo $file | grep prep`" ]
then
echo " $file testing --preprocessed ..."
$opari_dir/opari2 --preprocessed $file || exit
elif [ -n "`echo $file | grep remove-task`" ]
then
echo " $file testing --omp-task=remove ..."
$opari_dir/opari2 --omp-task=remove --omp-task-untied=no-warn $file || exit
else
echo " $file ..."
$opari_dir/opari2 --omp-task-untied=keep,no-warn $file || exit
fi
# Replace the full path in the line numbering
# in the source files
`$awk -f replacePaths_c.awk $base.mod.c > $base.mod.c.tmp`
`mv $base.mod.c.tmp $base.mod.c`
# Replace the full paths and unify timestamp based region identifiers
# in the include files
`$awk -f replacePaths_c.awk $base.c.opari.inc > $base.c.opari.inc.tmp`
`mv $base.c.opari.inc.tmp $base.c.opari.inc`
if diff -u $test_data_dir/$base.c.out $base.mod.c > /dev/null
then
true
else
echo "-------- ERROR: unexpected change in transformed program --------"
diff -u $test_data_dir/$base.c.out $base.mod.c
error="true"
continue
fi
if diff -u $test_data_dir/$base.c.opari.inc.out $base.c.opari.inc > /dev/null
then
true
else
echo "-------- ERROR: unexpected change in opari include file --------"
diff -u $test_data_dir/$base.c.opari.inc.out $base.c.opari.inc
error="true"
continue
fi
done
cd $opari_dir
if [ "$error" = "true" ]
then
exit -1
fi
|