source: proto/gml2svg/C/xerces/perf.sh @ 2827

Last change on this file since 2827 was 2827, checked in by ksherdy, 6 years ago

Updated test script.

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1#!/bin/bash
2#
3# File:         perf.sh
4#
5# Author:       Ken Herdy
6#               ksherdy@sfu.ca
7#
8# Desc:         Execute make_papi_events.sh to create 'papi_events.dat'.
9#
10#
11#
12GML_DIR="../../data/layer/gml-10"
13PAPI_EVENTS_DAT="papi_events.dat"
14NO_ARGS=0
15E_OPTERROR=85
16USAGE="Usage: `basename $0` [-x Xerces 3.1.1  | -i ICXML | -p Pipeline ICXML]"
17
18if [ $# -eq "$NO_ARGS" ]    # Script invoked with no command-line args
19then
20  echo $USAGE
21  exit $E_OPTERROR          # Exit and explain usage.
22                            # Usage: scriptname -options
23                            # Note: dash (-) necessary
24fi 
25
26OPTION=""
27
28while getopts ":xip" Option
29do
30  case $Option in
31    x     ) OPTION=$Option;;
32    i     ) OPTION=$Option;;
33    p     ) OPTION=$Option;;
34    *     ) echo "Invalid option."; echo $USAGE; exit $E_OPTERROR;   # Default.
35  esac
36done
37
38
39if [ $OPTION = "x" ] ; then
40        echo "Testing Xerces 3.1.1"
41
42        APP="gml2svg_3_1_1"
43        APP_TARGET="xerces_3_1_1"
44        LIB_PATH="/home/ksherdy/Temp/xerces-c-3.1.1/src/.libs"
45        SVG_DIR="svg_3_1_1"
46        CC_DIR="cc_3_1_1"
47        CC_RSLT="cc_3_1_1.txt"
48
49elif [ $OPTION = "i" ] ; then
50        echo "Testing ICXML"
51
52        APP="gml2svg_icx"
53        APP_TARGET="xerces_icx"
54        LIB_PATH="/home/ksherdy/Temp/icxml/xerces/src/.libs"
55        SVG_DIR="svg_icx"
56        CC_DIR="cc_icx"
57        CC_RSLT="cc_icx.txt"
58
59elif [ $OPTION = "p" ] ; then
60        echo "Testing Pipelined ICXML"
61
62        APP="gml2svg_icx_pipeline"
63        APP_TARGET="xerces_icx_pipeline"
64        LIB_PATH="/home/ksherdy/Temp/picxml/src-pipeline/xerces/src/.libs"
65        SVG_DIR="svg_icx_pipeline"
66        CC_DIR="cc_icx_pipeline"
67        CC_RSLT="cc_icx_pipeline.txt"
68
69fi
70
71PAPI_EVENTS=`grep -v -e '^#\|^$' $PAPI_EVENTS_DAT` # an event code per line
72
73CC_ANALYZER="../parabix/cc_analyzer"
74
75# sanity checks
76
77if ( ! [ -f $CC_ANALYZER ] ) ; then
78                echo "Error: cc_analyzer not found."   
79                exit
80fi
81
82if ( ! [ -x $CC_ANALYZER ] ) ; then
83                echo "Error: cc_analyzer not executable."       
84                exit
85fi
86
87if (! [ -d $LIB_PATH ] ) ; then
88                echo "Error: $LIB_PATH not found."
89                exit
90fi
91
92for papi_event in $PAPI_EVENTS;
93do
94        #compile
95        CC_EVENT=$papi_event
96        export CC_EVENT
97
98        #execute
99        make $APP_TARGET
100        export LD_LIBRARY_PATH=$LIB_PATH #":$LD_LIBRARY_PATH"
101        ./$APP $GML_DIR $SVG_DIR $papi_event
102       
103done
104
105#analyze
106rm -Rf $CC_RSLT
107touch $CC_RSLT
108rm -Rf $CC_DIR
109mv -f ".cc" $CC_DIR # update dir name to stop a clobbering
110CC_FILES=`ls $CC_DIR`
111
112for cc_file in $CC_FILES;       
113do
114                $CC_ANALYZER $CC_DIR/$cc_file -r -c -p >> $CC_RSLT
115done
116
117echo -n "Result file: "
118echo $CC_RSLT
119
120echo "Perf test complete."
121
122
123
124
125
126
127
Note: See TracBrowser for help on using the repository browser.