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

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

Modified perf.sh script to avoid per run compilation and the cc_analyzer for long runs.

  • Property svn:executable set to *
File size: 3.0 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-1"
13PAPI_EVENTS_DAT="papi_events.data"
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        CC_CSV_RSLT="cc_3_1_1.csv"
49
50elif [ $OPTION = "i" ] ; then
51        echo "Testing ICXML"
52
53        APP="gml2svg_icx"
54        APP_TARGET="xerces_icx"
55        LIB_PATH="/home/ksherdy/Temp/icxml/xerces/src/.libs"
56        SVG_DIR="svg_icx"
57        CC_DIR="cc_icx"
58        CC_RSLT="cc_icx.txt"
59        CC_CSV_RSLT="cc_icx.csv"
60
61elif [ $OPTION = "p" ] ; then
62        echo "Testing Pipelined ICXML"
63
64        APP="gml2svg_icx_pipeline"
65        APP_TARGET="xerces_icx_pipeline"
66        LIB_PATH="/home/ksherdy/Temp/picxml/src-pipeline/xerces/src/.libs"
67        SVG_DIR="svg_icx_pipeline"
68        CC_DIR="cc_icx_pipeline"
69        CC_RSLT="cc_icx_pipeline.txt"
70        CC_CSV_RSLT="cc_icx_pipeline.csv"
71
72fi
73
74PAPI_EVENTS=`grep -v -e '^#\|^$' $PAPI_EVENTS_DAT` # an event code per line
75
76CC_ANALYZER="../parabix/cc_analyzer"
77
78# sanity checks
79
80if ( [ -e .cc ] ) ; then
81        rm -Rf .cc
82fi
83
84if ( ! [ -f $CC_ANALYZER ] ) ; then
85                echo "Error: cc_analyzer not found."   
86                exit
87fi
88
89if ( ! [ -x $CC_ANALYZER ] ) ; then
90                echo "Error: cc_analyzer not executable."       
91                exit
92fi
93
94if (! [ -d $LIB_PATH ] ) ; then
95                echo "Error: $LIB_PATH not found."
96                exit
97fi
98
99# back up one run
100if ( [ -e $CC_DIR ] ) ; then
101        mv -f $CC_DIR $CC_DIR.bak       
102fi
103
104if ( [ -e $CC_RSLT ] ) ; then
105        mv -f $CC_RSLT $CC_RSLT.bak
106fi
107
108if ( [ -e $CC_CSV_RSLT ] ) ; then
109        mv -f $CC_CSV_RSLT $CC_CSV_RSLT.bak
110fi
111
112for papi_event in $PAPI_EVENTS;
113do
114        #compile
115        #CC_EVENT=$papi_event
116        #export CC_EVENT
117
118        #execute
119        #make $APP_TARGET
120        #export LD_LIBRARY_PATH=$LIB_PATH #":$LD_LIBRARY_PATH"
121        ./$APP $GML_DIR $SVG_DIR $papi_event
122       
123done
124
125#generate report files
126
127#code clocker
128rm -Rf $CC_RSLT
129#touch $CC_RSLT
130#rm -Rf $CC_DIR
131mv -f ".cc" $CC_DIR # move .cc directory into the CC_DIR
132CC_FILES=`ls $CC_DIR`
133
134#for cc_file in $CC_FILES;     
135#do
136#               $CC_ANALYZER $CC_DIR/$cc_file -r -c -p >> $CC_RSLT
137#done
138
139#echo -n "Result file: "
140#echo $CC_RSLT
141
142#csv
143rm -Rf $CC_CSV_RSLT
144touch $CC_CSV_RSLT
145echo "PAPI Event Code, Value, Bytes" >> $CC_CSV_RSLT
146for file in `find $CC_DIR -name "*.csv" | sort` 
147do
148        tail -1 $file >> $CC_CSV_RSLT;
149done
150
151echo -n "CSV result file: "
152echo $CC_CSV_RSLT
153
154echo "Perf test complete."
155
156
157
158
159
160
161
Note: See TracBrowser for help on using the repository browser.