Changeset 2261
- Timestamp:
- Jun 8, 2017 2:25:57 PM (7 years ago)
- Location:
- palm/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/batch_scp
r1310 r2261 1 #! /bin/ ksh1 #! /bin/bash 2 2 3 3 # batch_scp - script for automatic file/directory transfer using scp … … 22 22 # Current revisions: 23 23 # ------------------ 24 # 25 # 24 # 25 # 26 26 # Former revisions: 27 27 # ----------------- 28 28 # $Id$ 29 # option usecycle added, script is running under bash now, 30 # filenames are allowed to contain arbitrary number of dots "." 31 # 32 # 1310 2014-03-14 08:01:56Z raasch 29 33 # 30 34 # 1202 2013-07-10 16:22:07Z witha … … 52 56 # batch_scp - script for automatic file/directory transfers using scp 53 57 # 54 # batch_scp has 4 arguments:58 # batch_scp has up to 5 arguments (first 4 are mandatory): 55 59 # $1 = IP-addres of remote (target) machine 56 60 # $2 = file to be transferred 57 61 # $3 = directory of remote machine, where file should be copied to 58 62 # $4 = filename that file should be given on remote machine 63 # $5 = file extension (optional argument) 59 64 # 60 65 # ATTENTION: problems might occur if directories on remote machine include very … … 89 94 transfermode=binary 90 95 zyklusnr="" 91 typeset -i iii icycle maxcycle=0 wait=096 typeset -i iii icycle maxcycle=0 usecycle wait=0 92 97 93 98 # FEHLERBEHANDLUNG … … 113 118 114 119 # SHELLSCRIPT-OPTIONEN EINLESEN 115 while getopts :aAbcCdgmnoP:qsu: w: option120 while getopts :aAbcCdgmnoP:qsu:U:w: option 116 121 do 117 122 case $option in … … 130 135 (s) silent=true;; 131 136 (u) remote_user=$OPTARG;; 137 (U) usecycle=$OPTARG;; 132 138 (w) wait=$OPTARG;; 133 139 (\?) printf " +++ option $OPTARG unknown \n" … … 136 142 esac 137 143 done 138 shift OPTIND-1 144 145 (( to_shift = $OPTIND - 1 )) 146 shift $to_shift 147 139 148 140 149 … … 144 153 then 145 154 (printf "\n *** batch_scp can be called as follows:\n" 146 printf "\n batch_scp -a -b -d -g -o -q -s -u.. - w.. <param1> <param2> <param3> <param4>\n"155 printf "\n batch_scp -a -b -d -g -o -q -s -u.. -U.. -w.. <param1> <param2> <param3> <param4>\n" 147 156 printf "\n Description of available options:\n" 148 157 printf "\n Option Description Default-Value" … … 163 172 printf "\n -s do not display informative messages ---" 164 173 printf "\n -u username on remote machine <username>" 174 printf "\n -U cycle number to be used ---" 165 175 printf "\n -w waiting time in seconds, before trans- 0" 166 176 printf "\n fer will be initiated" … … 226 236 227 237 228 # DATEINAME IM 4. ARGUMENT DARF NUR BEIM UEBERSCHREIBEN ODER IM ABSOLUT-229 # MODUS PUNKTE ENTHALTEN230 if [[ $overwrite = false && $absolut = false && $(echo $4 | grep -c "\.") != 0 ]]231 then232 printf " +++ 4th argument may only contain dots (".") , if one of the \n"233 printf " options -a or -o are given \n"234 locat=argument; exit235 fi236 237 238 238 # QUOTE WAIT FUNKTIONIERT NICHT BEIM KOPIEREN GANZER VERZEICHNISSE 239 239 if [[ $quote_wait = true && $catalog_copy = true ]] … … 386 386 if [[ $absolut = false ]] 387 387 then 388 text=$(echo $zeile | cut -f1 -d".") 389 if [[ "$text" = "$4" ]] 390 then 391 found=true 392 cycle=$(echo $zeile | cut -f2 -d".") 393 if [[ "$cycle" = "$text" ]] 394 then 388 # REMOVE EXTENSION, IF EXISTING AND GIVEN AS ARGUMENT 389 if [[ "$5" != "" && "$5" != " " ]] 390 then 391 extension=${zeile##*.} 392 if [[ $extension = $5 ]] 393 then 394 text=${zeile%.*} 395 else 396 text=${zeile} 397 fi 398 else 399 text=${zeile} 400 fi 401 402 # GET AND REMOVE CYCLE NUMBER, IF EXISTING, AND CHECK, IF FILE EXISTS 403 cycle=${text##*.} 404 if [[ $cycle = $text ]] 405 then 406 # filename contains no dot, i.e. no cycle number 407 if [[ "$text" = "$4" ]] 408 then 409 found=true 395 410 (( icycle = 0 )) 396 else 397 398 # PRUEFEN, OB CYCLE EINE ZAHL IST 399 (( iii = 1 )) 400 character=`echo $cycle | cut -c$iii` 401 character_found=false 402 while [[ "$character" != "" && $character_found = false ]] 403 do 404 case $character in 405 (0|1|2|3|4|5|6|7|8|9) true;; 406 (*) character_found=true 407 esac 408 (( iii = iii + 1 )) 409 character=`echo $cycle | cut -c$iii` 410 done 411 412 if [[ $character_found = false ]] 411 fi 412 else 413 # filename contains at least one dot 414 # find out if the string after the last dot is a number 415 if [[ $cycle =~ ^-?[0-9]+$ ]] 416 then 417 text=${text%.*} 418 if [[ "$text" = "$4" ]] 413 419 then 420 found=true 414 421 (( icycle = $cycle )) 415 422 fi 416 fi >|$errfile 2>&1 # AUSGABE FEHLER AUF ERRFILE WENN CYCLE NICHTNUMERISCH 417 418 419 # INFORMATIVE AUSGABE, WENN DATEI NICHTNUMERISCHE EXTENSION HAT 420 # if [[ $(cat $errfile | grep -c "bad number") != 0 ]] 421 if [[ $character_found = true ]] 422 then 423 if [[ $cycle != "$5" ]] 423 else 424 if [[ "$text" = "$4" ]] 424 425 then 425 printf " +++ file \"$text\" has non-numerical extension \".$cycle\" \n" 426 locat=file; exit 427 else 428 if [[ $silent = false ]] 429 then 430 printf " >>> file \"$text\" has non-numerical extension \".$cycle\" \n" 431 fi 426 found=true 427 (( icycle = 0 )) 432 428 fi 433 429 fi 430 fi 431 432 433 # text=$(echo $zeile | cut -f1 -d".") 434 # 435 # if [[ "$text" = "$4" ]] 436 # then 437 # found=true 438 # cycle=$(echo $zeile | cut -f2 -d".") 439 # if [[ "$cycle" = "$text" ]] 440 # then 441 # (( icycle = 0 )) 442 # else 443 # 444 # # PRUEFEN, OB CYCLE EINE ZAHL IST 445 # (( iii = 1 )) 446 # character=`echo $cycle | cut -c$iii` 447 # character_found=false 448 # while [[ "$character" != "" && $character_found = false ]] 449 # do 450 # case $character in 451 # (0|1|2|3|4|5|6|7|8|9) true;; 452 # (*) character_found=true 453 # esac 454 # (( iii = iii + 1 )) 455 # character=`echo $cycle | cut -c$iii` 456 # done 457 # 458 # if [[ $character_found = false ]] 459 # then 460 # (( icycle = $cycle )) 461 # fi 462 # fi >|$errfile 2>&1 # AUSGABE FEHLER AUF ERRFILE WENN CYCLE NICHTNUMERISCH 463 # 464 # 465 # # INFORMATIVE AUSGABE, WENN DATEI NICHTNUMERISCHE EXTENSION HAT 466 # # if [[ $(cat $errfile | grep -c "bad number") != 0 ]] 467 # if [[ $character_found = true ]] 468 # then 469 # if [[ $cycle != "$5" ]] 470 # then 471 # printf " +++ file \"$text\" has non-numerical extension \".$cycle\" \n" 472 # locat=file; exit 473 # else 474 # if [[ $silent = false ]] 475 # then 476 # printf " >>> file \"$text\" has non-numerical extension \".$cycle\" \n" 477 # fi 478 # fi 479 # fi 434 480 435 481 if (( icycle > maxcycle )) … … 437 483 (( maxcycle = icycle )) 438 484 fi 439 fi485 # fi 440 486 441 487 else … … 458 504 then 459 505 (( maxcycle = maxcycle + 1 )) 506 # TRY TO USE FIXED CYCLE NUMBER, IF GIVEN AS OPTION 507 if [[ "$usecycle" != "" ]] 508 then 509 if (( usecycle >= maxcycle )) 510 then 511 (( maxcycle = usecycle )) 512 else 513 printf " >>> Unfied cycle number cannot be used\n" 514 fi 515 fi 460 516 zyklusnr=".$maxcycle" 461 517 else … … 489 545 fi 490 546 fi 547 491 548 else 492 zyklusnr="" 549 550 if [[ "$usecycle" != "" ]] 551 then 552 (( maxcycle = usecycle )) 553 zyklusnr=".$usecycle" 554 else 555 zyklusnr="" 556 fi 493 557 494 558 # ABBRUCH, WENN DATEI VON ZIELRECHNER GEHOLT WERDEN SOLL, DORT ABER -
palm/trunk/SCRIPTS/mrun
r2257 r2261 27 27 # ----------------- 28 28 # $Id$ 29 # unified cycle numbers for output files are used, 30 # paths and filenames are allowed to contain arbitrary numbers of dots ".", 31 # creation of file OUTPUT_FILE_CONNECTIONS removed, 32 # archive feature completely removed from the script, 33 # nech related parts completely removed 34 # 35 # 2257 2017-06-07 14:07:05Z witha 29 36 # adjustments for lceddy, removed lcflow-specific code 30 37 # … … 251 258 add_source_path="" 252 259 afname="" 253 archive_save=true254 archive_system=none255 260 check_namelist_files=false 256 261 combine_plot_fields=true … … 288 293 host_file="" 289 294 hp="" 290 ignore_archive_error=false291 295 input_list="" 292 296 interpreted_config_file="" … … 348 352 run_coupled_model=false 349 353 run_mode="" 350 store_on_archive_system=false351 354 dashes=" ----------------------------------------------------------------------------" 352 355 silent=false … … 370 373 # SIDE EFFECT MAY CAUSE DATA LOSS WHEN GETOPTS IS READING THE 371 374 # SCRIPT-OPTION ARGUMENTS 372 typeset -i cputime i ii iia iii iio icycle inode ival jobges jobsek last_char_int maxcycle minuten nodes pes remaining_pes sekunden tp1375 typeset -i cputime i ii iia iii iio icycle inode ival jobges jobsek last_char_int maxcycle minuten nodes pes remaining_pes run_number sekunden tp1 373 376 374 377 # ERROR HANDLING IN CASE OF EXIT … … 450 453 # READ SHELLSCRIPT-OPTIONS AND REBUILD THE MRUN-COMMAND STRING (MC), 451 454 # WHICH WILL BE USED TO START RESTART-JOBS 452 while getopts :a: AbBc:Cd:D:Fg:G:h:H:i:IkK:m:M:n:o:O:p:P:q:r:R:s:St:T:u:U:vw:xX:yY:zZ option455 while getopts :a:bBc:Cd:D:Fg:G:h:H:i:kK:m:M:n:o:O:p:P:q:r:R:s:St:T:u:U:vw:xX:yY:zZ option 453 456 do 454 457 case $option in 455 458 (a) afname=$OPTARG;; 456 (A) store_on_archive_system=true; mc="$mc -A";;457 459 (b) do_batch=true; mc="$mc -b";; 458 460 (B) delete_temporary_catalog=false; mc="$mc -B";; … … 460 462 (C) restart_run=true; mc="$mc -C";; 461 463 (d) fname=$OPTARG; mc="$mc -d$OPTARG";; 462 # (D) cpp_opts="$cpp_opts $OPTARG"; mc="$mc -D'$OPTARG'";;463 464 (F) job_on_file="-D"; mc="$mc -F";; 464 465 (g) group_number=$OPTARG; mc="$mc -g$OPTARG";; … … 467 468 (H) fromhost=$OPTARG; mc="$mc -H$OPTARG";; 468 469 (i) input_list=$OPTARG; mc="$mc -i'$OPTARG'";; 469 (I) ignore_archive_error=true; mc="$mc -I";;470 470 (k) keep_data_from_previous_run=true; mc="$mc -k";; 471 471 (K) additional_conditions="$OPTARG"; mc="$mc -K'$OPTARG'";; … … 514 514 printf "\n Option Description Default-Value" 515 515 printf "\n -a base name of input files equiv. -d" 516 printf "\n -A archiving when using file-attribute fl"517 516 printf "\n -b batch-job on local machine ---" 518 517 printf "\n -B do not delete temporary directory at end ---" … … 523 522 printf "\n -h execution host $localhost_realname" 524 523 printf "\n -i INPUT control list \"\" " 525 printf "\n -I archiving errors of previous batch-jobs"526 printf "\n will be ignored"527 524 printf "\n -k keep data from previous run" 528 525 printf "\n -K additional conditions for controling" … … 612 609 613 610 614 # SET HOST-SPECIFIC VARIABLES615 case $localhost_realname in616 (r1*|r2*|h01*|b01*) archive_system=tivoli;;617 (cs*) archive_system=ut;;618 esac619 620 621 611 # ??? THIS SHOULD BE DECRIBED IN THE MRUN DOCUMENTATION ??? 622 612 # SET BASENAME OF THE INPUT-FILES TO THE GENERAL BASENAME (GIVEN BY OPTION -d), … … 655 645 do_remote=true 656 646 case $host in 657 (ibm|ibmh|ibmkisti|ibmku|ibms| nech|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;;647 (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;; 658 648 (*) printf "\n" 659 649 printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" … … 714 704 715 705 fi 716 717 # CHECK, IF FILE-ARCHIVING HAS FAILED IN PREVIOUS JOB (OF A JOB-CHAIN)718 if [[ -f ~/job_queue/ARCHIVE_ERROR_$fname ]]719 then720 if [[ $ignore_archive_error = false ]]721 then722 printf "\n +++ data archiving of previous run failed"723 printf "\n see directory \~/job_queue on remote machine"724 locat=archive; exit725 else726 printf "\n +++ warning: data archiving in a previous run failed"727 printf "\n MRUN continues, trying to get backup copy"728 fi729 fi730 731 706 732 707 # SAVE VALUES OF MRUN-OPTIONS SICHERN IN ORDER TO OVERWRITE … … 813 788 do_remote=true 814 789 case $host in 815 (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean| nech|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;;790 (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;; 816 791 (*) printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" 817 792 printf "\n is not available" … … 938 913 939 914 # PROVIDE VALUES OF ENVIRONMENT-VARIABLE FOR interpret_config VIA NAMELIST-FILE 940 cat > .mrun_environment << %%END%%915 cat > .mrun_environment << EOF 941 916 &mrun_environment cond1 = '$cond1', cond2 = '$cond2', 942 917 config_file = '$config_file', do_remote = '$do_remote', … … 945 920 localhost = '$localhost', output_list = '$output_list' / 946 921 947 %%END%% 922 EOF 948 923 949 924 if [[ "$host" != $localhost ]] … … 1077 1052 do_remote=true 1078 1053 case $host in 1079 (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean| nech|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;;1054 (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;; 1080 1055 (*) printf "\n" 1081 1056 printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" … … 1220 1195 (lckyut) queue=cx-single;; 1221 1196 (lctit) queue=S;; 1222 (nech) queue=none;;1223 1197 (unics) queue=unics;; 1224 1198 esac … … 1256 1230 then 1257 1231 printf "\n\n +++ INPUT-file: " 1258 if [[ "${extin[$i]}" = "" ]]1232 if [[ "${extin[$i]}" = "" || "${extin[$i]}" = " " ]] 1259 1233 then 1260 1234 printf "\n $filename" … … 1274 1248 while read zeile 1275 1249 do 1276 cycle=$(echo $zeile | cut -f2 -d".") 1277 if [[ "$cycle" = "$zeile" ]] 1278 then 1279 (( icycle = 0 )) 1280 elif [[ "$cycle" = "${extin[$i]}" ]] 1281 then 1282 (( icycle = 0 )) 1283 else 1284 (( icycle = $cycle )) 1285 fi 1286 if (( icycle > maxcycle )) 1287 then 1288 (( maxcycle = icycle )) 1289 file_to_be_used=$zeile 1290 fi 1250 # filename without path (i.e. after the last "/") 1251 basefilename=$(basename ${zeile}) 1252 1253 # check if there is an extension 1254 extension=${basefilename##*.} 1255 if [[ "$extension" = "$extin[$i]" ]] 1256 then 1257 basefilename=${basefilename&.*} 1258 fi 1259 1260 # check for an existing cycle number 1261 cycle=${basefilename##*.} 1262 if [[ $cycle =~ ^-?[0-9]+$ ]] 1263 then 1264 (( icycle = $cycle )) 1265 else 1266 (( icycle = 0 )) 1267 fi 1268 1269 if (( icycle > maxcycle )) 1270 then 1271 (( maxcycle = icycle )) 1272 fi 1273 1274 # cycle=$(echo $zeile | cut -f2 -d".") 1275 # if [[ "$cycle" = "$zeile" ]] 1276 # then 1277 # (( icycle = 0 )) 1278 # elif [[ "$cycle" = "${extin[$i]}" ]] 1279 # then 1280 # (( icycle = 0 )) 1281 # else 1282 # (( icycle = $cycle )) 1283 # fi 1284 # if (( icycle > maxcycle )) 1285 # then 1286 # (( maxcycle = icycle )) 1287 # fi 1291 1288 done <filelist 1292 1289 rm filelist … … 1309 1306 1310 1307 # STORE FILENAME WITHOUT PATH BUT WITH CYCLE NUMBER, 1311 # BECAUSE IT MIGHT BE REQUIRED LATER TO RESTORE THE FILE FROM AN ARCHIVE-SYSTEM1308 # IS LATER USED FOR TRANSFERRING FILES WIHIN THE JOB (SEE END OF FILE) 1312 1309 absnamein[$i]=$filename 1313 1310 if (( maxcycle > 0 )) … … 1374 1371 printf "\n $catalogname" 1375 1372 printf "\n was created\n" 1373 echo "### filename = $filename" 1376 1374 else 1377 1375 printf "\n\n +++ OUTPUT-file:" … … 1397 1395 while read zeile 1398 1396 do 1399 cycle=$(echo $zeile | cut -f2 -d".") 1400 if [[ "$cycle" = "$zeile" || "$cycle" = ${extout[$i]} ]] 1397 1398 # filename without path (i.e. after the last "/") 1399 basefilename=$(basename ${zeile}) 1400 1401 # check if there is an extension 1402 extension=${basefilename##*.} 1403 if [[ "$extension" = "$extin[$i]" ]] 1401 1404 then 1405 basefilename=${basefilename&.*} 1406 fi 1407 1408 # check for an existing cycle number 1409 cycle=${basefilename##*.} 1410 if [[ $cycle =~ ^-?[0-9]+$ ]] 1411 then 1412 (( icycle = $cycle + 1 )) 1413 else 1402 1414 (( icycle = 1 )) 1403 else1404 (( icycle = $cycle + 1 ))1405 1415 fi 1416 1406 1417 if (( icycle > maxcycle )) 1407 1418 then 1408 1419 (( maxcycle = icycle )) 1409 1420 fi 1421 1422 # cycle=$(echo $zeile | cut -f2 -d".") 1423 # if [[ "$cycle" = "$zeile" || "$cycle" = ${extout[$i]} ]] 1424 # then 1425 # (( icycle = 1 )) 1426 # else 1427 # (( icycle = $cycle + 1 )) 1428 # fi 1429 # if (( icycle > maxcycle )) 1430 # then 1431 # (( maxcycle = icycle )) 1432 # fi 1410 1433 done <filelist 1411 1434 rm filelist … … 1418 1441 if (( maxcycle > 0 )) 1419 1442 then 1420 filename =${filename}.$maxcycle1421 if cat /dev/null > $filename 1443 filename_tmp=${filename}.$maxcycle 1444 if cat /dev/null > $filename_tmp 1422 1445 then 1423 rm $filename 1446 rm $filename_tmp 1424 1447 else 1425 1448 printf "\n +++ OUTPUT-file:" 1426 printf "\n $filename "1449 printf "\n $filename_tmp" 1427 1450 printf "\n cannot be created" 1428 1451 locat=output ; exit … … 1431 1454 else 1432 1455 (( maxcycle = maxcycle - 1 )) 1433 if (( maxcycle > 0 ))1434 then1435 filename=${filename}.$maxcycle1436 fi1437 1456 fi 1438 1457 1439 # STORE FILENAME WITHOUT PATH BUT WITH CYCLE NUMBER, 1440 # BECAUSE IT MIGHT BE REQUIRED LATER TO STORE THE FILE ON AN ARCHIVE-SYSTEM 1441 # OR TO PUT THIS FILENAME ON FILE OUTPUT_FILE_CONNECTIONS 1458 (( cycnum[$i] = maxcycle )) 1442 1459 pathout[$i]=$filename 1443 if (( maxcycle > 0 ))1444 then1445 frelout[$i]=${fname}${endout[$i]}.$maxcycle1446 else1447 frelout[$i]=${fname}${endout[$i]}1448 fi1449 1460 1450 1461 fi … … 1895 1906 then 1896 1907 tmp_user_catalog=$SCRATCH 1897 elif [[ $localhost = nech ]]1898 then1899 tmp_user_catalog=$WRKSHR1900 1908 else 1901 1909 tmp_user_catalog=/tmp … … 1908 1916 if [[ "$tmp_data_catalog" = "" ]] 1909 1917 then 1910 if [[ $localhost = nech ]] 1911 then 1912 tmp_data_catalog=$WRKSHR/mrun_restart_data 1913 else 1914 tmp_data_catalog=/tmp/mrun_restart_data 1915 fi 1918 tmp_data_catalog=/tmp/mrun_restart_data 1916 1919 fi 1917 1920 … … 2311 2314 then 2312 2315 2313 # ON NEC, COMPILATION IS DONE ON HOST CROSS VIA CROSS COMPILING 2314 # CREATE A TEMPORARY DIRECTORY ON THAT MACHINE (HOME MOUNTED VIA NFS) 2315 if [[ $localhost = nech ]] 2316 then 2317 TEMPDIR_COMPILE=$HOME/work/${usern}.$kennung 2318 if mkdir -p $TEMPDIR_COMPILE 2319 then 2320 printf "\n *** \"$TEMPDIR_COMPILE\" " 2321 printf "\n is generated as temporary directory for cross compiling\n" 2322 else 2323 printf "\n +++ creating directory \"$TEMPDIR_COMPILE\" " 2324 printf "\n needed for cross compilation failed" 2325 locat=compile 2326 exit 2327 fi 2328 else 2329 TEMPDIR_COMPILE=$TEMPDIR 2330 fi 2316 TEMPDIR_COMPILE=$TEMPDIR 2331 2317 2332 2318 cp $make_depository $TEMPDIR_COMPILE … … 2354 2340 cd $TEMPDIR 2355 2341 printf "\n *** changed to temporary directory: $TEMPDIR" 2356 2357 2358 # THE FOLLOWING IS REQUIRED FPR AVS-OUTPUT WITH PALM ??? REMOVE ???2359 # WRITE INFORMATIONS ABOUT THE OUTPUT-FILE CONNECTIONS TO A TEMPORARY FILE2360 # THIS FILE CAN LATER BE READ FROM USER-DEFINED CODE TO DETERMINE THE2361 # RELATION BETWEEN THE LOCAL TEMPORARY AND PERMANENT FILE NAMES2362 (( i = 0 ))2363 while (( i < iout ))2364 do2365 (( i = i + 1 ))2366 if [[ "${actionout[$i]}" = tr || "${actionout[$i]}" = tra || "${actionout[$i]}" = trpe ]]2367 then2368 printf "${localout[$i]} ${actionout[$i]}\n${pathout[$i]}\n${localhost}_${fname}${endout[$i]}\n" >> OUTPUT_FILE_CONNECTIONS2369 else2370 printf "${localout[$i]} ${actionout[$i]}\n${pathout[$i]}\n${frelout[$i]}\n" >> OUTPUT_FILE_CONNECTIONS2371 fi2372 done2373 2342 2374 2343 … … 2405 2374 printf " source code files: $source_list \n" 2406 2375 2407 if [[ $localhost = nech ]] 2408 then 2409 ssh $SSH_PORTOPT 136.172.44.192 -l $usern "$init_cmds $module_calls cd \$HOME/work/${usern}.$kennung; sxmake $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" " 2410 cp $TEMPDIR_COMPILE/a.out . 2411 [[ $? != 0 ]] && compile_error=true 2412 rm -rf $TEMPDIR_COMPILE 2413 elif [[ $localhost = ibmh ]] 2376 if [[ $localhost = ibmh ]] 2414 2377 then 2415 2378 printf " compiler is called via ssh on \"plogin1\" \n" … … 2482 2445 if [[ "${actionin[$i]}" = pe && -n $numprocs ]] 2483 2446 then 2484 files_for_pes=true; datentyp= directory2447 files_for_pes=true; datentyp=files 2485 2448 actionin[$i]="" 2486 2449 elif [[ "${actionin[$i]}" = pe && ! -n $numprocs ]] 2487 2450 then 2488 2451 actionin[$i]="" 2489 elif [[ "${actionin[$i]}" = arpe && -n $numprocs ]] 2490 then 2491 files_for_pes=true; datentyp=directory 2492 actionin[$i]="ar" 2493 elif [[ "${actionin[$i]}" = arpe && ! -n $numprocs ]] 2494 then 2495 actionin[$i]="ar" 2496 elif [[ "${actionin[$i]}" = flpe && -n $numprocs ]] 2497 then 2498 files_for_pes=true; datentyp=directory 2499 actionin[$i]="fl" 2500 elif [[ "${actionin[$i]}" = flpe && ! -n $numprocs ]] 2501 then 2502 actionin[$i]="fl" 2452 elif [[ "${actionin[$i]}" = lnpe && -n $numprocs ]] 2453 then 2454 files_for_pes=true; datentyp=files 2455 actionin[$i]="ln" 2456 elif [[ "${actionin[$i]}" = lnpe && ! -n $numprocs ]] 2457 then 2458 actionin[$i]="ln" 2503 2459 fi 2504 2460 … … 2510 2466 fi 2511 2467 2512 # INPUT-FILE FOR A RESTART RUN. 2513 # CHECK, IF THIS FILE STILL EXISTS ON THE TEMPORARY DATA DIRECTORY. 2514 # IF NOT, TRY TO GET IT FROM THE ARCHIVE SYSTEM 2515 if [[ "${actionin[$i]}" = fl ]] 2516 then 2517 printf "\n $datentyp will be fetched from temporary directory \"${tmp_data_catalog}\" !" 2468 # INPUT-FILES TO BE LINKED 2469 if [[ "${actionin[$i]}" = ln ]] 2470 then 2471 2472 printf "\n $datentyp will be linked" 2518 2473 if [[ $files_for_pes = false ]] 2519 2474 then 2520 if [[ -f "$ tmp_data_catalog/${frelin[$i]}" ]]2475 if [[ -f "${absnamein[$i]}" ]] 2521 2476 then 2522 ln $ tmp_data_catalog/${frelin[$i]} ${localin[$i]}2477 ln ${absnamein[$i]} ${localin[$i]} 2523 2478 got_tmp[$i]=true 2524 elif [[ -f "$WORK/${frelin[$i]}" && $ignore_archive_error = true ]]2525 then2526 printf "\n +++ $datentyp not found in \"$tmp_data_catalog\" !"2527 printf "\n *** trying to use backup copy in \"$WORK\" "2528 cp $WORK/${frelin[$i]} ${localin[$i]}2529 else2530 printf "\n +++ $datentyp not found in \"$tmp_data_catalog\" "2531 printf "\n or \"$tmp_data_catalog\" does not exist!"2532 printf "\n *** trying to get copy from archive"2533 actionin[$i]=ar2534 2479 fi 2535 2480 else 2536 if [[ -d "$ tmp_data_catalog/${frelin[$i]}" ]]2481 if [[ -d "${absnamein[$i]}" ]] 2537 2482 then 2538 2483 mkdir ${localin[$i]} 2539 cd $ tmp_data_catalog/${frelin[$i]}2484 cd ${absnamein[$i]} 2540 2485 for file in $(ls *) 2541 2486 do 2542 2487 ln $file $TEMPDIR/${localin[$i]} 2543 done 2488 done >|/dev/null 2>&1 2544 2489 cd $TEMPDIR 2545 got_tmp[$i]=true 2546 elif [[ -d "$WORK/${frelin[$i]}" && $ignore_archive_error = true ]] 2490 fi 2491 2492 # IF "ln -f" HAS FAILED DO A NORMAL COPY "cp -r" 2493 if [[ ! -f "${localin[$i]}/_000000" ]] 2547 2494 then 2548 printf "\n +++ $datentyp not found in \"$tmp_data_catalog\" !" 2549 printf "\n *** trying to use backup copy in \"$WORK\" " 2550 cp -r $WORK/${frelin[$i]} ${localin[$i]} 2551 else 2552 printf "\n +++ $datentyp not found in \"$tmp_data_catalog\" " 2553 printf "\n or \"$tmp_data_catalog\" does not exist!" 2554 printf "\n *** trying to get copy from archive" 2555 actionin[$i]=ar 2495 printf "\n --- WARNING: ln failed, using cp instead (might be time consuming...)" 2496 cp -r ${absnamein[$i]}/* ${localin[$i]} 2556 2497 fi 2557 fi 2558 fi 2559 2560 2561 # FILE IS STORED ON THE ARCHIVE SYSTEM 2562 if [[ "${actionin[$i]}" = ar ]] 2563 then 2564 2565 if [[ $files_for_pes = false ]] 2566 then 2567 printf "\n file will be restored from archive-system ($archive_system)!" 2568 else 2569 printf "\n directory will be restored from archive-system ($archive_system)!" 2570 fi 2571 2572 file_restored=false 2573 2574 if [[ $archive_system = asterix ]] 2575 then 2576 do_stagein=true 2577 (( stagein_anz = 0 )) 2578 while [[ $do_stagein = true ]] 2579 do 2580 if [[ $files_for_pes = false ]] 2581 then 2582 stagein -O ${frelin[$i]} > STAGEIN_OUTPUT 2583 else 2584 stagein -t -O ${frelin[$i]} > STAGEIN_OUTPUT 2585 fi 2586 cat STAGEIN_OUTPUT 2587 if [[ $(grep -c "st.msg:i24" STAGEIN_OUTPUT) != 0 ]] 2588 then 2589 file_restored=true 2590 do_stagein=false 2591 else 2592 (( stagein_anz = stagein_anz + 1 )) 2593 if (( stagein_anz == 10 )) 2594 then 2595 printf "\n +++ stagein stoped after 10 tries" 2596 locat=stage 2597 exit 2598 fi 2599 printf "\n +++ restoring from archive failed, trying again:" 2600 sleep 900 2601 fi 2602 done 2603 elif [[ $archive_system = DMF ]] 2604 then 2605 if [[ $files_for_pes = false ]] 2606 then 2607 printf "\n +++ restoring of single files impossible with $archive_system !\n" 2608 locat=DMF 2609 exit 2610 else 2611 find $ARCHIVE/${frelin[$i]} -type m -print | dmget 2612 cp -r $ARCHIVE/${frelin[$i]} $PWD 2613 file_restored=true 2614 fi 2615 elif [[ $archive_system = tivoli ]] 2616 then 2617 if [[ $files_for_pes = false ]] 2618 then 2619 ssh $SSH_PORTOPT $usern@bicedata.hlrn.de "cp $PERM/${frelin[$i]} $PWD" 2620 else 2621 (( inode = 0 )) 2622 while (( inode < nodes )) 2623 do 2624 ssh $SSH_PORTOPT $usern@bicedata.hlrn.de "cd $PWD; tar xf $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar" 2625 (( inode = inode + 1 )) 2626 done 2627 fi 2628 file_restored=true 2629 elif [[ $archive_system = ut ]] 2630 then 2631 if [[ $files_for_pes = false ]] 2632 then 2633 cp $UT/${frelin[$i]} . 2634 else 2635 (( inode = 0 )) 2636 while (( inode < nodes )) 2637 do 2638 tar xf $UT/${frelin[$i]}/${frelin[$i]}.node_$inode.tar 2639 (( inode = inode + 1 )) 2640 done 2641 fi 2642 file_restored=true 2643 else 2644 printf "\n +++ archive_system=\"$archive_system\" restore impossible!" 2645 locat=rearchive 2646 exit 2647 fi 2648 2649 if [[ $file_restored = true ]] 2650 then 2651 2652 # PUT FILE ON THE TEMPORARY DATA DIRECTORY TOO. 2653 # THIS WILL MAKE FILE ACCESS EASIER FOR LATER RUNS 2654 [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog; chmod g+rx $tmp_data_catalog 2655 if [[ $files_for_pes = false ]] 2656 then 2657 ln -f ${frelin[$i]} $tmp_data_catalog/${frelin[$i]} 2658 else 2659 mkdir $tmp_data_catalog/${frelin[$i]} 2660 ln -f ${frelin[$i]}/* $tmp_data_catalog/${frelin[$i]} 2661 fi 2498 2662 2499 got_tmp[$i]=true 2663 2664 # PROVIDE THE FILE UNDER ITS LOCAL NAME 2665 mv ${frelin[$i]} ${localin[$i]} 2666 2667 fi 2668 fi 2669 2500 fi 2501 fi 2670 2502 2671 2503 # FILE IS STORED IN THE RESPECTIVE DIRECTORY GIVEN IN THE CONFIGURATION FILE … … 2709 2541 printf "\n providing $numprocs files for the respective processors" 2710 2542 mkdir ${localin[$i]} 2711 if [[ $link_local_input = true ]]2712 then2713 printf " using ln -f\n"2714 cd ${absnamein[$i]}2715 for file in $(ls *)2716 do2717 ln -f $file ${localin[$i]}2718 done2719 cd $TEMPDIR2720 fi2543 if [[ $link_local_input = true ]] 2544 then 2545 printf " files will be linked\n" 2546 cd ${absnamein[$i]} 2547 for file in $(ls *) 2548 do 2549 ln -f $file ${localin[$i]} 2550 done 2551 cd $TEMPDIR 2552 fi 2721 2553 2722 2554 # IF "ln -f" FAILED OR IF "$link_local_input = false" DO A NORMAL "cp -r" 2723 if [[ ! -f "${localin[$i]}/_0000" ]]2724 then2725 if [[ $link_local_input = true ]]2726 then2727 printf " ln failed for .../_0000, using cp...\n"2728 fi2729 cp -r ${absnamein[$i]}/* ${localin[$i]}2730 fi2555 if [[ ! -f "${localin[$i]}/_000000" ]] 2556 then 2557 if [[ $link_local_input = true ]] 2558 then 2559 printf "\n --- WARNING: ln failed, using cp instead (might be time consuming...)" 2560 fi 2561 cp -r ${absnamein[$i]}/* ${localin[$i]} 2562 fi 2731 2563 2732 2564 else 2733 2565 2734 2566 # PROVIDE FILE FOR RUNS ON A SINGLE CORE 2735 if [[ $link_local_input = true ]]2736 then2737 printf " using ln -f\n"2738 ln -f ${absnamein[$i]} ${localin[$i]}2739 fi2740 # If "ln -f" fails of if "$link_local_input = false" do a normal "cp"2741 if [[ ! -f "${localin[$i]}" ]]2567 if [[ $link_local_input = true ]] 2568 then 2569 printf " file will be linked\n" 2570 ln -f ${absnamein[$i]} ${localin[$i]} 2571 fi 2572 # If "ln -f" fails of if "$link_local_input = false" do a normal "cp" 2573 if [[ ! -f "${localin[$i]}" ]] 2742 2574 then 2743 if [[ $link_local_input = true ]]2744 then2745 printf " ln failed, using cp...\n"2746 fi2747 cp ${absnamein[$i]} ${localin[$i]}2575 if [[ $link_local_input = true ]] 2576 then 2577 printf "\n --- WARNING: ln failed, using cp instead (might be time consuming...)" 2578 fi 2579 cp ${absnamein[$i]} ${localin[$i]} 2748 2580 fi 2749 2581 fi … … 2837 2669 # CREATE THE NAMELIST-FILE WITH VALUES OF ENVIRONMENT-VARIABLES REQUIRED BY PALM 2838 2670 # (FILE ENVPAR WILL BE READ BY PALM) 2839 cat > ENVPAR << %%END%%2671 cat > ENVPAR << EOF 2840 2672 &envpar run_identifier = '$fname', host = '$localhost', 2841 2673 write_binary = '$write_binary', tasks_per_node = $tasks_per_node, … … 2846 2678 batch_job = $batch_job / 2847 2679 2848 %%END%% 2680 EOF 2849 2681 2850 2682 … … 3040 2872 fi 3041 2873 3042 elif [[ $host = nech ]] # running on NEC machines3043 then3044 3045 (( ii = nodes ))3046 if [[ $ii = 1 ]]3047 then3048 export F_ERRCNT=0 # acceptable number of errors before program is stopped3049 export MPIPROGINF=YES3050 # export F_TRACE=YES|FMT1|FMT2 # output of ftrace informations to job protocol3051 echo "*** execution on single node with mpirun"3052 mpirun -np $numprocs ./a.out3053 else3054 (( i = 0 ))3055 while (( i < ii ))3056 do3057 echo "-h $i -p $tasks_per_node -e ./mpi_exec_shell" >> multinode_config3058 (( i = i + 1 ))3059 done3060 3061 echo "#!/bin/sh" > mpi_exec_shell3062 echo " " >> mpi_exec_shell3063 echo "set -u" >> mpi_exec_shell3064 echo "F_ERRCNT=0" >> mpi_exec_shell3065 echo "MPIPROGINV=YES" >> mpi_exec_shell3066 echo "OMP_NUM_THREADS=$threads_per_task" >> mpi_exec_shell3067 echo "cpurest=$cpurest" >> mpi_exec_shell3068 echo "fname=$fname" >> mpi_exec_shell3069 echo "localhost=$localhost" >> mpi_exec_shell3070 echo "return_address=$return_address" >> mpi_exec_shell3071 echo "return_username=$return_username" >> mpi_exec_shell3072 echo "tasks_per_node=$tasks_per_node" >> mpi_exec_shell3073 echo "write_binary=$write_binary" >> mpi_exec_shell3074 echo "use_seperate_pe_for_dvrp_output=$use_seperate_pe_for_dvrp_output" >> mpi_exec_shell3075 echo " " >> mpi_exec_shell3076 echo "export F_ERRCNT" >> mpi_exec_shell3077 echo "export MPIPROGINV" >> mpi_exec_shell3078 echo "export OMP_NUM_THREADS" >> mpi_exec_shell3079 echo "export cpurest" >> mpi_exec_shell3080 echo "export fname" >> mpi_exec_shell3081 echo "export localhost" >> mpi_exec_shell3082 echo "export return_address" >> mpi_exec_shell3083 echo "export return_username" >> mpi_exec_shell3084 echo "export tasks_per_node" >> mpi_exec_shell3085 echo "export write_binary" >> mpi_exec_shell3086 echo "export use_seperate_pe_for_dvrp_output" >> mpi_exec_shell3087 echo " " >> mpi_exec_shell3088 echo "exec ./a.out" >> mpi_exec_shell3089 3090 chmod u+x mpi_exec_shell3091 export MPIPROGINF=YES3092 mpirun -f multinode_config &3093 wait3094 3095 fi3096 3097 2874 elif [[ $(echo $host | cut -c1-2) = lc && $host != lckyoto && $host != lctit ]] 3098 2875 then … … 3403 3180 ls -al 3404 3181 fi 3405 3406 3182 3407 3183 3408 3184 # COPY LOCAL OUTPUT-FILES TO THEIR PERMANENT DESTINATIONS … … 3413 3189 if (( i == 1 )) 3414 3190 then 3415 printf "\n\n *** saving OUTPUT-files:\n$dashes" 3416 fi 3191 printf "\n\n *** saving OUTPUT-files:" 3192 3193 # GET RUN NUMBER ASSIGNED BY PALM 3194 if [[ -f RUN_NUMBER ]] 3195 then 3196 read run_number < RUN_NUMBER 3197 printf "\n *** PALM generated run_number = "$run_number" will be used as unified cycle number for all output files" 3198 usecycle_option="-U $run_number" 3199 else 3200 run_number=0 3201 usecycle_option="" 3202 fi 3203 printf "\n$dashes" 3204 fi 3205 3206 # ADD CYCLE NUMBER TO FILENAME 3207 if [[ ! ( $fromhost != $localhost && ( "${actionout[$i]}" = tr || "${actionout[$i]}" = tra || "${actionout[$i]}" = trpe ) ) ]] 3208 then 3209 3210 # IN APPEND MODE, FILES KEEP THEIR CURRENT CYCLE NUMBER 3211 if [[ "${actionout[$i]}" != "a" ]] 3212 then 3213 # SET RUN NUMBER AS CYCLE NUMBER, IF THERE IS NOT A CONFLICT 3214 # WITH AN EXISTING CYCLE NUMBER 3215 if (( run_number >= cycnum[$i] )) 3216 then 3217 (( cycnum[$i] = run_number )) 3218 else 3219 if (( run_number > 0 )) 3220 then 3221 printf "\n --- INFORMATIVE: The following file cannot get a unified cycle number" 3222 fi 3223 fi 3224 fi 3225 if (( cycnum[$i] > 0 )) 3226 then 3227 pathout[$i]=${pathout[$i]}.${cycnum[$i]} 3228 fi 3229 fi 3417 3230 3418 3231 # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION) 3419 3232 files_for_pes=false; filetyp=file 3233 link_local_output=false 3420 3234 if [[ "${actionout[$i]}" = pe && -n $numprocs ]] 3421 3235 then … … 3425 3239 then 3426 3240 actionout[$i]="" 3427 elif [[ "${actionout[$i]}" = arpe && -n $numprocs ]]3241 elif [[ "${actionout[$i]}" = lnpe && -n $numprocs ]] 3428 3242 then 3429 3243 files_for_pes=true; filetyp=directory 3430 actionout[$i]="ar" 3431 elif [[ "${actionout[$i]}" = arpe && ! -n $numprocs ]] 3432 then 3433 actionout[$i]="ar" 3434 elif [[ "${actionout[$i]}" = flpe && -n $numprocs ]] 3435 then 3436 files_for_pes=true; filetyp=directory 3437 actionout[$i]="fl" 3438 elif [[ "${actionout[$i]}" = flpe && ! -n $numprocs ]] 3439 then 3440 actionout[$i]="fl" 3244 link_local_output=true 3245 actionout[$i]="" 3246 elif [[ "${actionout[$i]}" = lnpe && ! -n $numprocs ]] 3247 then 3248 link_local_output 3249 actionout[$i]="" 3441 3250 elif [[ "${actionout[$i]}" = trpe && -n $numprocs ]] 3442 3251 then … … 3471 3280 cst="/" 3472 3281 fi 3473 if [[ $localhost = nech ]] 3282 3283 transfer_failed=false 3284 printf "\n >>> OUTPUT: ${localout[$i]}$cst by SCP to" 3285 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst\n" 3286 if [[ $localhost = lccrayb ]] 3287 then 3288 ssh $usern@blogin1 ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m $usecycle_option -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3289 elif [[ $localhost = lccrayh ]] 3290 then 3291 ssh $usern@hlogin1 ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m $usecycle_option -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3292 elif [[ $localhost = lcbullhh ]] 3293 then 3294 ssh $usern@mlogin101 ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m $usecycle_option -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3295 elif [[ $localhost = lcxe6 ]] 3296 then 3297 ssh $usern@hexagon ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m $usecycle_option -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3298 else 3299 batch_scp $PORTOPT $cps -b -m $usecycle_option -u $return_username $return_address ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} 3300 fi 3301 [[ $? != 0 ]] && transfer_failed=true 3302 3303 # IF TRANSFER FAILED, CREATE BACKUP COPY ON THIS MACHINE 3304 if [[ $transfer_failed = true ]] 3305 then 3306 printf " +++ transfer failed. Trying to save a copy on this host under:\n" 3307 printf " ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung\n" 3308 3309 # FIRST CHECK, IF DIRECTORY EXISTS, AND CREATE IT, IF NECESSARY 3310 eval local_catalog=${pathout[$i]} 3311 if [[ ! -d $local_catalog ]] 3312 then 3313 printf " *** local directory does not exist. Trying to create:\n" 3314 printf " $local_catalog \n" 3315 mkdir -p $local_catalog 3316 fi 3317 eval cp ${localout[$i]} ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung 3318 transfer_problems=true 3319 fi 3320 3321 else 3322 3323 # UNSET actionout. DUE TO THIS SETTING, FILE WILL LATER JUST BE COPIED ON THIS MACHINE 3324 actionout[$i]="" 3325 fi 3326 fi 3327 3328 3329 # APPEND VIA SCP TO LOCAL HOST (ALWAYS IN BINARY MODE USING batch_scp option -m) 3330 # IF TARGET DIRECTORY DOES NOT EXISTS, TRY TO CREATE IT 3331 if [[ "${actionout[$i]}" = tra ]] 3332 then 3333 if [[ $localhost != $fromhost ]] 3334 then 3335 if [[ $localhost = ibmh ]] 3474 3336 then 3475 3337 … … 3478 3340 [[ ! -d $tmp_data_catalog/TRANSFER ]] && mkdir -p $tmp_data_catalog/TRANSFER 3479 3341 file_to_transfer=${fname}_${localout[$i]}_to_transfer_$kennung 3480 if [[ $files_for_pes = false ]] 3481 then 3482 ln -f ${localout[$i]} $tmp_data_catalog/TRANSFER/$file_to_transfer 3483 else 3484 mkdir $tmp_data_catalog/TRANSFER/$file_to_transfer 3485 ln ${localout[$i]}/* $tmp_data_catalog/TRANSFER/$file_to_transfer 3486 fi 3342 ln -f ${localout[$i]} $tmp_data_catalog/TRANSFER/$file_to_transfer 3487 3343 3488 3344 echo "set -x" > transfer_${localout[$i]} 3489 3345 echo "cd $tmp_data_catalog/TRANSFER" >> transfer_${localout[$i]} 3490 3346 3491 printf "\n >>> OUTPUT: ${localout[$i]} $cstby SCP in seperate job to"3492 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]} $cst"3347 printf "\n >>> OUTPUT: ${localout[$i]} append by SCP in seperate job to" 3348 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}" 3493 3349 printf "\n or higher cycle\n" 3494 echo "batch_scp $PORTOPT $cps-b -m -u $return_username $return_address $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]}3350 echo "batch_scp $PORTOPT -A -b -m -u $return_username $return_address $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} 3495 3351 3496 3352 echo "[[ \$? = 0 ]] && rm $file_to_transfer" >> transfer_${localout[$i]} 3497 3353 3498 if [[ $ localhost = nech]]3354 if [[ $LOGNAME = b323013 ]] 3499 3355 then 3500 subjob - d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 900$PORTOPT transfer_${localout[$i]}3356 subjob -v -q c1 -X 0 -m 1000 -t 900 -c $job_catalog $PORTOPT transfer_${localout[$i]} 3501 3357 else 3502 if [[ "$LOGNAME" = b323013 ]] 3503 then 3504 subjob -v -q c1 -X 0 -m 1000 -t 900 -c $job_catalog $PORTOPT transfer_${localout[$i]} 3505 else 3506 subjob -d -v -q c1 -X 0 -m 1000 -t 900 -c $job_catalog $PORTOPT transfer_${localout[$i]} 3507 fi 3358 subjob -d -v -q c1 -X 0 -m 1000 -t 900 -c $job_catalog $PORTOPT transfer_${localout[$i]} 3508 3359 fi 3509 3360 … … 3512 3363 # TRANSFER WITHIN THIS JOB 3513 3364 transfer_failed=false 3514 printf "\n >>> OUTPUT: ${localout[$i]} $cstby SCP to"3515 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]} $cst\n"3365 printf "\n >>> OUTPUT: ${localout[$i]} append by SCP to" 3366 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n" 3516 3367 if [[ $localhost = lccrayb ]] 3517 3368 then 3518 ssh $usern@blogin1 ". \\$HOME/. profile; cd $TEMPDIR; batch_scp $PORTOPT $cps-b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}"3369 ssh $usern@blogin1 ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3519 3370 elif [[ $localhost = lccrayh ]] 3520 3371 then 3521 ssh $usern@hlogin1 ". \\$HOME/.profile; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3522 elif [[ $localhost = lcbullhh ]] 3523 then 3524 ssh $usern@mlogin101 ". \\$HOME/.profile; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3372 ssh $usern@hlogin1 ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3525 3373 elif [[ $localhost = lcxe6 ]] 3526 3374 then 3527 ssh $usern@hexagon ". \\$HOME/. profile; cd $TEMPDIR; batch_scp $PORTOPT $cps-b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}"3375 ssh $usern@hexagon ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" 3528 3376 else 3529 batch_scp $PORTOPT $cps -b -m -u $return_username $return_address${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]}3377 batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} 3530 3378 fi 3531 3379 [[ $? != 0 ]] && transfer_failed=true … … 3545 3393 mkdir -p $local_catalog 3546 3394 fi 3395 3547 3396 eval cp ${localout[$i]} ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung 3548 3397 transfer_problems=true … … 3551 3400 else 3552 3401 3553 # UNSET actionout. DUE TO THIS SETTING, FILE WILL LATER JUST BE COPIED ON THIS MACHINE3554 actionout[$i]=""3555 fi3556 fi3557 3558 3559 # APPEND VIA SCP TO LOCAL HOST (ALWAYS IN BINARY MODE USING batch_scp option -m)3560 # IF TARGET DIRECTORY DOES NOT EXISTS, TRY TO CREATE IT3561 if [[ "${actionout[$i]}" = tra ]]3562 then3563 if [[ $localhost != $fromhost ]]3564 then3565 if [[ $localhost = ibmh || $localhost = nech ]]3566 then3567 3568 # TRANSFER IN SEPERATE JOB3569 # FIRST COPY FILE TO TEMPORY DATA DIRECTORY3570 [[ ! -d $tmp_data_catalog/TRANSFER ]] && mkdir -p $tmp_data_catalog/TRANSFER3571 file_to_transfer=${fname}_${localout[$i]}_to_transfer_$kennung3572 ln -f ${localout[$i]} $tmp_data_catalog/TRANSFER/$file_to_transfer3573 3574 echo "set -x" > transfer_${localout[$i]}3575 echo "cd $tmp_data_catalog/TRANSFER" >> transfer_${localout[$i]}3576 3577 printf "\n >>> OUTPUT: ${localout[$i]} append by SCP in seperate job to"3578 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}"3579 printf "\n or higher cycle\n"3580 echo "batch_scp $PORTOPT -A -b -m -u $return_username $return_address $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]}3581 3582 echo "[[ \$? = 0 ]] && rm $file_to_transfer" >> transfer_${localout[$i]}3583 3584 if [[ $localhost = nech ]]3585 then3586 subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 900 $PORTOPT transfer_${localout[$i]}3587 else3588 if [[ $LOGNAME = b323013 ]]3589 then3590 subjob -v -q c1 -X 0 -m 1000 -t 900 -c $job_catalog $PORTOPT transfer_${localout[$i]}3591 else3592 subjob -d -v -q c1 -X 0 -m 1000 -t 900 -c $job_catalog $PORTOPT transfer_${localout[$i]}3593 fi3594 fi3595 3596 else3597 3598 # TRANSFER WITHIN THIS JOB3599 transfer_failed=false3600 printf "\n >>> OUTPUT: ${localout[$i]} append by SCP to"3601 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n"3602 if [[ $localhost = lccrayb ]]3603 then3604 ssh $usern@blogin1 ". \\$HOME/.profile; cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}"3605 elif [[ $localhost = lccrayh ]]3606 then3607 ssh $usern@hlogin1 ". \\$HOME/.profile; cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}"3608 elif [[ $localhost = lcxe6 ]]3609 then3610 ssh $usern@hexagon ". \\$HOME/.profile; cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}"3611 else3612 batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]}3613 fi3614 [[ $? != 0 ]] && transfer_failed=true3615 3616 # IF TRANSFER FAILED, CREATE BACKUP COPY ON THIS MACHINE3617 if [[ $transfer_failed = true ]]3618 then3619 printf " +++ transfer failed. Trying to save a copy on this host under:\n"3620 printf " ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung\n"3621 3622 # FIRST CHECK, IF DIRECTORY EXISTS, AND CREATE IT, IF NECESSARY3623 eval local_catalog=${pathout[$i]}3624 if [[ ! -d $local_catalog ]]3625 then3626 printf " *** local directory does not exist. Trying to create:\n"3627 printf " $local_catalog \n"3628 mkdir -p $local_catalog3629 fi3630 3631 eval cp ${localout[$i]} ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung3632 transfer_problems=true3633 fi3634 fi3635 else3636 3637 3402 # RESET actionout. DUE TO THIS SETTING, FILE WILL LATER JUST BE APPENDED ON THIS MACHINE 3638 3403 actionout[$i]=a … … 3640 3405 fi 3641 3406 3642 3643 # OUTPUT-FILE FOR A RESTART-RUN.3644 # FILE IS MOVED TO THE TEMPORARY DATA DIRECTORY USING link COMMAND.3645 # OPTION -f IS USED TO OVERWRITE EXISTING FILES.3646 # AS LAST ACTION, ARCHIVING IS INITIATED.3647 if [[ "${actionout[$i]}" = fl ]]3648 then3649 [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog3650 chmod g+rx $tmp_data_catalog3651 if [[ $files_for_pes = false ]]3652 then3653 printf "\n >>> OUTPUT: ${localout[$i]} to"3654 printf "\n $tmp_data_catalog/${frelout[$i]} (temporary data catalog)\n"3655 ln -f ${localout[$i]} $tmp_data_catalog/${frelout[$i]}3656 else3657 printf "\n >>> OUTPUT: ${localout[$i]}/.... to"3658 printf "\n $tmp_data_catalog/${frelout[$i]} (temporary data catalog)\n"3659 mkdir $tmp_data_catalog/${frelout[$i]}3660 cd ${localout[$i]}3661 for file in $(ls *)3662 do3663 ln -f $file $tmp_data_catalog/${frelout[$i]}3664 done3665 cd $TEMPDIR3666 fi3667 3668 3669 # CREATE AND SUBMIT ARCHIVING-JOB3670 if [[ $store_on_archive_system = true ]]3671 then3672 3673 if [[ $archive_system = asterix ]]3674 then3675 echo "cd $tmp_data_catalog" >> archive_${frelout[$i]}3676 if [[ $files_for_pes = false ]]3677 then3678 echo "stageout ${frelout[$i]} > STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]}3679 else3680 echo "stageout -t ${frelout[$i]} > STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]}3681 fi3682 echo "cat STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]}3683 echo "if [[ \$(grep -c \"st.msg:150\" STAGE_OUTPUT${i}_$kennung) != 0 ]]" >> archive_${frelout[$i]}3684 echo "then" >> archive_${frelout[$i]}3685 echo " do_stageout=false" >> archive_${frelout[$i]}3686 echo "else" >> archive_${frelout[$i]}3687 echo " echo \" +++ $filetyp ${frelout[$i]} could not be stored on archive-system\" " >> archive_${frelout[$i]}3688 echo " cat /dev/null > ~/job_queue/ARCHIVE_ERROR_$fname" >> archive_${frelout[$i]}3689 echo " cat STAGE_OUTPUT${i}_$kennung > ~/job_queue/archive_${frelout[$i]}_error" >> archive_${frelout[$i]}3690 echo " echo \" *** $filetyp ${frelout[$i]} will be copied to \$WORK as backup\" " >> archive_${frelout[$i]}3691 if [[ $files_for_pes = false ]]3692 then3693 echo " cp ${frelout[$i]} \$WORK" >> archive_${frelout[$i]}3694 else3695 echo " cp -r ${frelout[$i]} \$WORK/${frelout[$i]}" >> archive_${frelout[$i]}3696 fi3697 echo " echo \" *** $filetyp ${frelout[$i]} saved\" " >> archive_${frelout[$i]}3698 echo "fi" >> archive_${frelout[$i]}3699 echo "rm STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]}3700 elif [[ $archive_system = DMF ]]3701 then3702 echo "cd $tmp_data_catalog" >> archive_${frelout[$i]}3703 if [[ $files_for_pes = false ]]3704 then3705 printf "\n +++ archiving of single files impossible with $archive_system !\n"3706 locat=DMF3707 exit3708 else3709 # ??? nicht benötigte Archiv-Systeme entfernen ???3710 # FUER RECHNER IN JUELICH. DORT KOENNTEN AUCH3711 # EINZELNE DATEIEN GESICHERT WERDEN (SPAETER KORR.)3712 echo "rm -rf \$ARCHIVE/${frelout[$i]}" >> archive_${frelout[$i]}3713 echo "cp -r ${frelout[$i]} \$ARCHIVE" >> archive_${frelout[$i]}3714 fi3715 elif [[ $archive_system = tivoli ]]3716 then3717 echo "cd $tmp_data_catalog" >> archive_${frelout[$i]}3718 if [[ $files_for_pes = false ]]3719 then3720 # REMOVE EXISTING OLD FILES FROM THE ARCHIVE3721 echo "set -x" >> archive_${frelout[$i]}3722 echo "rm -rf \$PERM/${frelout[$i]}" >> archive_${frelout[$i]}3723 echo "cp ${frelout[$i]} \$PERM/${frelout[$i]}" >> archive_${frelout[$i]}3724 else3725 3726 echo "set -x" >> archive_${frelout[$i]}3727 echo "rm -rf \$PERM/${frelout[$i]}/*" >> archive_${frelout[$i]}3728 echo "[[ ! -d \$PERM/${frelout[$i]} ]] && mkdir $PERM/${frelout[$i]}" >> archive_${frelout[$i]}3729 cd $tmp_data_catalog3730 all_files=`ls -1 ${frelout[$i]}/*`3731 cd - > /dev/null3732 (( inode = 0 ))3733 (( tp1 = tasks_per_node + 1 ))3734 while (( inode < nodes ))3735 do3736 files=`echo $all_files | cut -d" " -f1-$tasks_per_node`3737 all_files=`echo $all_files | cut -d" " -f$tp1-`3738 echo "tar cvf \$PERM/${frelout[$i]}/${frelout[$i]}.node_$inode.tar $files" >> archive_${frelout[$i]}3739 (( inode = inode + 1 ))3740 done3741 fi3742 elif [[ $archive_system = ut ]]3743 then3744 echo "cd $tmp_data_catalog" >> archive_${frelout[$i]}3745 if [[ $files_for_pes = false ]]3746 then3747 # REMOVE EXISTING OLD FILES FROM THE ARCHIVE3748 echo "set -x" >> archive_${frelout[$i]}3749 echo "rm -rf \$UT/${frelout[$i]}" >> archive_${frelout[$i]}3750 echo "cp ${frelout[$i]} \$UT/${frelout[$i]}" >> archive_${frelout[$i]}3751 else3752 3753 echo "set -x" >> archive_${frelout[$i]}3754 echo "rm -rf \$UT/${frelout[$i]}/*" >> archive_${frelout[$i]}3755 echo "[[ ! -d \$UT/${frelout[$i]} ]] && mkdir $UT/${frelout[$i]}" >> archive_${frelout[$i]}3756 cd $tmp_data_catalog3757 all_files=`ls -1 ${frelout[$i]}/*`3758 cd - > /dev/null3759 (( inode = 0 ))3760 (( tp1 = tasks_per_node + 1 ))3761 while (( inode < nodes ))3762 do3763 files=`echo $all_files | cut -d" " -f1-$tasks_per_node`3764 all_files=`echo $all_files | cut -d" " -f$tp1-`3765 echo "tar cvf \$UT/${frelout[$i]}/${frelout[$i]}.node_$inode.tar $files" >> archive_${frelout[$i]}3766 (( inode = inode + 1 ))3767 done3768 fi3769 elif [[ $archive_system = none ]]3770 then3771 printf " +++ archiving on $localhost not available!\n"3772 fi3773 3774 if [[ $archive_system != none ]]3775 then3776 if [[ $localhost = nech ]]3777 then3778 subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 7200 $PORTOPT archive_${frelout[$i]}3779 fi3780 printf " Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n"3781 fi3782 else3783 printf " +++ caution: option -A is switched off. No archiving on $archive_system!\n"3784 fi3785 3786 3787 # CREATE AN EMPTY DIRECTORY IN THE USERS PERMANENT DIRECTORY,3788 # IN ORDER TO NOTE THE RESPECTIVE CYCLE NUMBER ON THE ARCHIVE SYSTEM3789 # RESTART-JOBS ARE USING THESE EMPTY-DIRECTORIES TO GET THE CURRENT HIGHEST3790 # CYCLE NUMBER ON THE ARCHIVE SYSTEM (IN CASE THAT INFORMATIONS ARE DIFFICULT TO3791 # TO ACCESS FROM THE ARCHIVE-SYSTEM DIRECTLY))3792 if [[ $files_for_pes = false ]]3793 then3794 cat /dev/null > ${pathout[$i]}3795 else3796 mkdir -p ${pathout[$i]}3797 fi3798 3799 fi3800 3801 3802 # COPY FROM THIS HOST TO THE ARCHIVE-SYSTEM3803 # IF ANY ARCHIVING FAILS, AN ERROR-FLAG-FILE IS SET3804 # THIS FILE REMAINS TO BE SET, EVEN IF ARCHIVING OF FURTHER FILES IS SUCCESSFULL3805 if [[ "${actionout[$i]}" = ar ]]3806 then3807 if [[ $files_for_pes = false ]]3808 then3809 printf "\n >>> OUTPUT: ${localout[$i]} to"3810 printf "\n ${pathout[$i]}"3811 printf "\n File will be copied to archive-system ($archive_system) !\n"3812 else3813 printf "\n >>> OUTPUT: ${localout[$i]}/_.... to"3814 printf "\n ${pathout[$i]}"3815 printf "\n Directory will be copied to archive-system ($archive_system) !\n"3816 fi3817 mv ${localout[$i]} ${frelout[$i]}3818 3819 file_saved=false3820 3821 if [[ $archive_system = asterix ]]3822 then3823 do_stageout=true3824 (( stageout_anz = 0 ))3825 while [[ $do_stageout = true ]]3826 do3827 if [[ $files_for_pes = false ]]3828 then3829 stageout ${frelout[$i]} > STAGE_OUTPUT3830 else3831 stageout -t ${frelout[$i]} > STAGE_OUTPUT3832 fi3833 cat STAGE_OUTPUT3834 if [[ $(grep -c "st.msg:150" STAGE_OUTPUT) != 0 ]]3835 then3836 file_saved=true3837 do_stageout=false3838 else3839 if [[ $files_for_pes = false ]]3840 then3841 printf "\n +++ file ${frelout[$i]} could not be saved on archive-system"3842 else3843 printf "\n +++ directory ${frelout[$i]} could not be saved on archive-system"3844 fi3845 (( stageout_anz = stageout_anz + 1 ))3846 if (( stageout_anz == 10 ))3847 then3848 printf "\n +++ stoped after 10 unsuccessful tries!"3849 archive_save=false3850 do_stageout=false3851 else3852 printf "\n *** new try to store on archive after 15 min:"3853 sleep 9003854 fi3855 fi3856 done3857 elif [[ $archive_system = DMF ]]3858 then3859 if [[ $files_for_pes = false ]]3860 then3861 printf "\n +++ archiving of single files impossible on $archive_system!\n"3862 locat=DMF3863 exit3864 else3865 rm -rf $ARCHIVE/${frelout[$i]}3866 cp -r ${frelout[$i]} $ARCHIVE3867 fi3868 file_saved=true3869 elif [[ $archive_system = tivoli ]]3870 then3871 # ARCHIVING ONLY POSSIBLE VIA BATCH-JOB3872 # IN THE MEANTIME, FILE IS STORED IN THE TEMPORARY DATA DIRECTORY,3873 # BECAUSE MRUN'S CURRENT TEMPORARY WORKING DIRECTORY MAY ALREADY BE DELETED3874 # WHEN THE ARCHIVE-JOB IS EXECUTED3875 [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog3876 chmod g+rx $tmp_data_catalog3877 if [[ $files_for_pes = false ]]3878 then3879 ln -f ${frelout[$i]} $tmp_data_catalog/${frelout[$i]}3880 else3881 mkdir $tmp_data_catalog/${frelout[$i]}3882 ln -f ${frelout[$i]}/* $tmp_data_catalog/${frelout[$i]}3883 fi3884 3885 # GENERATE AND SUBMIT BATCH-JOB3886 # FILE HAS TO BE DELETED FROM THE TEMPORARY DATA DIRECTORY3887 # DELETE OLD EXISTING FILES FROM THE ARCHIVE3888 echo "cd $tmp_data_catalog" > archive_${frelout[$i]}3889 if [[ $files_for_pes = false ]]3890 then3891 echo "rm -rf \$PERM/${frelout[$i]}" >> archive_${frelout[$i]}3892 echo "cp ${frelout[$i]} \$PERM/${frelout[$i]}" >> archive_${frelout[$i]}3893 echo "rm -rf ${frelout[$i]}" >> archive_${frelout[$i]}3894 else3895 echo "rm -rf \$PERM/${frelout[$i]}.tar" >> archive_${frelout[$i]}3896 echo "tar cvf \$PERM/${frelout[$i]}.tar ${frelout[$i]}" >> archive_${frelout[$i]}3897 echo "rm -rf ${frelout[$i]}" >> archive_${frelout[$i]}3898 fi3899 3900 subjob -v -d -q cdata -X 0 -m 1000 -t 43200 -c $job_catalog $PORTOPT archive_${frelout[$i]}3901 printf " Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n"3902 file_saved=true3903 3904 elif [[ $archive_system = ut ]]3905 then3906 # ARCHIVING ONLY POSSIBLE VIA BATCH-JOB3907 # IN THE MEANTIME, FILE IS STORED IN THE TEMPORARY DATA DIRECTORY,3908 # BECAUSE MRUN'S CURRENT TEMPORARY WORKING DIRECTORY MAY ALREADY BE DELETED3909 # WHEN THE ARCHIVE-JOB IS EXECUTED3910 [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog3911 chmod g+rx $tmp_data_catalog3912 if [[ $files_for_pes = false ]]3913 then3914 ln -f ${frelout[$i]} $tmp_data_catalog/${frelout[$i]}3915 else3916 mkdir $tmp_data_catalog/${frelout[$i]}3917 ln -f ${frelout[$i]}/* $tmp_data_catalog/${frelout[$i]}3918 fi3919 3920 # GENERATE AND SUBMIT BATCH-JOB3921 # FILE HAS TO BE DELETED FROM THE TEMPORARY DATA DIRECTORY3922 # DELETE OLD EXISTING FILES FROM THE ARCHIVE3923 echo "cd $tmp_data_catalog" > archive_${frelout[$i]}3924 if [[ $files_for_pes = false ]]3925 then3926 echo "rm -rf \$UT/${frelout[$i]}" >> archive_${frelout[$i]}3927 echo "cp ${frelout[$i]} \$UT/${frelout[$i]}" >> archive_${frelout[$i]}3928 echo "rm -rf ${frelout[$i]}" >> archive_${frelout[$i]}3929 else3930 echo "rm -rf \$UT/${frelout[$i]}.tar" >> archive_${frelout[$i]}3931 echo "tar cvf \$UT/${frelout[$i]}.tar ${frelout[$i]}" >> archive_${frelout[$i]}3932 echo "rm -rf ${frelout[$i]}" >> archive_${frelout[$i]}3933 fi3934 3935 subjob -v -c /pf/b/$usern/job_queue -d -q pp -X 0 -m 1000 -t 7200 $PORTOPT archive_${frelout[$i]}3936 printf " Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n"3937 file_saved=true3938 3939 else3940 printf "\n +++ archive_system=\"$archive_system\" archiving impossible!"3941 archive_save=false3942 fi3943 3944 # CREATE EMPTY FLAG-FILE OR -DIRECTORY3945 # IN ORDER TO NOTE THE RESPECTIVE CYCLE NUMBER ON THE ARCHIVE SYSTEM3946 # RESTART-JOBS ARE USING THESE EMPTY-DIRECTORIES TO GET THE CURRENT HIGHEST3947 # CYCLE NUMBER ON THE ARCHIVE SYSTEM (IN CASE THAT INFORMATIONS ARE DIFFICULT TO3948 # TO ACCESS FROM THE ARCHIVE-SYSTEM DIRECTLY))3949 if [[ $file_saved = true ]]3950 then3951 if [[ $files_for_pes = false ]]3952 then3953 cat /dev/null > ${pathout[$i]}3954 else3955 mkdir -p ${pathout[$i]}3956 fi3957 fi3958 3959 fi3960 3407 3961 3408 # APPEND ON THIS MACHINE … … 3982 3429 then 3983 3430 printf "\n >>> OUTPUT: ${localout[$i]} to ${pathout[$i]}.${extout[$i]}\n" 3984 if [[ $link_local_output = true ]]3985 then3986 printf " using ln -f\n"3987 ln -f ${localout[$i]} ${pathout[$i]}.${extout[$i]}3988 fi3989 # If "ln -f" fails of if "$link_local_output = false" do a normal "cp"3990 if [[ ! -f "${pathout[$i]}.${extout[$i]}" ]]3431 if [[ $link_local_output = true ]] 3432 then 3433 printf " file will be linked\n" 3434 ln -f ${localout[$i]} ${pathout[$i]}.${extout[$i]} 3435 fi 3436 # If "ln -f" fails of if "$link_local_output = false" do a normal "cp" 3437 if [[ ! -f "${pathout[$i]}.${extout[$i]}" ]] 3991 3438 then 3992 if [[ $link_local_output = true ]] 3993 then 3994 printf " ln failed, using cp...\n" 3995 fi 3996 cp ${localout[$i]} ${pathout[$i]}.${extout[$i]} 3439 if [[ $link_local_output = true ]] 3440 then 3441 printf " --- WARNING: ln failed, using cp instead (might be time consuming...)\n" 3442 fi 3443 cp ${localout[$i]} ${pathout[$i]}.${extout[$i]} 3444 else 3445 printf "+++ no copy because file ${pathout[$i]}.${extout[$i]} exists\n" 3997 3446 fi 3998 3447 else 3999 3448 printf "\n >>> OUTPUT: ${localout[$i]} to ${pathout[$i]}\n" 4000 if [[ $link_local_output = true ]]4001 then4002 printf " using ln -f\n"4003 ln -f ${localout[$i]} ${pathout[$i]}4004 fi4005 # If "ln -f" fails of if "$link_local_output = false" do a normal "cp"4006 if [[ ! -f "${pathout[$i]}" ]]3449 if [[ $link_local_output = true ]] 3450 then 3451 printf " file will be linked\n" 3452 ln -f ${localout[$i]} ${pathout[$i]} 3453 fi 3454 # If "ln -f" fails of if "$link_local_output = false" do a normal "cp" 3455 if [[ ! -f "${pathout[$i]}" ]] 4007 3456 then 4008 if [[ $link_local_output = true ]] 4009 then 4010 printf " ln failed, using cp...\n" 4011 fi 4012 cp ${localout[$i]} ${pathout[$i]} 3457 if [[ $link_local_output = true ]] 3458 then 3459 printf " --- WARNING: ln failed, using cp instead (might be time consuming...)\n" 3460 fi 3461 cp ${localout[$i]} ${pathout[$i]} 3462 else 3463 printf "+++ no copy because file ${pathout[$i]} exists\n" 4013 3464 fi 4014 3465 fi … … 4020 3471 # AS A FIRST STEP, THE PERMANENT DIRECTORY IS CREATED 4021 3472 printf "\n >>> OUTPUT: ${localout[$i]}/_.... to ${pathout[$i]}\n" 4022 if [[ $link_local_output = true ]]4023 then4024 printf " using ln -f\n"4025 mkdir ${pathout[$i]}4026 cd ${localout[$i]}4027 for file in $(ls *)4028 do4029 ln -f $file ${pathout[$i]}4030 done4031 cd $TEMPDIR4032 fi3473 if [[ $link_local_output = true ]] 3474 then 3475 printf " files will be linked\n" 3476 mkdir ${pathout[$i]} 3477 cd ${localout[$i]} 3478 for file in $(ls *) 3479 do 3480 ln -f $file ${pathout[$i]} 3481 done >|/dev/null 2>&1 3482 cd $TEMPDIR 3483 fi 4033 3484 4034 3485 # IF "ln -f" HAS FAILED OR IF "$link_local_output = false" DO A NORMAL COPY "cp -r" 4035 if [[ ! -f "${pathout[$i]}/_0000" ]]3486 if [[ ! -f "${pathout[$i]}/_000000" ]] 4036 3487 then 4037 if [[ $link_local_output = true ]]4038 then4039 printf " ln failed for .../_0000, using cp...\n"4040 fi4041 cp -r ${localout[$i]}${pathout[$i]}4042 fi3488 if [[ $link_local_output = true ]] 3489 then 3490 printf " --- WARNING: ln failed, using cp instead (might be time consuming...)\n" 3491 fi 3492 cp -r ${localout[$i]}/* ${pathout[$i]} 3493 fi 4043 3494 4044 3495 fi … … 4062 3513 then 4063 3514 4064 if [[ $archive_save = true ]] 4065 then 4066 4067 # ADD RESTART-OPTIONS TO THE MRUN-CALL (IF THEY ARE NOT USED ALREADY): 4068 # -C TELLS MRUN THAT IT IS A RESTART-RUN 4069 # -v SILENT MODE WITHOUT INTERACTIVE QUERIES 4070 # -n BATCH-MODE (IMPORTANT ONLY IN CASE OF BATCH JOBS ON THE LOCAL MACHINE) 4071 [[ $(echo $mc | grep -c "\-C") = 0 ]] && mc="$mc -C" 4072 [[ $(echo $mc | grep -c "\-v") = 0 ]] && mc="$mc -v" 4073 [[ $(echo $mc | grep -c "\-b") = 0 ]] && mc="$mc -b" 4074 if [[ $(echo $mc | grep -c "#") != 0 ]] 4075 then 4076 mc=`echo $mc | sed 's/#/f/g'` 4077 fi 4078 4079 4080 # START THE RESTART-JOB 4081 printf "\n\n *** initiating restart-run on \"$return_address\" using command:\n" 4082 echo " $mc" 4083 printf "\n$dashes\n" 4084 if [[ $localhost != $fromhost ]] 4085 then 4086 4087 if [[ $localhost = lcbullhh || $localhost = lccrayb || $localhost = lccrayh || $localhost = nech || $localhost = ibmh || $localhost = ibmkisti || $localhost = ibmku || $localhost = ibms || $localhost = lceddy || $localhost = lckyu* || $localhost = lcxe6 ]] 3515 # ADD RESTART-OPTIONS TO THE MRUN-CALL (IF THEY ARE NOT USED ALREADY): 3516 # -C TELLS MRUN THAT IT IS A RESTART-RUN 3517 # -v SILENT MODE WITHOUT INTERACTIVE QUERIES 3518 # -n BATCH-MODE (IMPORTANT ONLY IN CASE OF BATCH JOBS ON THE LOCAL MACHINE) 3519 [[ $(echo $mc | grep -c "\-C") = 0 ]] && mc="$mc -C" 3520 [[ $(echo $mc | grep -c "\-v") = 0 ]] && mc="$mc -v" 3521 [[ $(echo $mc | grep -c "\-b") = 0 ]] && mc="$mc -b" 3522 if [[ $(echo $mc | grep -c "#") != 0 ]] 3523 then 3524 mc=`echo $mc | sed 's/#/f/g'` 3525 fi 3526 3527 3528 # START THE RESTART-JOB 3529 printf "\n\n *** initiating restart-run on \"$return_address\" using command:\n" 3530 echo " $mc" 3531 printf "\n$dashes\n" 3532 if [[ $localhost != $fromhost ]] 3533 then 3534 3535 if [[ $localhost = lcbullhh || $localhost = lccrayb || $localhost = lccrayh || $localhost = ibmh || $localhost = ibmkisti || $localhost = ibmku || $localhost = ibms || $localhost = lceddy || $localhost = lckyu* || $localhost = lcxe6 ]] 3536 then 3537 echo "*** ssh will be used to initiate restart-runs!" 3538 echo " return_address=\"$return_address\" " 3539 echo " return_username=\"$return_username\" " 3540 if [[ $(echo $return_address | grep -c "130.75.105") = 1 ]] 3541 3542 if [[ $localhost = lcbullhh || $localhost = lccrayb || $localhost = lccrayh || $localhost = ibmh || $localhost = ibmkisti || $localhost = ibmku || $localhost = ibms || $localhost = lceddy || $localhost = lckyu* || $localhost = lcxe6 ]] 4088 3543 then 4089 echo "*** ssh will be used to initiate restart-runs!" 4090 echo " return_address=\"$return_address\" " 4091 echo " return_username=\"$return_username\" " 4092 if [[ $(echo $return_address | grep -c "130.75.105") = 1 ]] 3544 if [[ $localhost = ibmh ]] 4093 3545 then 4094 if [[ $localhost = ibmh ]] 4095 then 4096 ssh $SSH_PORTOPT $usern@136.172.40.15 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4097 elif [[ $localhost = lcbullhh ]] 4098 then 4099 ssh $SSH_PORTOPT $usern@mlogin101 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4100 elif [[ $localhost = lccrayb ]] 4101 then 4102 ssh $usern@blogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH; export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4103 elif [[ $localhost = lccrayh ]] 4104 then 4105 ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH; export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4106 elif [[ $localhost = lcxe6 ]] 4107 then 4108 ssh $usern@hexagon "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH; export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4109 else 4110 ssh $SSH_PORTOPT $return_address -l $return_username ". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 4111 fi 3546 ssh $SSH_PORTOPT $usern@136.172.40.15 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 3547 elif [[ $localhost = lcbullhh ]] 3548 then 3549 ssh $SSH_PORTOPT $usern@mlogin101 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 3550 elif [[ $localhost = lccrayb ]] 3551 then 3552 ssh $usern@blogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH; export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 3553 elif [[ $localhost = lccrayh ]] 3554 then 3555 ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH; export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 3556 elif [[ $localhost = lcxe6 ]] 3557 then 3558 ssh $usern@hexagon "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH; export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4112 3559 else 4113 if [[ $localhost = ibmkisti ]] 4114 then 4115 ssh $SSH_PORTOPT $usern@gaiad "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4116 elif [[ $localhost = lceddy ]] 4117 then 4118 /usr/bin/ssh $SSH_PORTOPT $return_address -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 4119 elif [[ $localhost = lcocean ]] 4120 then 4121 /usr/bin/ssh $SSH_PORTOPT $return_address -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 4122 elif [[ $localhost = lccrayb ]] 4123 then 4124 ssh $usern@blogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4125 elif [[ $localhost = lccrayh ]] 4126 then 4127 ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 4128 else 4129 ssh $SSH_PORTOPT $return_address -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 4130 fi 3560 ssh $SSH_PORTOPT $return_address -l $return_username ". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 4131 3561 fi 4132 3562 else 4133 printf "\n +++ no restart mechanism available for host \"$localhost\" " 4134 locat=restart; exit 3563 if [[ $localhost = ibmkisti ]] 3564 then 3565 ssh $SSH_PORTOPT $usern@gaiad "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 3566 elif [[ $localhost = lceddy ]] 3567 then 3568 /usr/bin/ssh $SSH_PORTOPT $return_address -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 3569 elif [[ $localhost = lcocean ]] 3570 then 3571 /usr/bin/ssh $SSH_PORTOPT $return_address -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 3572 elif [[ $localhost = lccrayb ]] 3573 then 3574 ssh $usern@blogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 3575 elif [[ $localhost = lccrayh ]] 3576 then 3577 ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " 3578 else 3579 ssh $SSH_PORTOPT $return_address -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 3580 fi 4135 3581 fi 4136 4137 # WAIT TO ALLOW THE RESTART-JOB TO BE QUEUED, BEFORE THE CURRENT JOB IS FINISHED4138 if [[ $queue = special1q ]]4139 then4140 sleep 1204141 else4142 sleep 304143 fi4144 4145 3582 else 4146 4147 # JOBS RUNNING (AND STARTED) ON THE LOCAL MACHINE CAN DIRECTLY CALL MRUN (WITHOUT 4148 # USING SSH) 4149 cd $LOCAL_PWD 4150 if [[ $localhost = lckyuh ]] 4151 then 4152 printf "\n +++ WARNING: no restart mechanism available for host \"$localhost\" " 4153 printf "\n please restart job manually using command:\n" 4154 printf "\n \"$mc\" " 4155 else 4156 eval $mc # THE ' MUST BE EVALUATED 4157 fi 4158 cd - > /dev/null 4159 fi 3583 printf "\n +++ no restart mechanism available for host \"$localhost\" " 3584 locat=restart; exit 3585 fi 3586 3587 # WAIT TO ALLOW THE RESTART-JOB TO BE QUEUED, BEFORE THE CURRENT JOB IS FINISHED 3588 if [[ $queue = special1q ]] 3589 then 3590 sleep 120 3591 else 3592 sleep 30 3593 fi 3594 3595 else 3596 3597 # JOBS RUNNING (AND STARTED) ON THE LOCAL MACHINE CAN DIRECTLY CALL MRUN (WITHOUT 3598 # USING SSH) 3599 cd $LOCAL_PWD 4160 3600 if [[ $localhost = lckyuh ]] 4161 3601 then 4162 printf "\n$dashes\n *** restart-run to be initiated manually\n" 3602 printf "\n +++ WARNING: no restart mechanism available for host \"$localhost\" " 3603 printf "\n please restart job manually using command:\n" 3604 printf "\n \"$mc\" " 4163 3605 else 4164 printf "\n$dashes\n *** restart-run initiated \n" 4165 fi 4166 4167 4168 # DELETE INPUT-(RESTART)FILES, WHICH HAVE BEEN FETCHED FROM THE TEMPORARY DATA 4169 # DIRECTORY, BACAUSE THEY ARE NOT REQUIRED BY THE RESTART-JOB. 4170 # THIS IS DONE IN ORDER TO AVOID EXCEEDING DISC QUOTAS OR DISC SPACE (RESTART-FILES 4171 # MAY BE VERY HUGE) 4172 (( i = 0 )) 4173 while (( i < iin )) 4174 do 4175 (( i = i + 1 )) 4176 if [[ "${got_tmp[$i]}" = true && $keep_data_from_previous_run = false ]] 4177 then 4178 rm -r $tmp_data_catalog/${frelin[$i]} 4179 fi 4180 done 4181 3606 eval $mc # THE ' MUST BE EVALUATED 3607 fi 3608 cd - > /dev/null 3609 fi 3610 if [[ $localhost = lckyuh ]] 3611 then 3612 printf "\n$dashes\n *** restart-run to be initiated manually\n" 4182 3613 else 4183 4184 printf "\n +++ no restart-run possible, since errors occured" 4185 printf "\n during the archive process" 4186 fi 3614 printf "\n$dashes\n *** restart-run initiated \n" 3615 fi 3616 3617 3618 # DELETE INPUT-(RESTART)FILES, WHICH HAVE BEEN FETCHED FROM THE TEMPORARY DATA 3619 # DIRECTORY, BACAUSE THEY ARE NOT REQUIRED BY THE RESTART-JOB. 3620 # THIS IS DONE IN ORDER TO AVOID EXCEEDING DISC QUOTAS OR DISC SPACE (RESTART-FILES 3621 # MAY BE VERY HUGE) 3622 (( i = 0 )) 3623 while (( i < iin )) 3624 do 3625 (( i = i + 1 )) 3626 if [[ "${got_tmp[$i]}" = true && $keep_data_from_previous_run = false ]] 3627 then 3628 rm -r ${absnamein[$i]} 3629 fi 3630 done 4187 3631 4188 3632 fi … … 4229 3673 [[ $do_compile = true ]] && mrun_com=${mrun_com}" -s \"$source_list\"" 4230 3674 [[ "$input_list" != "" ]] && mrun_com=${mrun_com}" -i \"$input_list\"" 4231 [[ $ignore_archive_error = true ]] && mrun_com=${mrun_com}" -I"4232 3675 [[ $keep_data_from_previous_run = true ]] && mrun_com=${mrun_com}" -k" 4233 3676 [[ "$additional_conditions" != "" ]] && mrun_com=${mrun_com}" -K \"$additional_conditions\"" … … 4241 3684 fi 4242 3685 [[ "$tasks_per_node" != "" ]] && mrun_com=${mrun_com}" -T $tasks_per_node" 4243 [[ $store_on_archive_system = true ]] && mrun_com=${mrun_com}" -A"4244 3686 [[ $package_list != "" ]] && mrun_com=${mrun_com}" -p \"$package_list\"" 4245 3687 [[ $return_password != "" ]] && mrun_com=${mrun_com}" -P $return_password" -
palm/trunk/SOURCE/palm.f90
r2233 r2261 25 25 ! ----------------- 26 26 ! $Id$ 27 ! output of run number for mrun to create unified cycle numbers 28 ! 29 ! 2233 2017-05-30 18:08:54Z suehring 27 30 ! 28 31 ! 2232 2017-05-30 17:47:52Z suehring … … 171 174 172 175 USE control_parameters, & 173 174 176 ONLY: cloud_physics, constant_diffusion, coupling_char, coupling_mode,& 175 177 do2d_at_begin, do3d_at_begin, humidity, initializing_actions, & 176 land_surface, io_blocks, io_group, & 177 large_scale_forcing, message_string, microphysics_seifert, & 178 nest_domain, neutral, & 179 nudging, passive_scalar, simulated_time, simulated_time_chr, & 180 urban_surface, & 178 io_blocks, io_group, land_surface, large_scale_forcing, & 179 message_string, microphysics_seifert, nest_domain, neutral, & 180 nudging, passive_scalar, runnr, simulated_time, & 181 simulated_time_chr, urban_surface, & 181 182 user_interface_current_revision, & 182 183 user_interface_required_revision, version, wall_heatflux, & … … 480 481 481 482 ! 483 !-- Write run number to file (used by mrun to create unified cycle numbers for 484 !-- output files 485 IF ( myid == 0 .AND. runnr > 0 ) THEN 486 OPEN( 90, FILE='RUN_NUMBER', FORM='FORMATTED' ) 487 WRITE( 90, '(I4)' ) runnr 488 CLOSE( 90 ) 489 ENDIF 490 491 ! 482 492 !-- Take final CPU-time for CPU-time analysis 483 493 CALL cpu_log( log_point(1), 'total', 'stop' ) -
palm/trunk/SOURCE/prognostic_equations.f90
r2233 r2261 25 25 ! ----------------- 26 26 ! $Id$ 27 ! bugfix for r2232: openmp directives removed 28 ! 29 ! 2233 2017-05-30 18:08:54Z suehring 27 30 ! 28 31 ! 2232 2017-05-30 17:47:52Z suehring … … 404 407 call_microphysics_at_all_substeps ) ) & 405 408 THEN 406 !$OMP PARALLEL private(i,j)409 !$OMP PARALLEL PRIVATE (i,j) 407 410 !$OMP DO 408 !$OMP PARALLEL PRIVATE (i, j)409 !$OMP DO410 411 DO i = nxlg, nxrg 411 412 DO j = nysg, nyng … … 414 415 ENDDO 415 416 !$OMP END PARALLEL 416 !$OMP END PARALLEL417 417 ENDIF 418 418 419 419 ! 420 420 !-- Loop over all prognostic equations 421 !$OMP PARALLEL private(i,i_omp_start,j,k,loop_start,tn)421 !$OMP PARALLEL PRIVATE (i,i_omp_start,j,k,loop_start,tn) 422 422 423 423 !$ tn = omp_get_thread_num()
Note: See TracChangeset
for help on using the changeset viewer.