-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtestga.sh
executable file
·87 lines (62 loc) · 2.05 KB
/
testga.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
#!/bin/bash
### SETTINGS
FDSIZE=31
EP=2.7
ND=6400
NODESET="md079.06400"
#ND=655362
#NODESET="icos655362.mat"
NODESET2="${ND}_${FDSIZE}.mat"
GALEW="par = struct('test', 'galew', 'n', ${ND}, 'fd', ${FDSIZE}, 'ep', ${EP}, 'order', 4, 'gamma_c', -0.05);"
TC5="par = struct('test', 'tc5', 'n', ${ND}, 'fd', ${FDSIZE}, 'ep', ${EP}, 'order', 4, 'gamma_c', -0.05);"
GALEWN="galewga-${ND}-${FDSIZE}-ep${EP}-o4-gc-0.05"
TC5N="tc5ga-${ND}-${FDSIZE}-ep${EP}-o4-gc-0.05"
DT="600"
# setup
mkdir -p nodesets
mkdir -p tree
mkdir -p cartfd
mkdir -p data
mkdir -p resdata
TESTS=$1
if [ "x${TESTS}x" == "xx" ]; then
TESTS="01234"
fi
### 0: COMPILE
if [[ ${TESTS} == *0* ]]; then
make bin/sw
fi
### 1: PREPROCESS NODES
MLCODE=""
if [[ ${TESTS} == *1* ]]; then
rm -f "nodesets/${NODESET2}"
rm -f "tree/${NODESET2}"
MLCODE="${MLCODE} mt_preprocess('../orgnodesets/${NODESET}', ${FDSIZE});"
fi
### 2: GENERATE DATA
if [[ ${TESTS} == *2* ]]; then
rm -rf "data/${TC5N}"
rm -rf "data/${GALEWN}"
MLCODE="${MLCODE} clear; ${GALEW} mt_savega(par);"
MLCODE="${MLCODE} clear; ${TC5} mt_savega(par);"
fi
if [ -n "${MLCODE}" ]; then
MLCODE="${MLCODE} exit;"
( cd matlab ; matlab -nojvm -r "${MLCODE}" )
fi
### 3: RUN
if [[ ${TESTS} == *3* ]]; then
rm -rf "resdata/${GALEWN}-dt${DT}"
rm -rf "resdata/${TC5}-dt${DT}"
./run ${GALEWN} 400 ${DT} 518400
echo "size = 16 chunk_size= 400 num_chunks= 16 blocks= 50 cpus= 4 time= 5399834449 dbg=[ -27.9535 -87.1889 -302.851 6.27435e+08 -1609.46 -856.794 -399.075 88968.8 2139.55 5001.25 310.509 6.27435e+08 ] <-- EXPECTED"
./run ${TC5N} 400 ${DT} 1296000
echo "size = 16 chunk_size= 400 num_chunks= 16 blocks= 50 cpus= 4 time= 8641111484 dbg=[ 203.336 134.071 -124.541 -1.75073e+07 -1508.3 7.12457 -296.373 -1.75073e+07 869.626 2906.25 173.942 -7895.51 ] <-- EXPECTED"
fi
### 4: PLOT RESULTS
if [[ ${TESTS} == *4* ]]; then
MLCODE="clear; ${GALEW} saveplot(par, ${DT}, 'ga'); "
MLCODE="${MLCODE}; clear; ${TC5} saveplot(par, ${DT}, 'ga'); "
MLCODE="${MLCODE}; exit;"
( cd matlab ; matlab -nosplash -nodesktop -r "${MLCODE}" )
fi