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