2018-08-13 13:01:08 +08:00
|
|
|
#!/bin/sh
|
2012-04-10 06:03:02 +08:00
|
|
|
|
2017-05-11 06:55:47 +08:00
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
|
|
|
. ../test_common.sh
|
|
|
|
|
2012-04-10 06:03:02 +08:00
|
|
|
set -e
|
|
|
|
|
|
|
|
# Get the target OS and CPU
|
|
|
|
CPU=`uname -p`
|
|
|
|
OS=`uname`
|
|
|
|
|
2018-11-04 01:51:10 +08:00
|
|
|
# Test diskless on a reasonably large file size
|
|
|
|
|
2018-11-16 01:00:38 +08:00
|
|
|
# Try a large in-memory file; two instances at once may be needed when doing realloc
|
|
|
|
#SIZE=1000000000
|
|
|
|
SIZE=500000000
|
2018-11-04 01:51:10 +08:00
|
|
|
|
2012-04-10 06:03:02 +08:00
|
|
|
FILE4=tst_diskless4.nc
|
|
|
|
|
2018-11-04 01:51:10 +08:00
|
|
|
# Uncomment to get timing
|
|
|
|
#TIME=time
|
2012-04-10 06:03:02 +08:00
|
|
|
|
|
|
|
# Create the reference ncdump output for tst_diskless4
|
2018-11-04 01:51:10 +08:00
|
|
|
rm -fr ref_tst_diskless4.cdl
|
|
|
|
cat >ref_tst_diskless4.cdl <<EOF
|
|
|
|
netcdf tst_diskless4 {
|
|
|
|
dimensions:
|
2018-11-16 01:00:38 +08:00
|
|
|
dim = 500000000 ;
|
2018-11-04 01:51:10 +08:00
|
|
|
variables:
|
|
|
|
byte var0(dim) ;
|
|
|
|
}
|
|
|
|
EOF
|
2012-04-10 06:03:02 +08:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
rm -f $FILE4
|
2018-11-04 01:51:10 +08:00
|
|
|
$TIME ./tst_diskless4 $SIZE create
|
2012-04-10 06:03:02 +08:00
|
|
|
# Validate it
|
2018-11-04 01:51:10 +08:00
|
|
|
${NCDUMP} -h $FILE4 |diff -w - ref_tst_diskless4.cdl
|
2012-04-10 06:03:02 +08:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
rm -f $FILE4
|
2018-11-04 01:51:10 +08:00
|
|
|
$TIME ./tst_diskless4 $SIZE creatediskless
|
2012-04-10 06:03:02 +08:00
|
|
|
# Validate it
|
2018-11-04 01:51:10 +08:00
|
|
|
${NCDUMP} -h $FILE4 |diff -w - ref_tst_diskless4.cdl
|
2012-04-10 06:03:02 +08:00
|
|
|
|
|
|
|
echo ""
|
2018-11-04 01:51:10 +08:00
|
|
|
$TIME ./tst_diskless4 $SIZE open
|
2012-04-10 06:03:02 +08:00
|
|
|
|
|
|
|
echo ""
|
2018-11-04 01:51:10 +08:00
|
|
|
$TIME ./tst_diskless4 $SIZE opendiskless
|
2012-04-10 06:03:02 +08:00
|
|
|
|
|
|
|
# cleanup
|
2018-11-04 01:51:10 +08:00
|
|
|
rm -f $FILE4 tst_diskless4.cdl ref_tst_diskless4.cdl
|
2012-04-10 06:03:02 +08:00
|
|
|
|
|
|
|
exit
|