-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathtestBranch
More file actions
executable file
·282 lines (266 loc) · 9.5 KB
/
Copy pathtestBranch
File metadata and controls
executable file
·282 lines (266 loc) · 9.5 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
#!/bin/bash
#---------------------------------------------------------------------------
#
# FCST: Fuel Cell Simulation Toolbox
#
# Copyright (C) 2006-13 by Energy Systems Design Laboratory, University of Alberta
#
# This software is distributed under the MIT License.
# For more information, see the README file in /doc/LICENSE
#
#---------------------------------------------------------------------------
#######################
#
# Test file for running tests under all possible configures
# meant to make developers lives easier when wanting to merge
# branch.
#
#
# Developer: Chad Balen, 2015
#
#######################
set -e #Exits if any command cannot be performed
currentDir=$(pwd)
installDir="$currentDir/Install"
# Writing the help command. First checking if there are any
# arguments.
if [ -z "$*" ]; then
echo ""
elif [[ $* == *--help* ]]; then
echo ""
echo "========================================================"
echo " "
echo " testBranch script information: "
echo
echo " This script assumes that this directory is the same as "
echo " openFCST_install. This script is to be used by "
echo " developers that wish to test their branch before "
echo " merging by running the run_tests script under all "
echo " possible configurations for OpenFCST. The results are "
echo " saved in different files so the developer can run this "
echo " and walk away without having to watch when tests are "
echo " done to run a different configuration. "
echo
echo
echo " Options for testBranch script "
echo
echo " Multicore execution of the make command during "
echo " installation can be activated by the following flag: "
echo " --cores=<Num_Of_Cores> "
echo
echo "========================================================"
echo ""
exit
fi
#-----------------------
#
# Check for multicore run test command
#
#-----------------------
argnumcores=`echo "$*" | perl -n -e 'm/--cores=(\S+)/; print $1'`
if [ "$argnumcores" == "" ];then
echo
echo "======================================================="
echo " Compiling on a single core "
echo "======================================================="
argnumcores=1
elif [[ $argnumcores =~ ^-?[0-9]+$ ]];then
echo
echo "======================================================="
echo " Compiling on " $argnumcores " cores "
echo "======================================================="
else
echo
echo "======================================================="
echo " --cores="$argnumcores" is an invalid core number "
echo " Please either omit or try the following syntax: "
echo " ./openFCST_install_CMake --cores=7 "
echo "======================================================="
exit 1
fi
#-----------------------
#
# Remove old tests_summary logs
#
#-----------------------
#Do a clean Install
if [ -d Build ]; then
rm -rf Build
fi
if [ -d $installDir/contrib/ALGLIB ]; then
rm -rf $installDir/contrib/ALGLIB
fi
if [ -d $installDir/contrib/COLDAE ]; then
rm -rf $installDir/contrib/COLDAE
fi
if [ -d $installDir/contrib/cpptest ]; then
rm -rf $installDir/contrib/cpptest
fi
# if [ -d $installDir/contrib/Dakota ]; then
# rm -rf $installDir/contrib/Dakota
# fi
if [ -d $installDir/contrib/deal.II ]; then
rm -rf $installDir/contrib/deal.II
fi
if [ -d $installDir/contrib/Metis ]; then
rm -rf $installDir/contrib/Metis
fi
if [ -d $installDir/contrib/p4est ]; then
rm -rf $installDir/contrib/p4est
fi
if [ -d $installDir/contrib/PETSc ]; then
rm -rf $installDir/contrib/PETSc
fi
if [ -d $installDir/contrib/sqlite ]; then
rm -rf $installDir/contrib/sqlite
fi
if [ -d $installDir/fcst ]; then
rm -rf $installDir/fcst
fi
if [ -d $installDir/examples ]; then
rm -rf $installDir/examples
fi
#Files created by run_tests
if [ -f $installDir/tests_output.log ]; then
rm $installDir/tests_output.log
fi
if [ -f $installDir/tests_summary.log ]; then
rm $installDir/tests_summary.log
fi
# #With Dakota & PETSc files
# if [ -f $installDir/1a_tests_summary_WithDakotaPETSc_Release.log ]; then
# rm $installDir/1a_tests_summary_WithDakotaPETSc_Release.log
# fi
# if [ -f $installDir/1b_tests_summary_WithDakotaPETSc_Debug.log ]; then
# rm $installDir/1b_tests_summary_WithDakotaPETSc_Debug.log
# fi
#
# #With Dakota files
# if [ -f $installDir/2a_tests_summary_WithDakota_Release.log ]; then
# rm $installDir/2a_tests_summary_WithDakota_Release.log
# fi
# if [ -f $installDir/2b_tests_summary_WithDakota_Debug.log ]; then
# rm $installDir/2b_tests_summary_WithDakota_Debug.log
# fi
#With PETSc files
if [ -f $installDir/3a_tests_summary_WithPETSc_Release.log ]; then
rm $installDir/3a_tests_summary_WithPETSc_Release.log
fi
if [ -f $installDir/3b_tests_summary_WithPETSc_Debug.log ]; then
rm $installDir/3b_tests_summary_WithPETSc_Debug.log
fi
#Without Dakota & PETSc files
if [ -f $installDir/4a_tests_summary_Release.log ]; then
rm $installDir/4a_tests_summary_Release.log
fi
if [ -f $installDir/4b_tests_summary_Debug.log ]; then
rm $installDir/4b_tests_summary_Debug.log
fi
#-----------------------
#
# Optimized Simulations
#
#-----------------------
cd $currentDir
# echo "========================================================"
# echo " Configuration: With Dakota & PETSc in Optimized Mode "
# echo "========================================================"
# ./openFCST_install --cores=$argnumcores --with-petsc --with-dakota --with-paraview
# cd $installDir
# ./run_tests --cores=$argnumcores
# cp tests_summary.log 1a_tests_summary_WithDakotaPETSc_Release.log
# cd $currentDir
#
#
# #Remove old example folder and begin next configuration
# if [ -d $installDir/examples ]; then
# rm -rf $installDir/examples
# fi
# echo "========================================================"
# echo " Configuration: With Dakota in Optimized Mode "
# echo "========================================================"
# ./openFCST_install --cores=$argnumcores --with-dakota --library-fcst
# cd $installDir
# ./run_tests --cores=$argnumcores
# cp tests_summary.log 2a_tests_summary_WithDakota_Release.log
# cd $currentDir
#
#
# #Remove old example folder and begin next configuration
# if [ -d $installDir/examples ]; then
# rm -rf $installDir/examples
# fi
echo "========================================================"
echo " Configuration: With PETSc in Optimized Mode "
echo "========================================================"
./openFCST_install --cores=$argnumcores --with-petsc
cd $installDir
./run_tests --cores=$argnumcores
cp tests_summary.log 3a_tests_summary_WithPETSc_Release.log
cd $currentDir
#Remove old example folder and begin next configuration
if [ -d $installDir/examples ]; then
rm -rf $installDir/examples
fi
echo "========================================================"
echo " Configuration: None in Optimized Mode "
echo "========================================================"
./openFCST_install --cores=$argnumcores --library-fcst
cd $installDir
./run_tests --cores=$argnumcores
cp tests_summary.log 4a_tests_summary_Release.log
cd $currentDir
#-----------------------
#
# Debug Simulations
#
#-----------------------
#Remove old example folder and begin next configuration
# if [ -d $installDir/examples ]; then
# rm -rf $installDir/examples
# fi
# echo "========================================================"
# echo " Configuration: With Dakota & PETSc in Debug Mode "
# echo "========================================================"
# ./openFCST_install --cores=$argnumcores --with-petsc --with-dakota --library-fcst --openfcst-debug
# cd $installDir
# ./run_tests --cores=$argnumcores
# cp tests_summary.log 1b_tests_summary_WithDakotaPETSc_Debug.log
#cd $currentDir
# #Remove old example folder and begin next configuration
# if [ -d $installDir/examples ]; then
# rm -rf $installDir/examples
# fi
# echo "========================================================"
# echo " Configuration: With Dakota in Debug Mode "
# echo "========================================================"
# ./openFCST_install --cores=$argnumcores --with-dakota --library-fcst --openfcst-debug
# cd $installDir
# ./run_tests --cores=$argnumcores
# cp tests_summary.log 2b_tests_summary_WithDakota_Debug.log
# cd $currentDir
#
#Remove old example folder and begin next configuration
if [ -d $installDir/examples ]; then
rm -rf $installDir/examples
fi
echo "========================================================"
echo " Configuration: With PETSc in Debug Mode "
echo "========================================================"
./openFCST_install --cores=$argnumcores --with-petsc --openfcst-debug
cd $installDir
./run_tests --cores=$argnumcores
cp tests_summary.log 3b_tests_summary_WithPETSc_Debug.log
cd $currentDir
#Remove old example folder and begin next configuration
if [ -d $installDir/examples ]; then
rm -rf $installDir/examples
fi
echo "========================================================"
echo " Configuration: None in Debug Mode "
echo "========================================================"
./openFCST_install --cores=$argnumcores --library-fcst --openfcst-debug
cd $installDir
./run_tests --cores=$argnumcores
cp tests_summary.log 4b_tests_summary_Debug.log
cd $currentDir