File: run_bm_ar4.sh

package info (click to toggle)
netcdf 1%3A4.4.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 96,828 kB
  • ctags: 15,369
  • sloc: ansic: 163,650; sh: 9,294; yacc: 2,457; makefile: 1,208; lex: 1,161; xml: 173; f90: 7; fortran: 6; awk: 2
file content (94 lines) | stat: -rwxr-xr-x 2,255 bytes parent folder | download
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
#!/bin/sh

# This shell runs a bunch of benchmarks on some specific files
# available at Unidata. If you want to run this shell, you need these
# data files.

# This script gets and benchmarks against some AR4 data.

# $Id: run_bm_ar4.sh,v 1.4 2010/01/11 19:27:11 ed Exp $

set -e
echo ""
#file_list="pr_A1.20C3M_8.CCSM.atmm.1870-01_cat_1999-12.nc tauu_A1.20C3M_8.CCSM.atmm.1870-01_cat_1999-12.nc thetao_O1.SRESA1B_2.CCSM.ocnm.2000-01_cat_2099-12.nc usi_O1.20C3M_8.CCSM.icem.1870-01_cat_1999-12.nc"
#file_list="pr_A1.20C3M_8.CCSM.atmm.1870-01_cat_1999-12.nc tauu_A1.20C3M_8.CCSM.atmm.1870-01_cat_1999-12.nc usi_O1.20C3M_8.CCSM.icem.1870-01_cat_1999-12.nc"
file_list="pr_A1.20C3M_8.CCSM.atmm.1870-01_cat_1999-12.nc"
echo " *** Getting sample AR4 files $file_list"

# Get the files.
for f1 in $file_list
do
    if ! test -f $f1; then
	wget ftp://ftp.unidata.ucar.edu/pub/netcdf/sample_data/ar4/$f1.gz
	gunzip $f1.gz
    fi
done

echo "SUCCESS!!!"

out='run_bm_ar4_pr_out.csv'
rm -rf $out
echo " *** Benchmarking pr_A1 file with various chunksizes (output to ${out})..."

# Create netCDF-4 versions of the file, with different chunksizes.
h=-h
s=0
pr_ar4_sample="pr_A1.20C3M_8.CCSM.atmm.1870-01_cat_1999-12.nc"

file_num=0
for d in -1
do
    for c0 in 4 8 16 32 64 
    do
	for c1 in 64
	do
	    for c2 in 128
	    do
		if test $d = -1; then
		    file_out="pr_A1_${c0}_${c1}_${c2}.nc"
		else
		    file_out="pr_A1_z${d}_${c0}_${c1}_${c2}.nc"
		fi
		out_files="$out_files $file_out"

		# If the output file does not yet exist, create it.
		if test -f $file_out; then
		    echo "found existing $file_out"
		else
		    cmd="./bm_file $h -f 3 -c 6:${d}:${s}:${c0}:${c1}:${c2} -o ${file_out} ${pr_ar4_sample}"
		    echo "cmd=$cmd"
# 	            bash ./clear_cache.sh
 		    if ! ($cmd >> $out); then
 			exit 1;
 		    fi
		fi

		# Turn off header next time around.
		h=
	    done
	done
    done
done

echo $out_files

# Do the horizonatal runs.
#bash ./clear_cache.sh
./tst_ar4 -h $pr_ar4_sample
for f1 in $out_files
do
#    bash ./clear_cache.sh
    ./tst_ar4 ${f1}
done

# Do the timeseries runs.
#bash ./clear_cache.sh
./tst_ar4 -t -h $pr_ar4_sample
for f1 in $out_files
do
#    bash ./clear_cache.sh
    ./tst_ar4 -t ${f1}
done

echo "SUCCESS!!!"
exit 0