-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcreateZCCase_pwr.sh
executable file
·75 lines (66 loc) · 2.29 KB
/
createZCCase_pwr.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
#!/bin/bash
if [ $# != 1 ]
then
echo Usage: please specify a unique case directory name.
echo Example: $0 case1
exit
fi
caseName=$1
rootDir=`pwd`
if [ ! -d Z-checker ]; then
echo "Error: missing Z-checker directory. "
echo "Please run z-checker-install.sh first."
exit
fi
echo Create a new case $caseName for Z-checker
if [ -d Z-checker/${caseName}-pwr ]; then
echo "Conflict: the case ${caseName}-pwr already exists."
echo "Please remove the existing case using removeZCCase.sh before creating another one with the same case name."
exit
fi
cd Z-checker
./createNewCase.sh ${caseName}-pwr
echo "Create a new case (fast mode) for SZ"
cd ../SZ
sz_caseName=${caseName}-pwr_fast
if [ ! -d $sz_caseName ]; then
mkdir $sz_caseName
fi
cp example/sz-zc-ratedistortion.sh $sz_caseName
cp example/testfloat_CompDecomp.sh $sz_caseName
cp example/testdouble_CompDecomp.sh $sz_caseName
cp example/zc.config $sz_caseName
cp ../sz-patches/sz.config.fast_mode $sz_caseName/sz.config
cd $sz_caseName
ln -s "$rootDir/SZ/example/testfloat_CompDecomp" testfloat_CompDecomp
patch -p0 < ../../sz-patches/testfloat_CompDecomp_fast.sh.patch
ln -s "$rootDir/SZ/example/testdouble_CompDecomp" testdouble_CompDecomp
patch -p0 < ../../sz-patches/testdouble_CompDecomp_fast.sh.patch
cd ..
echo "Create a new case (default mode) for SZ"
cd ../SZ
sz_caseName=${caseName}-pwr_deft
if [ ! -d $sz_caseName ]; then
mkdir $sz_caseName
fi
cp example/sz-zc-ratedistortion.sh $sz_caseName
cp example/testfloat_CompDecomp.sh $sz_caseName
cp example/testdouble_CompDecomp.sh $sz_caseName
cp example/zc.config $sz_caseName
cp ../sz-patches/sz.config.default_mode $sz_caseName/sz.config
cd $sz_caseName
ln -s "$rootDir/SZ/example/testfloat_CompDecomp" testfloat_CompDecomp
patch -p0 < ../../sz-patches/testfloat_CompDecomp_deft.sh.patch
ln -s "$rootDir/SZ/example/testdouble_CompDecomp" testdouble_CompDecomp
patch -p0 < ../../sz-patches/testdouble_CompDecomp_deft.sh.patch
cd ..
echo Create a new case for ZFP
cd ../zfp
zfp_caseName=${caseName}-p
if [ ! -d $zfp_caseName ]; then
mkdir $zfp_caseName
fi
cp utils/*.sh $zfp_caseName
echo Modify Z-checker/$caseName-pwr/zc.config
cd ../Z-checker/$caseName-pwr
./modifyZCConfig zc.config compressors "sz_f:../../SZ/${caseName}-pwr_fast sz_d:../../SZ/${caseName}-pwr_deft zfp:../../zfp/${zfp_caseName}"