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

Last change on this file since 2823 was 2823, checked in by ksherdy, 7 years ago

Updated perf script.

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