- Timestamp:
- Nov 1, 2017 2:11:20 PM (7 years ago)
- Location:
- palm/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/batch_scp
r2261 r2600 27 27 # ----------------- 28 28 # $Id$ 29 # cycle numbers made three digits wide 30 # host depending code completely removed 31 # 32 # 2261 2017-06-08 14:25:57Z raasch 29 33 # option usecycle added, script is running under bash now, 30 34 # filenames are allowed to contain arbitrary number of dots "." … … 78 82 catalog_copy=false 79 83 check=false 84 cyclestring="" 80 85 delete=false 81 86 errfile=batch_scp.errfile.$random … … 83 88 get=false 84 89 local_host=`hostname` 85 local_user=$USER86 90 local_wdir=`pwd` 87 91 locat=normal … … 93 97 silent=false 94 98 transfermode=binary 95 zyklusnr=""96 99 typeset -i iii icycle maxcycle=0 usecycle wait=0 97 100 … … 261 264 262 265 263 # Using absolute paths for ssh on lcflow (nodes "cfd_*") as the paths of the264 # job scheduler have changed265 if [[ $(echo $local_host | cut -c1-3) = "cfd" ]]266 then267 SSH_BIN=/usr/bin/ssh268 else269 SSH_BIN=ssh270 fi271 272 273 266 # PRUEFEN, OB LOKALE DATEI/LOKALES VERZEICHNIS VORHANDEN BZW. NICHT VORHANDEN 274 267 if [[ $get = false ]] … … 326 319 327 320 # VERZEICHNISLSTE DES ZIELRECHNERS ERSTELLEN 328 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 329 then 330 ssh $SSH_PORTOPT $local_user@gaiad "ssh $SSH_PORTOPT $1 -l $remote_user \"unset LANG; cd $3; ls -1; echo '*** list complete'\" " > $filelist 2>&1 331 else 332 $SSH_BIN $SSH_PORTOPT $1 -l $remote_user "unset LANG; cd $3; ls -1; echo '*** list complete'" > $filelist 2>&1 333 fi 321 ssh $SSH_PORTOPT $1 -l $remote_user "unset LANG; cd $3; ls -1; echo '*** list complete'" > $filelist 2>&1 334 322 ssh_status=$? 335 323 … … 430 418 fi 431 419 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 480 481 if (( icycle > maxcycle )) 482 then 483 (( maxcycle = icycle )) 484 fi 485 # fi 420 if (( icycle > maxcycle )) 421 then 422 (( maxcycle = icycle )) 423 424 # FOR COMPATIBILITY REASONS WITH OLDER VERSIONS 425 # CHECK IF CYCLE NUMBER CONTAINS LEADING ZEROS 426 if [[ $(echo $cycle | cut -c1) = 0 ]] 427 then 428 leading_zero=true 429 else 430 leading_zero=false 431 fi 432 fi 486 433 487 434 else … … 504 451 then 505 452 (( maxcycle = maxcycle + 1 )) 453 506 454 # TRY TO USE FIXED CYCLE NUMBER, IF GIVEN AS OPTION 507 455 if [[ "$usecycle" != "" ]] … … 514 462 fi 515 463 fi 516 zyklusnr=".$maxcycle"464 cyclestring=`printf ".%03d" $maxcycle` 517 465 else 518 466 if (( maxcycle == 0 )) 519 467 then 520 zyklusnr=""468 cyclestring="" 521 469 else 522 zyklusnr=".$maxcycle"470 cyclestring=`printf ".%03d" $maxcycle` 523 471 fi 524 472 fi … … 536 484 if (( maxcycle == 0 )) 537 485 then 538 zyklusnr=""486 cyclestring="" 539 487 else 540 zyklusnr=".$maxcycle" 488 489 # MAKE CYCLE NUMBER THREE DIGITS WIDE 490 if [[ $leading_zero = true ]] 491 then 492 cyclestring=`printf ".%03d" $maxcycle` 493 else 494 cyclestring=.$maxcycle 495 fi 541 496 (( maxcycle = 0 )) 542 497 fi 543 498 else 544 zyklusnr=""499 cyclestring="" 545 500 fi 546 501 fi … … 551 506 then 552 507 (( maxcycle = usecycle )) 553 zyklusnr=".$usecycle"508 cyclestring=`printf ".%03d" $usecycle` 554 509 else 555 zyklusnr=""510 cyclestring="" 556 511 fi 557 512 … … 571 526 if [[ $make_catalog = force ]] 572 527 then 573 zyklusnr=""528 cyclestring="" 574 529 (( maxcycle = 0 )) 575 530 fi … … 580 535 if [[ $print_local_filename = true ]] 581 536 then 582 printf "$4$ zyklusnr\n"537 printf "$4$cyclestring\n" 583 538 rm -r $filelist 584 539 exit … … 591 546 if [[ "$5" != "" && $get = false ]] 592 547 then 593 zyklusnr=${zyklusnr}.$5548 cyclestring=${cyclestring}.$5 594 549 fi 595 550 … … 599 554 if [[ $catalog_copy = true && $get = true ]] 600 555 then 556 601 557 rm -rf $filelist 602 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 603 then 604 ssh $SSH_PORTOPT $local_user@gaiad "ssh $1 -l $remote_user \"cd $3\" " > $filelist 605 else 606 $SSH_BIN $SSH_PORTOPT $1 -l $remote_user "cd $3" > $filelist 607 fi 558 ssh $SSH_PORTOPT $1 -l $remote_user "cd $3" > $filelist 559 608 560 if [[ $? != 0 ]] 609 561 then … … 616 568 locat=directory; exit 617 569 fi 570 618 571 fi 619 572 … … 630 583 631 584 632 # Auf IBM-Rechnern (HLRN) Tilde aus Katalognamen entfernen, da scp633 # diese nicht versteht634 585 catalog_name=$3 635 if [[ $(hostname | cut -c1-4) = hreg || $(hostname | cut -c1-4) = breg ]]636 then637 catalog_name=${catalog_name#"~/"}638 catalog_name=${catalog_name#"~"}639 fi640 586 [[ "$catalog_name" != "" ]] && catalog_name=${catalog_name}/ 641 587 … … 648 594 if [[ $append = false ]] 649 595 then 650 if [[ $(echo $local_host | cut -c1-2) = cs ]] 651 then 652 if [[ $catalog_copy = false ]] 653 then 654 scp $PORTOPT -p -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr 655 else 656 scp $PORTOPT -p -r -q -v $2 $remote_user@$1:$catalog_name$4$zyklusnr 657 fi 658 elif [[ $(echo $local_host | cut -c1-4) = gaia ]] 659 then 660 if [[ $catalog_copy = false ]] 661 then 662 ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$zyklusnr" > /dev/null 663 else 664 ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr" > /dev/null 665 fi 596 597 if [[ $catalog_copy = false ]] 598 then 599 scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$cyclestring > /dev/null 666 600 else 667 if [[ $catalog_copy = false ]] 668 then 669 scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$zyklusnr > /dev/null 670 else 671 scp $PORTOPT -p -r $2 $remote_user@$1:$catalog_name$4$zyklusnr > /dev/null 672 fi 601 scp $PORTOPT -p -r $2 $remote_user@$1:$catalog_name$4$cyclestring > /dev/null 673 602 fi 674 603 scp_status=$? … … 681 610 local_size=`echo $local_size | cut -d" " -f5` 682 611 683 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 684 then 685 remote_size=`ssh $SSH_PORTOPT $local_user@gaiad "ssh $SSH_PORTOPT $1 -l $remote_user \"ls -al $catalog_name$4$zyklusnr\" "` 686 else 687 remote_size=`$SSH_BIN $SSH_PORTOPT $1 -l $remote_user "ls -al $catalog_name$4$zyklusnr"` 688 fi 612 remote_size=`ssh $SSH_PORTOPT $1 -l $remote_user "ls -al $catalog_name$4$cyclestring"` 689 613 remote_size=`echo $remote_size | cut -d" " -f5` 690 614 … … 697 621 fi 698 622 fi 699 else 700 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 701 then 702 ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random" > /dev/null 703 else 704 scp $PORTOPT -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random > /dev/null 705 fi 623 624 else 625 626 scp $PORTOPT -p $2 $remote_user@$1:${catalog_name}batch_scp_append_file.$random > /dev/null 627 706 628 if [[ $? != 0 ]] 707 629 then … … 711 633 local_size=`echo $local_size | cut -d" " -f5` 712 634 713 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 714 then 715 remote_size=`ssh $SSH_PORTOPT $local_user@gaiad "ssh $SSH_PORTOPT $1 -l $remote_user \"ls -al ${catalog_name}batch_scp_append_file.$random\" "` 716 else 717 remote_size=`$SSH_BIN $SSH_PORTOPT $1 -l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"` 718 fi 635 remote_size=`ssh $SSH_PORTOPT $1 -l $remote_user "ls -al ${catalog_name}batch_scp_append_file.$random"` 719 636 remote_size=`echo $remote_size | cut -d" " -f5` 720 637 … … 730 647 rm $filelist 731 648 732 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 733 then 734 ssh $SSH_PORTOPT $local_user@gaiad "ssh $SSH_PORTOPT $1 -l $remote_user \"cd $3; cat batch_scp_append_file.$random >> $4$zyklusnr; rm batch_scp_append_file.$random; echo '*** append complete'\" " > $filelist 735 else 736 $SSH_BIN $SSH_PORTOPT $1 -l $remote_user "cd $3; cat batch_scp_append_file.$random >> $4$zyklusnr; rm batch_scp_append_file.$random; echo '*** append complete'" > $filelist 737 fi 649 ssh $SSH_PORTOPT $1 -l $remote_user "cd $3; cat batch_scp_append_file.$random >> $4$cyclestring; rm batch_scp_append_file.$random; echo '*** append complete'" > $filelist 650 738 651 if [[ $? != 0 ]] 739 652 then … … 749 662 fi 750 663 fi 664 751 665 else 752 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 753 then 754 ssh $SSH_PORTOPT $local_user@gaiad "ssh $1 -l $remote_user \"mkdir -p $3\" " 755 else 756 $SSH_BIN $SSH_PORTOPT $1 -l $remote_user "mkdir -p $3" 757 fi 666 667 ssh $SSH_PORTOPT $1 -l $remote_user "mkdir -p $3" 668 758 669 if [[ $? != 0 ]] 759 670 then 760 671 locat=ssh_failed_4; exit 761 672 fi 762 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 763 then 764 ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$zyklusnr" > /dev/null 765 else 766 scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$zyklusnr > /dev/null 767 fi 673 674 scp $PORTOPT -p $2 $remote_user@$1:$catalog_name$4$cyclestring > /dev/null 675 768 676 if [[ $? != 0 ]] 769 677 then … … 784 692 else 785 693 786 if [[ $(echo $local_host | cut -c1-4) = gaia ]] 787 then 788 ssh $SSH_PORTOPT $local_user@gaiad "cd $local_wdir; scp $PORTOPT -p $remote_user@$1:$catalog_name$4$zyklusnr $2" > /dev/null 789 else 790 scp $PORTOPT -p $remote_user@$1:$catalog_name$4$zyklusnr $2 > /dev/null 791 fi 694 scp $PORTOPT -p $remote_user@$1:$catalog_name$4$cyclestring $2 > /dev/null 695 792 696 if [[ $? != 0 ]] 793 697 then … … 796 700 797 701 fi 702 798 703 else 799 704 … … 801 706 locat=unavailable_feature; exit 802 707 803 # ftp -i $1 << %END% > /dev/null 804 #$transfermode 805 #cd $3 806 #mget * 807 #quit 808 #%END% 809 fi 708 fi 709 810 710 fi 811 711 … … 837 737 if [[ $catalog_copy = false ]] 838 738 then 839 printf " new file has cycle number $maxcycle \n"739 printf " new file has cycle number .%03d \n" $maxcycle 840 740 else 841 printf " new catalog has cycle number $maxcycle \n"842 fi 843 else 844 printf " append to cycle number $maxcycle \n"741 printf " new catalog has cycle number .%03d \n" $maxcycle 742 fi 743 else 744 printf " append to cycle number .%03d \n" $maxcycle 845 745 fi 846 746 fi -
palm/trunk/SCRIPTS/palmrun
r2566 r2600 27 27 # ----------------- 28 28 # $Id$ 29 # cycle numbers are made three digits wide 30 # 31 # 2566 2017-10-20 08:50:47Z raasch 29 32 # execute command for combine_plot_fields added 30 33 # "TEMPDIR" renamed "tempdir" … … 1017 1020 then 1018 1021 (( maxcycle = icycle )) 1022 1023 # FOR COMPATIBILITY REASONS WITH OLDER VERSIONS 1024 # CHECK IF CYCLE NUMBER CONTAINS LEADING ZEROS 1025 if [[ $(echo $cycle | cut -c1) = 0 ]] 1026 then 1027 leading_zero=true 1028 else 1029 leading_zero=false 1030 fi 1019 1031 fi 1020 1032 … … 1022 1034 rm filelist 1023 1035 1036 # MAKE CYCLE NUMBER THREE DIGITS WIDE 1037 if [[ $leading_zero = true ]] 1038 then 1039 cyclestring=`printf "%03d" $maxcycle` 1040 else 1041 cyclestring=$maxcycle 1042 fi 1043 1024 1044 # APPEND CYCLE NUMBER TO FILENAME 1025 1045 if (( maxcycle > 0 )) … … 1027 1047 if [[ "${extin[$i]}" != " " && "${extin[$i]}" != "" ]] 1028 1048 then 1029 filename=${filename}.$ maxcycle.${extin[$i]}1049 filename=${filename}.$cyclestring.${extin[$i]} 1030 1050 else 1031 filename=${filename}.$ maxcycle1051 filename=${filename}.$cyclestring 1032 1052 fi 1033 1053 else … … 1045 1065 if [[ "${actionin[$i]}" = di ]] 1046 1066 then 1047 frelin[$i]=${endin[$i]}.$ maxcycle1067 frelin[$i]=${endin[$i]}.$cyclestring 1048 1068 else 1049 frelin[$i]=${fname}${endin[$i]}.$ maxcycle1069 frelin[$i]=${fname}${endin[$i]}.$cyclestring 1050 1070 fi 1051 1071 else … … 1161 1181 if [[ "${actionout[$i]}" != a ]] 1162 1182 then 1183 cyclestring=`printf "%03d" $maxcycle` 1163 1184 if (( maxcycle > 0 )) 1164 1185 then 1165 filename_tmp=${filename}.$ maxcycle1186 filename_tmp=${filename}.$cyclestring 1166 1187 if cat /dev/null > $filename_tmp 1167 1188 then … … 2053 2074 if (( cycnum[$i] > 0 )) 2054 2075 then 2055 pathout[$i]=${pathout[$i]}.${cycnum[$i]} 2076 cyclestring=`printf "%03d" ${cycnum[$i]}` 2077 pathout[$i]=${pathout[$i]}.$cyclestring 2056 2078 fi 2057 2079 fi -
palm/trunk/SOURCE/Makefile
r2599 r2600 25 25 # ----------------- 26 26 # $Id$ 27 # comment line concerning bound checks removed 28 # 29 # 2599 2017-11-01 13:18:45Z hellstea 27 30 # virtual_flight_mod.o, synthetic_turbulence_generator_mod.o and 28 31 # wind_turbine_model_mod.o were added to read_var_list.o … … 446 449 # The following line is needed for palm_simple_install, don't remove it! 447 450 #to_be_replaced_by_include 448 449 #BOUNDS="-Rbc" # Array bounds checking. Compromises performance seriously.450 451 451 452 .SUFFIXES: -
palm/trunk/SOURCE/init_pegrid.f90
r2516 r2600 25 25 ! ----------------- 26 26 ! $Id$ 27 ! calculation of block-I/O quantitites removed (is now done in parin) 28 ! 29 ! 2516 2017-10-04 11:03:04Z suehring 27 30 ! Remove tabs 28 31 ! … … 209 212 coupling_topology, gathered_size, grid_level, & 210 213 grid_level_count, inflow_l, inflow_n, inflow_r, inflow_s, & 211 io_blocks, io_group, maximum_grid_level, & 212 maximum_parallel_io_streams, message_string, & 214 maximum_grid_level, message_string, & 213 215 mg_switch_to_pe0_level, momentum_advec, nest_bound_l, & 214 216 nest_bound_n, nest_bound_r, nest_bound_s, nest_domain, neutral, & … … 1372 1374 ENDIF 1373 1375 1374 !1375 !-- Calculate the number of groups into which parallel I/O is split.1376 !-- The default for files which are opened by all PEs (or where each1377 !-- PE opens his own independent file) is, that all PEs are doing input/output1378 !-- in parallel at the same time. This might cause performance or even more1379 !-- severe problems depending on the configuration of the underlying file1380 !-- system.1381 !-- First, set the default:1382 IF ( maximum_parallel_io_streams == -1 .OR. &1383 maximum_parallel_io_streams > numprocs ) THEN1384 maximum_parallel_io_streams = numprocs1385 ENDIF1386 1387 !1388 !-- Now calculate the number of io_blocks and the io_group to which the1389 !-- respective PE belongs. I/O of the groups is done in serial, but in parallel1390 !-- for all PEs belonging to the same group. A preliminary setting with myid1391 !-- based on MPI_COMM_WORLD has been done in parin.1392 io_blocks = numprocs / maximum_parallel_io_streams1393 io_group = MOD( myid+1, io_blocks )1394 1395 1396 1376 END SUBROUTINE init_pegrid -
palm/trunk/SOURCE/parin.f90
r2599 r2600 25 25 ! ----------------- 26 26 ! $Id$ 27 ! some comments added and variables renamed concerning r2599 28 ! 29 ! 2599 2017-11-01 13:18:45Z hellstea 27 30 ! The i/o grouping is updated to work correctly also in nested runs. 28 31 ! … … 391 394 IMPLICIT NONE 392 395 393 INTEGER(iwp) :: i !<394 INTEGER(iwp) :: ioerr !< error flag for open/read/write395 INTEGER(iwp) :: myworldid!<396 INTEGER(iwp) :: numworldprocs !<396 INTEGER(iwp) :: global_id !< process id with respect to MPI_COMM_WORLD 397 INTEGER(iwp) :: global_procs !< # of procs with respect to MPI_COMM_WORLD 398 INTEGER(iwp) :: i !< 399 INTEGER(iwp) :: ioerr !< error flag for open/read/write 397 400 398 401 NAMELIST /inipar/ aerosol_bulk, alpha_surface, approximation, bc_e_b, & … … 524 527 !-- severe problems depending on the configuration of the underlying file 525 528 !-- system. 529 !-- Calculation of the number of blocks and the I/O group must be based on all 530 !-- PEs involved in this run. Since myid and numprocs are related to the 531 !-- comm2d communicator, which gives only a subset of all PEs in case of 532 !-- nested runs, that information must be inquired again from the global 533 !-- communicator. 526 534 !-- First, set the default: 527 CALL MPI_COMM_RANK( MPI_COMM_WORLD, myworldid, ierr )528 CALL MPI_COMM_SIZE( MPI_COMM_WORLD, numworldprocs, ierr )535 CALL MPI_COMM_RANK( MPI_COMM_WORLD, global_id, ierr ) 536 CALL MPI_COMM_SIZE( MPI_COMM_WORLD, global_procs, ierr ) 529 537 IF ( maximum_parallel_io_streams == -1 .OR. & 530 maximum_parallel_io_streams > numworldprocs ) THEN531 maximum_parallel_io_streams = numworldprocs538 maximum_parallel_io_streams > global_procs ) THEN 539 maximum_parallel_io_streams = global_procs 532 540 ENDIF 533 541 ! … … 535 543 !-- respective PE belongs. I/O of the groups is done in serial, but in parallel 536 544 !-- for all PEs belonging to the same group. 537 !-- These settings are repeated in init_pegrid for the communicator comm2d, 538 !-- which is not available here 539 !io_blocks = numprocs / maximum_parallel_io_streams 540 io_blocks = numworldprocs / maximum_parallel_io_streams 541 !io_group = MOD( myid+1, io_blocks ) 542 io_group = MOD( myworldid+1, io_blocks ) 545 io_blocks = global_procs / maximum_parallel_io_streams 546 io_group = MOD( global_id+1, io_blocks ) 543 547 544 548 CALL location_message( 'reading NAMELIST parameters from PARIN', .FALSE. )
Note: See TracChangeset
for help on using the changeset viewer.