1 | #!/bin/csh |
---|
2 | unalias rm |
---|
3 | unalias cp |
---|
4 | unalias mv |
---|
5 | |
---|
6 | # This script runs a large number of WRF regression tests. On the |
---|
7 | # IBM machines (which at NCAR allow queueing), the jobs are sent to |
---|
8 | # the queue system via load leveler commands. On all other machines, |
---|
9 | # the jobs are sent in sequentially as soon as the process returns |
---|
10 | # from completing the previous task. |
---|
11 | |
---|
12 | # HOW TO RUN |
---|
13 | # ---------- |
---|
14 | |
---|
15 | # DEC |
---|
16 | # joshua1 or joshua3 |
---|
17 | # mkdir /data3/mp/$USER/`hostname` |
---|
18 | # put all_reg.csh, regtest.csh, and wrf.tar in dir |
---|
19 | # execute all_reg.csh |
---|
20 | # takes about 24-30 h |
---|
21 | |
---|
22 | # Linux |
---|
23 | # joshua1 or joshua3 |
---|
24 | # mkdir /data3/mp/$USER/`hostname` |
---|
25 | # put all_reg.csh, regtest.csh, and wrf.tar in dir |
---|
26 | # execute all_reg.csh |
---|
27 | # takes about 36-48 h |
---|
28 | # flex lm errors show up as fails to compile |
---|
29 | |
---|
30 | # AIX |
---|
31 | # bluesky or bluevista |
---|
32 | # put all_reg.csh, regtest.csh, and wrf.tar in ~ |
---|
33 | # execute all_reg.csh |
---|
34 | # takes about 8-10 h |
---|
35 | |
---|
36 | # Unless you are editing the script, no changes are required below |
---|
37 | |
---|
38 | |
---|
39 | #======================================================================= |
---|
40 | #======================================================================= |
---|
41 | |
---|
42 | # What these tests do, must be a single string. |
---|
43 | |
---|
44 | set NAME = ( "Standard" "NESTED=FALSE" "NESTED=FALSE" "NONE" 1 \ |
---|
45 | "Moving_Nest" "NESTED=FALSE" "NESTED=TRUE" "NONE" 2 \ |
---|
46 | "Full_Optimization" "REG_TYPE=BIT4BIT" "REG_TYPE=OPTIMIZED" "NONE" 3 \ |
---|
47 | "Chemistry" "CHEM=FALSE" "CHEM=TRUE" "NONE" 4 \ |
---|
48 | "RSL_LITE" "RSL_LITE=FALSE" "RSL_LITE=TRUE" "NONE" 5 \ |
---|
49 | "ESMF_Library" "ESMF_LIB=FALSE" "ESMF_LIB=TRUE" "ONLY_AIX" 6 \ |
---|
50 | "Quilting" "QUILT=FALSE" "QUILT=TRUE" "NONE" 7 \ |
---|
51 | "Binary_IO" "IO_FORM=2" "IO_FORM=1" "NONE" 8 \ |
---|
52 | "GriB1_Output" "IO_FORM=2" "IO_FORM=5" "NONE" 9 \ |
---|
53 | "REAL8_Floats" "REAL8=FALSE" "REAL8=TRUE" "NONE" 10 \ |
---|
54 | "Moving_Nest2" "COMBO_NEST_RSL__LITE=FALSE" \ |
---|
55 | "COMBO_NEST_RSL__LITE=TRUE" \ |
---|
56 | "NONE" 11 \ |
---|
57 | "FDDA" "FDDA=FALSE" "FDDA=TRUE" "NONE" 12 \ |
---|
58 | ) |
---|
59 | |
---|
60 | # Where are we located. |
---|
61 | |
---|
62 | set starting_dir = `pwd` |
---|
63 | |
---|
64 | # Get the tag manually. This is for the auto-report that gets |
---|
65 | # sent to the WRF web page on the history of the regression tests. |
---|
66 | |
---|
67 | set current_year4 = `date -u +"%Y"` |
---|
68 | set current_month = `date -u +"%m"` |
---|
69 | set current_day = `date -u +"%d"` |
---|
70 | set current_hour = `date -u +"%H"` |
---|
71 | set current_minute = `date -u +"%M"` |
---|
72 | set current_second = `date -u +"%S"` |
---|
73 | set datehms = ${current_year4}-${current_month}-${current_day}_${current_hour}:${current_minute}:${current_second}_UTC |
---|
74 | set dateh = ${current_year4}${current_month}${current_day}${current_hour} |
---|
75 | set date = ${current_year4}${current_month}${current_day} |
---|
76 | if ( ! $?TAG ) then |
---|
77 | if ( $user == michalak ) then |
---|
78 | set initials = jm |
---|
79 | else if ( $user == hender ) then |
---|
80 | set initials = th |
---|
81 | else if ( $user == gill ) then |
---|
82 | set initials = dg |
---|
83 | else if ( $user == dudhia ) then |
---|
84 | set initials = jd |
---|
85 | else if ( $user == weiwang ) then |
---|
86 | set initials = ww |
---|
87 | else |
---|
88 | set initials = XX |
---|
89 | endif |
---|
90 | echo the TAG is NOT defined |
---|
91 | echo Please define an environment variable that is the WRFV2 tag |
---|
92 | echo Something such as: setenv TAG trunk_${date}_${initials} |
---|
93 | echo " " |
---|
94 | exit ( 1 ) |
---|
95 | endif |
---|
96 | |
---|
97 | # Are we only interested in the PASS/FAIL report? |
---|
98 | |
---|
99 | if ( $#argv == 1 ) then |
---|
100 | if ( $argv[1] == PASSFAIL ) then |
---|
101 | goto PASSFAIL |
---|
102 | endif |
---|
103 | endif |
---|
104 | |
---|
105 | # If there are any command line args, they are processed, else |
---|
106 | # we run all of the regression tests without a generate or |
---|
107 | # compare flag being set. |
---|
108 | |
---|
109 | if ( $#argv == 0 ) then |
---|
110 | |
---|
111 | set BASELINE = RUN_ONLY |
---|
112 | |
---|
113 | set OLD_TEXT |
---|
114 | set NEW_TEXT |
---|
115 | set TOAST |
---|
116 | set tests |
---|
117 | set TEST_NUM |
---|
118 | set count_test = 1 |
---|
119 | while ( $count_test < $#NAME ) |
---|
120 | set tests = ( $tests "$NAME[$count_test]" ) |
---|
121 | @ count_test ++ |
---|
122 | set OLD_TEXT = ( $OLD_TEXT "$NAME[$count_test]" ) |
---|
123 | @ count_test ++ |
---|
124 | set NEW_TEXT = ( $NEW_TEXT "$NAME[$count_test]" ) |
---|
125 | @ count_test ++ |
---|
126 | set TOAST = ( $TOAST "$NAME[$count_test]" ) |
---|
127 | @ count_test ++ |
---|
128 | set TEST_NUM = ( $TEST_NUM "$NAME[$count_test]" ) |
---|
129 | @ count_test ++ |
---|
130 | end |
---|
131 | |
---|
132 | # We have some command line args. They are either a request to run |
---|
133 | # the test with a generate/compare flag, or a list of tests to perform. |
---|
134 | |
---|
135 | else |
---|
136 | |
---|
137 | set INIT_OPTS = ( $* ) |
---|
138 | |
---|
139 | # First, find the baseline type. This is going to be one of three |
---|
140 | # possibilities: GENERATE, COMPARE, or a RUN_ONLY option. The |
---|
141 | # default is RUN_ONLY. Only the first baseline option found is |
---|
142 | # used. |
---|
143 | |
---|
144 | set count = 0 |
---|
145 | while ( $count < $#INIT_OPTS ) |
---|
146 | @ count ++ |
---|
147 | set arg = $INIT_OPTS[$count] |
---|
148 | if ( ( $arg == GENERATE ) || \ |
---|
149 | ( $arg == COMPARE ) || \ |
---|
150 | ( $arg == RUN_ONLY ) ) then |
---|
151 | set BASELINE = $arg |
---|
152 | goto FINISHED_BASELINE_TYPE |
---|
153 | endif |
---|
154 | end |
---|
155 | set BASELINE = RUN_ONLY |
---|
156 | FINISHED_BASELINE_TYPE: |
---|
157 | |
---|
158 | # If there was only one input, and it was telling us to do which type of baseline |
---|
159 | # option (GENERATE, COMPARE, RUN_ONLY), we assume they want all of the tests |
---|
160 | # conducted. |
---|
161 | |
---|
162 | if ( $#INIT_OPTS == 1 ) then |
---|
163 | if ( ( $INIT_OPTS == GENERATE ) || ( $INIT_OPTS == COMPARE ) || ( $INIT_OPTS == RUN_ONLY ) ) then |
---|
164 | set OLD_TEXT |
---|
165 | set NEW_TEXT |
---|
166 | set TOAST |
---|
167 | set tests |
---|
168 | set TEST_NUM |
---|
169 | set count_test = 1 |
---|
170 | while ( $count_test < $#NAME ) |
---|
171 | set tests = ( $tests "$NAME[$count_test]" ) |
---|
172 | @ count_test ++ |
---|
173 | set OLD_TEXT = ( $OLD_TEXT "$NAME[$count_test]" ) |
---|
174 | @ count_test ++ |
---|
175 | set NEW_TEXT = ( $NEW_TEXT "$NAME[$count_test]" ) |
---|
176 | @ count_test ++ |
---|
177 | set TOAST = ( $TOAST "$NAME[$count_test]" ) |
---|
178 | @ count_test ++ |
---|
179 | set TEST_NUM = ( $TEST_NUM "$NAME[$count_test]" ) |
---|
180 | @ count_test ++ |
---|
181 | end |
---|
182 | goto FINISHED_TEST_LIST |
---|
183 | endif |
---|
184 | endif |
---|
185 | |
---|
186 | # Find which tests are to be conducted. Loop over all of the |
---|
187 | # input, and compare each of the input fields with the list |
---|
188 | # of available test names. When a match occurs, increment the |
---|
189 | # test found counter, and save the test name. |
---|
190 | |
---|
191 | set count = 0 |
---|
192 | set OLD_TEXT |
---|
193 | set NEW_TEXT |
---|
194 | set TOAST |
---|
195 | set tests |
---|
196 | set TEST_NUM |
---|
197 | while ( $count < $#INIT_OPTS ) |
---|
198 | @ count ++ |
---|
199 | set count_test = 1 |
---|
200 | while ( $count_test < $#NAME ) |
---|
201 | if ( $INIT_OPTS[$count] == $NAME[$count_test] ) then |
---|
202 | set tests = ( $tests "$NAME[$count_test]" ) |
---|
203 | @ count_test ++ |
---|
204 | set OLD_TEXT = ( $OLD_TEXT "$NAME[$count_test]" ) |
---|
205 | @ count_test ++ |
---|
206 | set NEW_TEXT = ( $NEW_TEXT "$NAME[$count_test]" ) |
---|
207 | @ count_test ++ |
---|
208 | set TOAST = ( $TOAST "$NAME[$count_test]" ) |
---|
209 | @ count_test ++ |
---|
210 | set TEST_NUM = ( $TEST_NUM "$NAME[$count_test]" ) |
---|
211 | @ count_test ++ |
---|
212 | else |
---|
213 | @ count_test += 5 |
---|
214 | endif |
---|
215 | end |
---|
216 | end |
---|
217 | |
---|
218 | # If there are no recognizable tests requested, let them know our concern. |
---|
219 | |
---|
220 | if ( $#tests == 0 ) then |
---|
221 | echo No valid test requested in argument list |
---|
222 | exit ( 4 ) |
---|
223 | endif |
---|
224 | endif |
---|
225 | FINISHED_TEST_LIST: |
---|
226 | |
---|
227 | # A friendly check for the baseline directory existence, and locations for known |
---|
228 | # NCAR machines. |
---|
229 | |
---|
230 | if ( ( $BASELINE == GENERATE ) || ( $BASELINE == COMPARE ) ) then |
---|
231 | if ( ( `uname` == AIX ) && ( ( `hostname | cut -c 1-2` != bs ) && ( `hostname | cut -c 1-2` != bv ) ) ) then |
---|
232 | set SAVE_DIR = /ptmp/${USER}/BASELINE/`uname` |
---|
233 | else if ( `uname` == AIX ) then |
---|
234 | set SAVE_DIR = /ptmp/${USER}/BASELINE/`uname` |
---|
235 | else if ( ( `uname` == OSF1 ) && ( `hostname | cut -c 1-6` == joshua ) ) then |
---|
236 | set SAVE_DIR = /data3/mp/${USER}/BASELINE/`uname` |
---|
237 | else if ( ( `uname` == Linux ) && ( `hostname` == bay-mmm ) ) then |
---|
238 | set SAVE_DIR = /data3/mp/${USER}/BASELINE/`uname` |
---|
239 | else |
---|
240 | echo Hmm, no idea where to put/get this baseline data, stopping |
---|
241 | exit ( 10 ) |
---|
242 | endif |
---|
243 | |
---|
244 | if ( ( -d $SAVE_DIR ) && ( $BASELINE == GENERATE ) ) then |
---|
245 | echo "Troubles with SAVE_DIR logic." |
---|
246 | echo "$SAVE_DIR should not exist for a $BASELINE run." |
---|
247 | # exit ( 2 ) |
---|
248 | else if ( ( ! -d $SAVE_DIR ) && ( $BASELINE == COMPARE ) ) then |
---|
249 | echo "Troubles with SAVE_DIR logic." |
---|
250 | echo "$SAVE_DIR should exist for a $BASELINE run." |
---|
251 | exit ( 3 ) |
---|
252 | endif |
---|
253 | endif |
---|
254 | |
---|
255 | # We need the regtest.csh file, badly. |
---|
256 | |
---|
257 | if ( ! -e regtest.csh ) then |
---|
258 | echo we need regtest.csh in this dir |
---|
259 | echo "supply-ez vous, s'il vous plait" |
---|
260 | exit ( 1 ) |
---|
261 | endif |
---|
262 | |
---|
263 | # The regtest.csh file is treated as a template. The following |
---|
264 | # strings (first occurrence) is sought (OLD_TEXT) and replaced |
---|
265 | # with the modified string (NEW_TEXT). This edited regression |
---|
266 | # script is then processed. |
---|
267 | |
---|
268 | # Any exceptions to where they can run? NONE means no |
---|
269 | # exceptions, should run on all machines. AIX/Linux/OSF1 |
---|
270 | # means it will NOT run on that single machine. The |
---|
271 | # option ONLY_AIX/ONLY_Linux/ONLY_OSF1 means that the option |
---|
272 | # ONLY works on that specific architecture. |
---|
273 | |
---|
274 | |
---|
275 | # Loop over all selected tests. |
---|
276 | |
---|
277 | set count_test = 0 |
---|
278 | while ( $count_test < $#tests ) |
---|
279 | |
---|
280 | @ count_test ++ |
---|
281 | |
---|
282 | set count = 1 |
---|
283 | while ( $count < $#NAME ) |
---|
284 | |
---|
285 | if ( "$tests[$count_test]" == "$NAME[$count]" ) then |
---|
286 | goto FOUND_SELECTED_TEST |
---|
287 | endif |
---|
288 | @ count += 5 |
---|
289 | end |
---|
290 | echo "Hmmm, no valid test found" |
---|
291 | exit ( 11 ) |
---|
292 | |
---|
293 | FOUND_SELECTED_TEST: |
---|
294 | |
---|
295 | # Specifically skip this test on this architecture. |
---|
296 | |
---|
297 | if ( `uname` == $TOAST[$count_test] ) then |
---|
298 | echo skipping test $tests[$count_test] for `uname` specifically |
---|
299 | |
---|
300 | # Skip this test on this architecture because it ONLY runs |
---|
301 | # on a different architecture. |
---|
302 | |
---|
303 | else if ( ( `echo $TOAST[$count_test] | cut -c 1-5` == ONLY_ ) && ( ONLY_`uname` != $TOAST[$count_test] ) ) then |
---|
304 | echo skipping test $tests[$count_test] for `uname`, works on $TOAST[$count_test] |
---|
305 | |
---|
306 | # OK, we are allowed to run this test on this architecture. |
---|
307 | |
---|
308 | else if ( ( $TOAST[$count_test] == NONE ) || \ |
---|
309 | ( $TOAST[$count_test] != `uname` ) || \ |
---|
310 | ( ONLY_`uname` == $TOAST[$count_test] ) ) then |
---|
311 | echo doing test $tests[$count_test] for `uname` |
---|
312 | |
---|
313 | # If this is the generate or compare baseline test, where do we |
---|
314 | # save the data to/read the data from. |
---|
315 | |
---|
316 | if ( ( $BASELINE == GENERATE ) || ( $BASELINE == COMPARE ) ) then |
---|
317 | if ( ( `uname` == AIX ) && ( ( `hostname | cut -c 1-2` != bs ) && ( `hostname | cut -c 1-2` != bv ) ) ) then |
---|
318 | set SAVE_DIR = /ptmp/${USER}/BASELINE/`uname`/$tests[$count_test] |
---|
319 | else if ( `uname` == AIX ) then |
---|
320 | set SAVE_DIR = /ptmp/${USER}/BASELINE/`uname`/$tests[$count_test] |
---|
321 | else if ( ( `uname` == OSF1 ) && ( `hostname | cut -c 1-6` == joshua ) ) then |
---|
322 | set SAVE_DIR = /data3/mp/${USER}/BASELINE/`uname`/$tests[$count_test] |
---|
323 | else if ( ( `uname` == Linux ) && ( `hostname` == bay-mmm ) ) then |
---|
324 | set SAVE_DIR = /data3/mp/${USER}/BASELINE/`uname`/$tests[$count_test] |
---|
325 | else |
---|
326 | echo No idea where to put the data, stopping |
---|
327 | exit ( 2 ) |
---|
328 | endif |
---|
329 | |
---|
330 | # Either zap existing stuff (GENERATE), or make sure it is there (COMPARE) |
---|
331 | |
---|
332 | if ( $BASELINE == GENERATE ) then |
---|
333 | /bin/rm -rf $SAVE_DIR |
---|
334 | else if ( ( $BASELINE == COMPARE ) && ( $tests[$count_test] != Full_Optimization ) ) then |
---|
335 | if ( ! -d $SAVE_DIR ) then |
---|
336 | echo $SAVE_DIR does not exist for BASELINE comparison, stopping |
---|
337 | exit ( 3 ) |
---|
338 | endif |
---|
339 | else if ( ( $BASELINE == COMPARE ) && ( $tests[$count_test] == Full_Optimization ) ) then |
---|
340 | echo No comparison done with baseline since this is an optimized run |
---|
341 | endif |
---|
342 | endif |
---|
343 | |
---|
344 | # Build the short edit input script for ed and edit the regtest.csh file. |
---|
345 | |
---|
346 | set OLDT = `echo $OLD_TEXT[$count_test] | sed 's/=/ = /'` |
---|
347 | set NEWT = `echo $NEW_TEXT[$count_test] | sed 's/=/ = /'` |
---|
348 | |
---|
349 | if ( ( $BASELINE == RUN_ONLY ) || ( $tests[$count_test] == Full_Optimization ) ) then |
---|
350 | if ( -e ed.in ) rm ed.in |
---|
351 | cat >! ed_in << EOF |
---|
352 | ,s/$OLDT/$NEWT/ |
---|
353 | w reg.foo.$TEST_NUM[$count_test].$tests[$count_test] |
---|
354 | q |
---|
355 | EOF |
---|
356 | else if ( $BASELINE == GENERATE ) then |
---|
357 | if ( -e ed.in ) rm ed.in |
---|
358 | cat >! ed_in << EOF |
---|
359 | ,s/$OLDT/$NEWT/ |
---|
360 | ,s?GENERATE_BASELINE = FALSE?GENERATE_BASELINE = $SAVE_DIR? |
---|
361 | w reg.foo.$TEST_NUM[$count_test].$tests[$count_test] |
---|
362 | q |
---|
363 | EOF |
---|
364 | else if ( $BASELINE == COMPARE ) then |
---|
365 | if ( -e ed.in ) rm ed.in |
---|
366 | cat >! ed_in << EOF |
---|
367 | ,s/$OLDT/$NEWT/ |
---|
368 | ,s?COMPARE_BASELINE = FALSE?COMPARE_BASELINE = $SAVE_DIR? |
---|
369 | w reg.foo.$TEST_NUM[$count_test].$tests[$count_test] |
---|
370 | q |
---|
371 | EOF |
---|
372 | endif |
---|
373 | ed regtest.csh < ed_in >& /dev/null |
---|
374 | chmod +x reg.foo.$TEST_NUM[$count_test].$tests[$count_test] |
---|
375 | |
---|
376 | # On AIX, we submit jobs to the load leveler queue for bluesky and to the LSF queue for |
---|
377 | # bluevista. After submission, we wait around until it completes, and then we send in |
---|
378 | # the next one. |
---|
379 | |
---|
380 | if ( ( `uname` == AIX ) && ( `hostname | cut -c 1-2` == bs ) ) then |
---|
381 | llsubmit reg.foo.$TEST_NUM[$count_test].$tests[$count_test] >&! llsub.out |
---|
382 | set ok = 0 |
---|
383 | set in_already = 0 |
---|
384 | while ( $ok == 0 ) |
---|
385 | sleep 10 ; llq -u $USER >&! llq.report |
---|
386 | grep `cat llsub.out | grep '"bs1' | cut -d\" -f2` llq.report >& /dev/null |
---|
387 | set ok = $status |
---|
388 | if ( ( $ok == 0 ) && ( $in_already == 0 ) ) then |
---|
389 | set in_already = 1 |
---|
390 | set joe_id = `cat llsub.out | grep '"bs1' | cut -d\" -f2 | cut -d. -f2` |
---|
391 | endif |
---|
392 | end |
---|
393 | cp /ptmp/$USER/wrf_regression.$joe_id/wrftest.output wrftest.output.$TEST_NUM[$count_test].$tests[$count_test] |
---|
394 | rm llsub.out llq.report |
---|
395 | else if ( ( `uname` == AIX ) && ( `hostname | cut -c 1-2` == bv ) ) then |
---|
396 | bsub < reg.foo.$TEST_NUM[$count_test].$tests[$count_test] >&! bsub.out |
---|
397 | set ok = 0 |
---|
398 | set in_already = 0 |
---|
399 | while ( $ok == 0 ) |
---|
400 | sleep 10 ; bjobs >&! bjobs.report |
---|
401 | grep `cat bsub.out | grep Job | cut -d"<" -f2 | cut -d">" -f1` bjobs.report >& /dev/null |
---|
402 | set ok = $status |
---|
403 | if ( ( $ok == 0 ) && ( $in_already == 0 ) ) then |
---|
404 | set in_already = 1 |
---|
405 | set joe_id = `cat bsub.out | grep Job | cut -d"<" -f2 | cut -d">" -f1` |
---|
406 | endif |
---|
407 | end |
---|
408 | cp /ptmp/$USER/wrf_regression.$joe_id/wrftest.output wrftest.output.$TEST_NUM[$count_test].$tests[$count_test] |
---|
409 | rm bsub.out bjobs.report |
---|
410 | else if ( ( `uname` == AIX ) && ( ( `hostname | cut -c 1-2` != bs ) && ( `hostname | cut -c 1-2` != bv ) ) ) then |
---|
411 | llsubmit reg.foo.$TEST_NUM[$count_test].$tests[$count_test] >&! llsub.out |
---|
412 | set ok = 0 |
---|
413 | set in_already = 0 |
---|
414 | while ( $ok == 0 ) |
---|
415 | sleep 10 ; llq -u $USER >&! llq.report |
---|
416 | set llsubmit_name_all = `cat llsub.out | grep '"b' | cut -d\" -f2` |
---|
417 | set llsubmit_name_front = `echo $llsubmit_name_all | cut -d\. -f1` |
---|
418 | set llsubmit_name_end = `echo $llsubmit_name_all | cut -d\. -f5` |
---|
419 | grep $llsubmit_name_front llq.report | grep $llsubmit_name_end >& /dev/null |
---|
420 | set ok = $status |
---|
421 | if ( ( $ok == 0 ) && ( $in_already == 0 ) ) then |
---|
422 | set in_already = 1 |
---|
423 | set joe_id = `cat llsub.out | grep '"b' | cut -d\" -f2 | cut -d. -f5` |
---|
424 | endif |
---|
425 | end |
---|
426 | cp /ptmp/$USER/wrf_regression.$joe_id/wrftest.output wrftest.output.$TEST_NUM[$count_test].$tests[$count_test] |
---|
427 | rm llsub.out llq.report |
---|
428 | |
---|
429 | # On the "other" non-queued machines, we just execute the script and wait until |
---|
430 | # we get the process returning control, then we move on. |
---|
431 | |
---|
432 | else |
---|
433 | reg.foo.$TEST_NUM[$count_test].$tests[$count_test] -f wrf.tar # >&! output.$TEST_NUM[$count_test].$tests[$count_test] |
---|
434 | mv wrftest.output wrftest.output.$TEST_NUM[$count_test].$tests[$count_test] |
---|
435 | # if ( $NUM_TESTS != $#NAME ) then |
---|
436 | # if ( -d regression_test ) rm -rf regression_test |
---|
437 | # else |
---|
438 | if ( -d regression_test ) then |
---|
439 | mv regression_test regression_test.$TEST_NUM[$count_test].$tests[$count_test] |
---|
440 | endif |
---|
441 | # endif |
---|
442 | endif |
---|
443 | endif |
---|
444 | end |
---|
445 | |
---|
446 | if ( ( `uname` == AIX ) && ( ( `hostname | cut -c 1-2` != bs ) && ( `hostname | cut -c 1-2` != bv ) ) ) then |
---|
447 | echo no web page building, stopping |
---|
448 | exit |
---|
449 | endif |
---|
450 | |
---|
451 | PASSFAIL: |
---|
452 | |
---|
453 | # Build the html page. We only need the middle portion. It's |
---|
454 | # a table with 5 columns: Date of test, WRFV2 tag, Developer |
---|
455 | # who conducted the test, machine the test was run on, and the |
---|
456 | # pass/fail status of the all_reg.csh script when comapred |
---|
457 | # to the benchmark results (usually a released code). |
---|
458 | |
---|
459 | cat >! history_middle_OK.html << EOF |
---|
460 | <tr> |
---|
461 | <td> XDATEX </td> |
---|
462 | <td> XTAGX </td> |
---|
463 | <td> XTESTERX </td> |
---|
464 | <td> XARCHITECTUREX </td> |
---|
465 | <td BGCOLOR="#00FF00"><a href="ARCHITECTURE/wrftest.all_${datehms}">PASS</a> |
---|
466 | <a href="ARCHITECTURE/message_${datehms}">DIFFS</a></td> |
---|
467 | <td> |
---|
468 | <!-- |
---|
469 | <a href="other_docs/${date}_notes">Descriptions</a> |
---|
470 | <a href="other_docs/${date}_minutes">Minutes</a> |
---|
471 | --> |
---|
472 | </td> |
---|
473 | </tr> |
---|
474 | EOF |
---|
475 | |
---|
476 | cat >! history_middle_OOPS.html << EOF |
---|
477 | <tr> |
---|
478 | <td> XDATEX </td> |
---|
479 | <td> XTAGX </td> |
---|
480 | <td> XTESTERX </td> |
---|
481 | <td> XARCHITECTUREX </td> |
---|
482 | <td BGCOLOR="#FF0000"><a href="ARCHITECTURE/wrftest.all_${datehms}">FAIL</a> |
---|
483 | <a href="ARCHITECTURE/message_${datehms}">DIFFS</a></td> |
---|
484 | <td> |
---|
485 | <!-- |
---|
486 | <a href="other_docs/${date}_notes">Descriptions</a> |
---|
487 | <a href="other_docs/${date}_minutes">Minutes</a> |
---|
488 | --> |
---|
489 | </td> |
---|
490 | </tr> |
---|
491 | EOF |
---|
492 | |
---|
493 | set name = `uname` |
---|
494 | cat >! ed2.in << EOF |
---|
495 | ,s/ARCHITECTURE/${name}/g |
---|
496 | w history_middle.html |
---|
497 | q |
---|
498 | EOF |
---|
499 | |
---|
500 | # Get all of the wrftest.output.* files in one BIG file. |
---|
501 | |
---|
502 | if ( -e wrftest.all_$datehms ) rm wrftest.all_$datehms |
---|
503 | cat wrftest.output.?.* wrftest.output.??.* >>! wrftest.all_$datehms |
---|
504 | if ( -d `uname` ) rm -rf `uname` |
---|
505 | mkdir `uname` |
---|
506 | mv wrftest.all_$datehms `uname` |
---|
507 | |
---|
508 | # Compare regression PASS/FAILs with previous runs. |
---|
509 | |
---|
510 | pushd ~gill/RESULTS/`uname` |
---|
511 | grep FAIL wrftest.output.* >! ${starting_dir}/PREV.FAILS |
---|
512 | popd |
---|
513 | grep FAIL wrftest.output.* >! CURR.FAILS |
---|
514 | echo Comparison of regression results on `hostname` for `date` >! message |
---|
515 | echo "==================================================================" >> message |
---|
516 | echo " " >> message |
---|
517 | echo "Previous FAILs" >> message |
---|
518 | echo "==================" >> message |
---|
519 | echo " " >> message |
---|
520 | cat PREV.FAILS >> message |
---|
521 | echo " " >> message |
---|
522 | echo "Current FAILs" >> message |
---|
523 | echo "==================" >> message |
---|
524 | echo " " >> message |
---|
525 | cat CURR.FAILS >> message |
---|
526 | echo " " >> message |
---|
527 | echo "Difference of FAILs" >> message |
---|
528 | echo "==================" >> message |
---|
529 | echo " " >> message |
---|
530 | cat CURR.FAILS | grep -vi baseline >! CURR2.FAILS |
---|
531 | diff PREV.FAILS CURR2.FAILS >! diffs |
---|
532 | set ok = $status |
---|
533 | cat diffs >> message |
---|
534 | echo " " >> message |
---|
535 | cp message message_$datehms |
---|
536 | mv message_$datehms `uname` |
---|
537 | |
---|
538 | # Send out status info on the regression test. |
---|
539 | |
---|
540 | set OS = `uname` |
---|
541 | set NUMARGS = $#argv |
---|
542 | if ( $#argv != 0 ) then |
---|
543 | set ARG1 = $argv[1] |
---|
544 | else |
---|
545 | set ARG1 = BLANK |
---|
546 | endif |
---|
547 | |
---|
548 | if ( ( $NUMARGS == 0 ) || ( $ARG1 == PASSFAIL ) || \ |
---|
549 | ( ( $ARG1 == COMPARE ) && ( $NUMARGS == 1 ) ) || \ |
---|
550 | ( ( $ARG1 == GENERATE ) && ( $NUMARGS == 1 ) ) ) then |
---|
551 | if ( $ok != 0 ) then |
---|
552 | Mail -s "REG DIFFS $OS" ${user}@ucar.edu < message |
---|
553 | echo " " |
---|
554 | echo "Different FAILS from before for $OS - repository may have been broken" |
---|
555 | echo " " |
---|
556 | m4 -DXDATEX=${dateh} -DXTAGX=${TAG} -DXTESTERX=${user} -DXARCHITECTUREX=`uname` \ |
---|
557 | history_middle_OOPS.html >! history_middle_1.html |
---|
558 | else if ( $ok == 0 ) then |
---|
559 | Mail -s "REG OK $OS" ${user}@ucar.edu < message |
---|
560 | echo " " |
---|
561 | echo "Same FAILS as before for $OS - repository OK" |
---|
562 | echo " " |
---|
563 | m4 -DXDATEX=${dateh} -DXTAGX=${TAG} -DXTESTERX=${user} -DXARCHITECTUREX=`uname` \ |
---|
564 | history_middle_OK.html >! history_middle_1.html |
---|
565 | endif |
---|
566 | |
---|
567 | # Store on the NCAR MSS system to circumvent security. |
---|
568 | |
---|
569 | ed history_middle_1.html < ed2.in >& /dev/null |
---|
570 | tar -cf `uname`_hist.tar history_middle.html `uname` |
---|
571 | echo Storing info on NCAR MSS |
---|
572 | msrcp `uname`_hist.tar mss:/GILL/ALLREG/`uname`_hist.tar |
---|
573 | if ( -e `uname`_NEW ) rm `uname`_NEW |
---|
574 | echo "`uname` `date`" >! `uname`_NEW |
---|
575 | msrcp `uname`_NEW mss:/GILL/ALLREG/`uname`_NEW |
---|
576 | endif |
---|
577 | |
---|
578 | rm ed_in >& /dev/null |
---|
579 | rm io_format >& /dev/null |
---|
580 | rm PREV.FAILS CURR.FAILS CURR2.FAILS message diffs >& /dev/null |
---|
581 | rm history_middle_OOPS.html history_middle_OK.html history_middle_1.html history_middle.html >& /dev/null |
---|
582 | rm `uname`_hist.tar `uname`_NEW ed2.in >& /dev/null |
---|
583 | rm -rf `uname` >& /dev/null |
---|