File: run_unlim_io.sh

package info (click to toggle)
netcdf-parallel 1%3A4.9.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 116,192 kB
  • sloc: ansic: 279,265; sh: 14,143; cpp: 5,971; yacc: 2,612; makefile: 2,075; lex: 1,218; javascript: 280; xml: 173; awk: 2
file content (108 lines) | stat: -rwxr-xr-x 2,910 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh

. ${srcdir}/test_nczarr.sh

set -e

s3isolate "testdir_unlim_io"
THISDIR=`pwd`
cd $ISOPATH

TC="${execdir}/test_unlim_io -4"
ZM="${execdir}/zmapio -t int"

remfile() {
  case "$zext" in
  nc4) rm -fr $1 ;;
  file) rm -fr $1 ;;
  zip) rm -fr $1 ;;
  s3) ;;
  *) echo "no such extension: $zext" ; exit 1;;
  esac
}

remfile() {
  case "$zext" in
  nc4) rm -fr $1 ;;
  file) rm -fr $1 ;;
  zip) rm -fr $1 ;;
  s3) ;;
  *) echo "no such extension: $zext" ; exit 1;;
  esac
}

buildfile() {
zext=$1
base=$2
if test "x$TESTNCZARR" = x1 ; then
fileargs "${base}_${zext}"
deletemap $zext $file
file="$fileurl"
else
file="${base}_${zext}.nc"
rm -f $file
fi
}

testcase1() {
zext=$1
buildfile $zext tmp_unlim_io1
echo ""; echo "*** Test simple use of unlimited"
rm -fr tmp_unlim_io1.nc tmp_unlim_io1.$zext tmp_unlim_io1.nc.txt tmp_unlim_io1.${zext}.txt
$TC -d 0 -c 2 -s 0 -e 1 -Ocw tmp_unlim_io1.nc
$TC -d 0 -c 2 -s 0 -e 1 -Ocw "$file"
${NCDUMP} -n tmp_unlim_io1 tmp_unlim_io1.nc >tmp_unlim_io1.nc.txt
${NCDUMP} -n tmp_unlim_io1 "$file" >tmp_unlim_io1.${zext}.txt
diff -b tmp_unlim_io1.nc.txt tmp_unlim_io1.${zext}.txt
}

testcase2() {
zext=$1
buildfile $zext tmp_unlim_io2
echo ""; echo "*** Test 2-d chunking"
rm -fr tmp_unlim_io2.nc tmp_unlim_io2.$zext tmp_unlim_io2.nc.txt tmp_unlim_io2.${zext}.txt
$TC -d 0,0 -c 2,2 -s 0,0 -e 2,2 -v 17 -Ocw tmp_unlim_io2.nc
$TC -d 0,0 -c 2,2 -s 0,0 -e 2,2 -v 17 -Ocw "$file"
${NCDUMP} -n tmp_unlim_io2 tmp_unlim_io2.nc >tmp_unlim_io2.nc.txt
${NCDUMP} -n tmp_unlim_io2 "$file" >tmp_unlim_io2.${zext}.txt
diff -b tmp_unlim_io2.nc.txt tmp_unlim_io2.${zext}.txt
${execdir}/ncdumpchunks -v v "$file"
}

testcase3() {
zext=$1
buildfile $zext tmp_unlim_io3
echo ""; echo "*** Test multi-chunk extension"
rm -fr tmp_unlim_io3.nc tmp_unlim_io3.$zext tmp_unlim_io3.nc.txt tmp_unlim_io3.${zext}.txt
$TC -d 0,0 -c 2,2 -s 6,6 -e 2,2 -v 17 -Ocw tmp_unlim_io3.nc
$TC -d 0,0 -c 2,2 -s 6,6 -e 2,2 -v 17 -Ocw "$file"
${NCDUMP} -n tmp_unlim_io3 tmp_unlim_io3.nc >tmp_unlim_io3.nc.txt
${NCDUMP} -n tmp_unlim_io3 "$file" >tmp_unlim_io3.${zext}.txt
diff -b tmp_unlim_io3.nc.txt tmp_unlim_io3.${zext}.txt
}

testcase4() {
zext=$1
buildfile $zext tmp_unlim_io4
echo ""; echo "*** Test unlimited as second dimension"
rm -fr tmp_unlim_io4.nc tmp_unlim_io4.$zext tmp_unlim_io4.nc.txt tmp_unlim_io4.${zext}.txt
$TC -d 8,0 -c 2,2 -s 6,6 -e 2,2 -v 17 -Ocw tmp_unlim_io4.nc
$TC -d 8,0 -c 2,2 -s 6,6 -e 2,2 -v 17 -Ocw "$file"
${NCDUMP} -n tmp_unlim_io3 tmp_unlim_io4.nc >tmp_unlim_io4.nc.txt
${NCDUMP} -n tmp_unlim_io3 "$file" >tmp_unlim_io4.${zext}.txt
diff -b tmp_unlim_io4.nc.txt tmp_unlim_io4.${zext}.txt
}

testcases() {
    testcase1 $1
    testcase2 $1
    testcase3 $1
    testcase4 $1
}

testcases file
if test "x$FEATURE_NCZARR_ZIP" = xyes ; then testcases zip; fi
if test "x$FEATURE_S3TESTS" = xyes ; then testcases s3; fi