Changeset 206 for palm/trunk/SCRIPTS/mrun
- Timestamp:
- Oct 13, 2008 2:59:11 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/mrun
r204 r206 154 154 # 08/08/08 - Marcus - typo removed in lcxt4 branch 155 155 # 17/09/08 - Siggi - restart mechanism adjusted for lcsgi 156 # 02/10/09 - BjornM - argument "-Y" modified, adjustments for coupled runs 156 157 157 158 # VARIABLENVEREINBARUNGEN + DEFAULTWERTE … … 171 172 cond2="" 172 173 config_file=.mrun.config 174 coupled_dist="" 175 coupled_mode="mpi1" 173 176 cpp_opts="" 174 177 cpp_options="" … … 219 222 node_usage=default 220 223 numprocs="" 224 numprocs_atmos=0 225 numprocs_ocean=0 221 226 OOPT="" 222 227 openmp=false … … 262 267 263 268 typeset -i iec=0 iic=0 iin=0 ioc=0 iout=0 memory=0 stagein_anz=0 stageout_anz=0 264 typeset -i cputime i ii ii iicycle inode ival jobges jobsek maxcycle minuten nodes pes sekunden tp1269 typeset -i cputime i ii iia iii iio icycle inode ival jobges jobsek maxcycle minuten nodes pes sekunden tp1 265 270 266 271 typeset -R30 calltime … … 381 386 # SHELLSCRIPT-OPTIONEN EINLESEN UND KOMMANDO NEU ZUSAMMENSETZEN, FALLS ES 382 387 # FUER FOLGEJOBS BENOETIGT WIRD 383 while getopts :a:AbBc:Cd:D:Fg:G:h:H:i:IkK:m:M:n:o:Op:P:q:r:R:s:St:T:u:U:vxX:Y option388 while getopts :a:AbBc:Cd:D:Fg:G:h:H:i:IkK:m:M:n:o:Op:P:q:r:R:s:St:T:u:U:vxX:Y: option 384 389 do 385 390 case $option in … … 420 425 (x) do_trace=true;set -x; mc="$mc -x";; 421 426 (X) numprocs=$OPTARG; mc="$mc -X$OPTARG";; 422 (Y) run_coupled_model=true; mc="$mc -Y";;427 (Y) run_coupled_model=true; coupled_dist=$OPTARG; mc="$mc -Y'$OPTARG'";; 423 428 (\?) printf "\n +++ unknown option $OPTARG \n" 424 429 printf "\n --> type \"$0 ?\" for available options \n" … … 437 442 then 438 443 (printf "\n *** mrun can be called as follows:\n" 439 printf "\n $mrun_script_name -b -c.. -d.. -D.. -f.. -F -h.. -i.. -I -K.. -m.. -o.. -p.. -r.. -R -s.. -t.. -T.. -v -x -X.. <modus>\n"444 printf "\n $mrun_script_name -b -c.. -d.. -D.. -f.. -F -h.. -i.. -I -K.. -m.. -o.. -p.. -r.. -R -s.. -t.. -T.. -v -x -X.. -Y.. <modus>\n" 440 445 printf "\n Description of available options:\n" 441 446 printf "\n Option Description Default-Value" … … 475 480 printf "\n -x tracing of mrun for debug purposes ---" 476 481 printf "\n -X # of processors (on parallel machines) 1" 477 printf "\n -Y run coupled model ---" 482 printf "\n -Y run coupled model, \"#1 #2\" with" 483 printf "\n #1 atmosphere and #2 ocean processors \"#/2 #/2\" depending on -X" 478 484 printf "\n " 479 485 printf "\n Possible values of positional parameter <modus>:" … … 509 515 while read line 510 516 do 511 if [[ "$line" != "" ||$(echo $line | cut -c1) != "#" ]]517 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 512 518 then 513 519 HOSTNAME=`echo $line | cut -d" " -s -f2` … … 530 536 locat=localhost; exit 531 537 fi 532 533 538 534 539 … … 586 591 do_remote=true 587 592 case $host in 588 (ibm|ibmb|ibmh|ibms|ibmy|nech|neck|lcsgib|lcsgih|lctit|unics ) true;;593 (ibm|ibmb|ibmh|ibms|ibmy|nech|neck|lcsgib|lcsgih|lctit|unics|lcxt4) true;; 589 594 (*) printf "\n" 590 595 printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" … … 609 614 locat=options; exit 610 615 fi 616 fi 617 618 619 # KOPPLUNGSEIGENSCHAFTEN (-Y) AUSWERTEN UND coupled_mode BESTIMMEN 620 if [[ $run_coupled_model = true ]] 621 then 622 623 if [[ -n $coupled_dist ]] 624 then 625 626 numprocs_atmos=`echo $coupled_dist | cut -d" " -s -f1` 627 numprocs_ocean=`echo $coupled_dist | cut -d" " -s -f2` 628 629 if (( $numprocs_ocean + $numprocs_atmos != $numprocs )) 630 then 631 632 printf "\n +++ number of processors does not fit to specification by \"-Y\"." 633 printf "\n PEs (total) : $numprocs" 634 printf "\n PEs (atmosphere): $numprocs_atmos" 635 printf "\n PEs (ocean) : $numprocs_ocean" 636 locat=coupling; exit 637 638 # REARRANGING BECAUSE CURRENTLY ONLY 1:1 TOPOLOGIES ARE SUPPORTED 639 # THIS SHOULD BE REMOVED IN FUTURE 640 elif (( $numprocs_ocean != $numprocs_atmos )) 641 then 642 643 printf "\n +++ currently only 1:1 topologies are supported" 644 printf "\n PEs (total) : $numprocs" 645 printf "\n PEs (atmosphere): $numprocs_atmos" 646 printf "\n PEs (ocean) : $numprocs_ocean" 647 (( numprocs_atmos = $numprocs / 2 )) 648 (( numprocs_ocean = $numprocs / 2 )) 649 printf "\n +++ rearranged topology to $numprocs_atmos:$numprocs_ocean" 650 651 fi 652 653 else 654 655 (( numprocs_ocean = $numprocs / 2 )) 656 (( numprocs_atmos = $numprocs / 2 )) 657 658 fi 659 coupled_dist=`echo "$numprocs_atmos $numprocs_ocean"` 660 661 # GET coupled_mode FROM THE CONFIG FILE 662 line="" 663 grep "%cpp_options.*-D__mpi2.*$host" $config_file > tmp_mrun 664 while read line 665 do 666 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" && ( $(echo $line | cut -d" " -s -f4) = $cond1 || $(echo $line | cut -d" " -s -f4) = $cond2 ) ]] 667 then 668 coupled_mode="mpi2" 669 fi 670 done < tmp_mrun 671 611 672 fi 612 673 … … 705 766 do_remote=true 706 767 case $host in 707 (ibm|ibms|ibmy|lcsgib|lcsgih|lctit|nech|neck|unics ) true;;768 (ibm|ibms|ibmy|lcsgib|lcsgih|lctit|nech|neck|unics|lcxt4) true;; 708 769 (*) printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" 709 770 printf "\n is not available" … … 960 1021 do_remote=true 961 1022 case $host in 962 (ibm|ibmb|ibmh|ibms|ibmy|lcsgib|lcsgih|lctit|nech|neck|unics ) true;;1023 (ibm|ibmb|ibmh|ibms|ibmy|lcsgib|lcsgih|lctit|nech|neck|unics|lcxt4) true;; 963 1024 (*) printf "\n" 964 1025 printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" … … 2867 2928 fi 2868 2929 else 2869 (( iii = ii / 2 )) 2870 echo "atmosphere_to_ocean" > runfile_atmos 2871 echo "ocean_to_atmosphere" > runfile_ocean 2872 2873 printf "\n coupled run ($iii atmosphere, $iii ocean)" 2930 2931 # currently there is no full MPI-2 support on ICE and XT4 2932 (( iia = $numprocs_atmos / $threads_per_task )) 2933 (( iio = $numprocs_ocean / $threads_per_task )) 2934 printf "\n coupled run ($iia atmosphere, $iio ocean)" 2935 printf "\n using $coupled_mode coupling" 2874 2936 printf "\n\n" 2875 2937 2876 if [[ $ host = lcsgih || $host = lcsgib]]2938 if [[ $coupled_mode = "mpi2" ]] 2877 2939 then 2878 2879 mpiexec -n $iii a.out $ROPTS < runfile_atmos & 2880 mpiexec -n $iii a.out $ROPTS < runfile_ocean & 2881 # head -n $iii $PBS_NODEFILE > nodefile_atmos 2882 # echo "--- nodefile_atmos:" 2883 # cat nodefile_atmos 2884 # tail -n $iii $PBS_NODEFILE > nodefile_ocean 2885 # echo "--- nodefile_ocean:" 2886 # cat nodefile_ocean 2887 # export PBS_NODEFILE=${PWD}/nodefile_atmos 2888 # mpiexec_mpt -np $iii ./a.out $ROPTS < runfile_atmos & 2889 # export PBS_NODEFILE=${PWD}/nodefile_ocean 2890 # mpiexec_mpt -np $iii ./a.out $ROPTS < runfile_ocean & 2891 2892 2893 elif [[ $host = lcxt4 ]] 2894 then 2895 aprun -n $iii -N $tasks_per_node a.out < runfile_atmos $ROPTS & 2896 aprun -n $iii -N $tasks_per_node a.out < runfile_ocean $ROPTS & 2940 echo "atmosphere_to_ocean $iia $iio" > runfile_atmos 2941 echo "ocean_to_atmosphere $iia $iio" > runfile_ocean 2942 if [[ $host = lcsgih || $host = lcsgib ]] 2943 then 2944 2945 mpiexec_mpt -np $iia ./palm $ROPTS < runfile_atmos & 2946 mpiexec_mpt -np $iio ./palm $ROPTS < runfile_ocean & 2947 2948 elif [[ $host = lcxt4 ]] 2949 then 2950 2951 aprun -n $iia -N $tasks_per_node a.out < runfile_atmos $ROPTS & 2952 aprun -n $iio -N $tasks_per_node a.out < runfile_ocean $ROPTS & 2953 2954 else 2955 # WORKAROUND BECAUSE mpiexec WITH -env option IS NOT AVAILABLE ON SOME SYSTEMS 2956 mpiexec -machinefile hostfile -n $iia a.out $ROPTS < runfile_atmos & 2957 mpiexec -machinefile hostfile -n $iio a.out $ROPTS < runfile_ocean & 2958 # mpiexec -machinefile hostfile -n $iia -env coupling_mode atmosphere_to_ocean a.out $ROPTS & 2959 # mpiexec -machinefile hostfile -n $iio -env coupling_mode ocean_to_atmosphere a.out $ROPTS & 2960 fi 2961 wait 2962 2897 2963 else 2898 2964 2899 # WORKAROUND BECAUSE mpiexec WITH -env option IS NOT AVAILABLE ON SOME SYSTEMS 2900 mpiexec -machinefile hostfile -n $iii a.out $ROPTS < runfile_atmos & 2901 mpiexec -machinefile hostfile -n $iii a.out $ROPTS < runfile_ocean & 2902 # mpiexec -machinefile hostfile -n $iii -env coupling_mode atmosphere_to_ocean a.out $ROPTS & 2903 # mpiexec -machinefile hostfile -n $iii -env coupling_mode ocean_to_atmosphere a.out $ROPTS & 2965 echo "coupled_run $iia $iio" > runfile_atmos 2966 if [[ $host = lcsgih || $host = lcsgib ]] 2967 then 2968 2969 mpiexec_mpt -np $ii a.out $ROPTS < runfile_atmos 2970 2971 elif [[ $host = lcxt4 ]] 2972 then 2973 2974 aprun -n $ii -N $tasks_per_node a.out < runfile_atmos $ROPTS 2975 2976 fi 2977 wait 2904 2978 fi 2905 wait2906 fi2907 2979 2908 2980 # if [[ $scirocco = true ]] … … 2912 2984 # mpirun -machinefile hostfile -np $ii a.out $ROPTS 2913 2985 # fi 2914 2986 fi 2915 2987 elif [[ $host = decalpha ]] 2916 2988 then … … 3778 3850 [[ $delete_temporary_catalog = false ]] && mrun_com=${mrun_com}" -B" 3779 3851 [[ $node_usage != default && "$(echo $node_usage | cut -c1-3)" != "sla" && $node_usage != novice ]] && mrun_com=${mrun_com}" -n $node_usage" 3780 [[ $run_coupled_model = true ]] && mrun_com=${mrun_com}" -Y "3852 [[ $run_coupled_model = true ]] && mrun_com=${mrun_com}" -Y \"$coupled_dist\"" 3781 3853 if [[ $do_remote = true ]] 3782 3854 then
Note: See TracChangeset
for help on using the changeset viewer.