-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrunZCCase.sh
executable file
·171 lines (142 loc) · 4.32 KB
/
runZCCase.sh
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#!/bin/bash
export PATH=$PATH:.
datatype=$1
if [[ $# < 4 || ( $datatype != "-f" && $datatype != "-d" ) ]]
then
echo " Usage: option 1: $0 [datatype (-f or -d)] [errBoundMode] [testcase] [data dir] [extension] [dimensions....]"
echo " option 2: $0 [datatype (-f or -d)] [errBoundMode] [testcase] [varInfo.txt]"
echo " Example: $0 -f ABS testcase1 CESM-testdata/1800x3600 dat 3600 1800"
echo " $0 -f REL testcase2 varList.txt"
exit
fi
errBoundMode=$2
testcase=$3
if [ -d "$4" ]; then
option=1
else
option=0
fi
if [[ $option == 1 ]]; then
dataDir=`cd "$4"; pwd`
extension=$5
dim1=$6
dim2=$7
dim3=$8
dim4=$9
else
varListFile=`readlink -f $4`
if [ ! -f "$varListFile" ]; then
echo "Error: $varListFile does not exist!\n";
exit
fi
fi
rootDir=`pwd`
if [[ $errBoundMode == "ABS" ]]; then
if [ ! -d "Z-checker/$testcase" ]; then
echo "Error: Testcase $testcase doesn't exist!"
exit
fi
elif [[ $errBoundMode == "REL" ]]; then
if [ ! -d "Z-checker/$testcase" ]; then
echo "Error: Testcase $testcase doesn't exist!"
exit
fi
elif [[ $errBoundMode == "PW_REL" ]]; then
if [ ! -d "Z-checker/$testcase" ]; then
echo "Error: Testcase $testcase for PW_REL doesn't exist!"
exit
fi
fi
if [[ $option == 1 ]]; then
if [ ! -d "$dataDir" ]; then
echo "Error: $dataDir doesn't exist!"
exit
fi
fi
envConfigPath="$rootDir/env_config.sh"
GNUPLOT_EXE_PATH=`which gnuplot`
if [ ! -x "$GNUPLOT_EXE_PATH" ]; then
if [ -f $envConfigPath ]; then
echo source $envConfigPath to load gnuplot command
source $envConfigPath
else
echo "Error: gnuplot or sam2p is not executable and cannot find env_config.sh either."
exit
fi
fi
SAM2P_EXE_PATH=`which sam2p`
if [ ! -x "$SAM2P_EXE_PATH" ]; then
if [ -f $envConfigPath ]; then
echo source $envConfigPath to load sam2p command
source $envConfigPath
else
echo "Error: gnuplot or sam2p is not executable and cannot find env_config.sh either."
exit
fi
fi
LATEXMK_EXE_PATH=`which latexmk`
if [ ! -x "$LATEXMK_EXE_PATH" ]; then
if [ -z "$GNUPLOT_PATH" ]; then
if [ -f $envConfigPath ]; then
echo source $envConfigPath to load latexmk command
source $envConfigPath
else
echo "Error: latexmk is not executable and cannot find env_config.sh either."
exit
fi
fi
fi
##begin: Compressor sz_d
cd $rootDir
cd SZ/${testcase}_deft
if [[ $option == 1 ]]; then
echo ./zc-ratedistortion.sh $datatype $errBoundMode $dataDir $extension $dim1 $dim2 $dim3 $dim4
./zc-ratedistortion.sh $datatype $errBoundMode $dataDir $extension $dim1 $dim2 $dim3 $dim4
else
echo ./zc-ratedistortion.sh $datatype $errBoundMode $varListFile
./zc-ratedistortion.sh $datatype $errBoundMode $varListFile
fi
##end: Compressor sz_d
##begin: Compressor zfp
cd $rootDir
cd zfp/${testcase}
if [[ $option == 1 ]]; then
echo ./zc-ratedistortion.sh $datatype $errBoundMode $dataDir $extension $dim1 $dim2 $dim3 $dim4
./zc-ratedistortion.sh $datatype $errBoundMode $dataDir $extension $dim1 $dim2 $dim3 $dim4
else
echo ./zc-ratedistortion.sh $datatype $errBoundMode $varListFile
./zc-ratedistortion.sh $datatype $errBoundMode "$varListFile"
fi
##end: Compressor zfp
##New compressor to be added here
cd $rootDir
cd Z-checker/${testcase}
if [[ $option == 1 ]]; then
echo ./analyzeDataProperty.sh $datatype $dataDir $extension $dim1 $dim2 $dim3 $dim4
./analyzeDataProperty.sh $datatype $dataDir $extension $dim1 $dim2 $dim3 $dim4
else
echo ./analyzeDataProperty.sh $datatype $varListFile
./analyzeDataProperty.sh $datatype "$varListFile"
fi
############## as follows, it's comparison ##############
sz_err_env="`cat ../../errBounds.cfg | grep -v "#" | grep comparisonCases`"
echo "export $sz_err_env" > env.tmp
source env.tmp
rm env.tmp
SZ_Err_Bounds="`echo $comparisonCases`"
echo comparisonCases=$comparisonCases
./modifyZCConfig zc.config comparisonCases "$comparisonCases"
zc_err_env="`cat ../../errBounds.cfg | grep -v "#" | grep numOfErrorBoundCases`"
echo "export $zc_err_env" > env.tmp
source env.tmp
rm env.tmp
ZC_Err_Bounds="`echo $numOfErrorBoundCases`"
echo numOfErrorBoundCasess=$numOfErrorBoundCases
./modifyZCConfig zc.config numOfErrorBoundCases "$numOfErrorBoundCases"
if [[ $errBoundMode == "PW_REL" ]]; then
echo ./generateReport.sh ${testcase} with PW_REL
./generateReport.sh "${testcase} with PW_REL"
else
echo ./generateReport.sh ${testcase}
./generateReport.sh "${testcase}"
fi