Ignore:
Timestamp:
May 2, 2012 1:51:44 PM (13 years ago)
Author:
maronga
Message:

bugfixes in parameter file check, adapted for lcxe6 (was lcxt4), new mrun.config parameter %login_init_cmd introduced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/mrun

    r858 r892  
    254254     # 12/03/12 - Siggi  - tasks_per_node divisor check not for lcflow
    255255     # 21/03/12 - Matthias - default compiler on ibmh changed
     256     # 02/05/12 - Bjoern  - lcxt4 is now lcxe6, adjustments for lcxe6,
     257     #                      bugfixes for the parameter file check, initial
     258     #                      commands on ssh calls sourced out to .mrun.config
    256259
    257260
     
    333336 package_list=""
    334337 punkte="..........................................................."
    335  p3d_suffix=""
    336338 queue=none
    337339 read_from_config=""
     
    706708    do_remote=true
    707709    case  $host  in
    708         (ibm|ibmh|ibmkisti|ibmku|ibms|ibmy|nech|necriam|lckyoto|lcsgib|lcsgih|unics|lcxt4|lcxt5m|lck|lckordi)  true;;
     710        (ibm|ibmh|ibmkisti|ibmku|ibms|ibmy|nech|necriam|lckyoto|lcsgib|lcsgih|unics|lcxe6|lcxt5m|lck|lckordi)  true;;
    709711        (*)  printf "\n"
    710712             printf "\n  +++ sorry: execution of batch jobs on remote host \"$host\""
     
    870872                   do_remote=true
    871873                   case  $host  in
    872                        (ibm|ibmh|ibmkisti|ibmku|ibms|ibmy|lckyoto|lcsgib|lcsgih|nech|necriam|unics|lcxt4|lcxt5m|lck|lckordi)  true;;
     874                       (ibm|ibmh|ibmkisti|ibmku|ibms|ibmy|lckyoto|lcsgib|lcsgih|nech|necriam|unics|lcxe6|lcxt5m|lck|lckordi)  true;;
    873875                       (*)  printf "\n  +++ sorry: execution of batch jobs on remote host \"$host\""
    874876                            printf "\n      is not available"
     
    11541156    do_remote=true
    11551157    case  $host  in
    1156         (ibm|ibmh|ibmkisti|ibmku|ibms|ibmy|lckyoto|lcsgib|lcsgih|nech|necriam|unics|lcxt4|lcxt5m|lck|lckordi)  true;;
     1158        (ibm|ibmh|ibmkisti|ibmku|ibms|ibmy|lckyoto|lcsgib|lcsgih|nech|necriam|unics|lcxe6|lcxt5m|lck|lckordi)  true;;
    11571159        (*)  printf "\n"
    11581160             printf "\n  +++ sorry: execution of batch jobs on remote host \"$host\""
     
    13351337       eval filename=${pathin[$i]}/${afname}${endin[$i]}
    13361338    fi
     1339    eval pathname=${pathin[$i]}
     1340
    13371341
    13381342       # PRUEFEN AUF VORHANDENSEIN
     
    20362040 lopts="$lopts $netcdf_lib $dvr_lib"
    20372041 ROPTS="$ropts"
    2038  if [[ ( $(echo $host | cut -c1-3) = nec  ||  $(echo $host | cut -c1-3) = ibm  ||  $host = lckyoto  ||  $host = lcsgih  ||  $host = lcsgib  ||  $host = lctit  ||  $host = lcfimm  ||  $host = lcxt4 ||  $host = lcxt5m || $host = lck || $host = lckordi)  &&  -n $numprocs ]]
     2042 if [[ ( $(echo $host | cut -c1-3) = nec  ||  $(echo $host | cut -c1-3) = ibm  ||  $host = lckyoto  ||  $host = lcsgih  ||  $host = lcsgib  ||  $host = lctit  ||  $host = lcfimm  ||  $host = lcxe6 ||  $host = lcxt5m || $host = lck || $host = lckordi)  &&  -n $numprocs ]]
    20392043 then
    20402044    XOPT="-X $numprocs"
     
    21002104    done
    21012105    mc="$mc -u$remote_username"
     2106 fi
     2107
     2108    # CHECK FOR INITIAL COMMANDS AFTER LOGIN
     2109 if [[ "$login_init_cmd" != "" ]]
     2110 then
     2111    export init_cmds="${login_init_cmd};"
    21022112 fi
    21032113
     
    23782388 if [[ ! -f $check_depository/check_namelist_files.tar || ! -f $PALM_BIN/check_namelist_files.x ]]
    23792389 then
    2380     skip_check=true
    2381 
     2390      skip_check=true
     2391      reason="parameter file check has not been compiled."
     2392 fi
     2393
     2394#CHECK FOR PARALLEL RUN; OTHERWISE SKIP CHECK
     2395 if [[ "$cond1" != "parallel"  &&  "$cond2" != "parallel" ]]
     2396 then
     2397     skip_check=true
     2398     reason="serial run."
    23822399 fi
    23832400
    23842401#ONLY PERFORM CHECK IF -z OPTION IS NOT SET, NO RESTART RUN IS CARRIED OUT AND IF THE EXECUTION HOST IS THE LOCAL HOST
    2385  if [[ $check_namelist_files == false || $fromhost != $localhost || $run_coupled_model == true || $restart_run == true ]]
     2402 if [[ $check_namelist_files == false ]]
     2403 then
     2404     skip_check=true
     2405     reason="-z option set."
     2406 fi
     2407
     2408 if [[ $fromhost != $localhost ]]
     2409 then
     2410     skip_check=true
     2411     reason="submitting host is local host." 
     2412 fi 
     2413
     2414 if [[ $run_coupled_model == true ]]
    23862415 then
    23872416    skip_check=true
    2388  fi
     2417    reason="coupled run." 
     2418 fi
     2419
     2420 if [[ $restart_run == true ]]
     2421 then
     2422    skip_check=true
     2423    reason="restart run."     
     2424
     2425 fi
     2426
     2427#SKIP CHECK IN CASE OF RESTART RUN: CHECK WHETHER THE LAST CHAR IS "f" IN PARIN
     2428 ((last_char = `echo $filename | wc -c` - 1))
     2429 last_char=`echo $filename |cut -c$last_char`
     2430 if [[ "$last_char" == "f" ]]
     2431 then
     2432    skip_check=true
     2433    reason="restart run.)"
     2434 fi
     2435
    23892436 if [[ $skip_check == false ]]
    23902437 then
    2391     if [[ $ocean_file_appendix == true ]]
    2392     then
    2393        d3par_string="d3o#"
    2394        d3fpar_string="d3of"
    2395     else
    2396        d3par_string="d3#"
    2397        d3fpar_string="d3f"
    2398     fi
    23992438
    24002439    tmp_check=${working_directory}/tmp_check
    24012440
    2402 #   GET PARAMETER FILE SUFFIX (USUALLY "_P3D")
     2441#   GET TOPOGRAPHY PARAMETER FILE SUFFIX (USUALLY "_P3DF"). THIS FILE MIGHT IS
     2442#   NOT NECESSARILY REQUIRED
    24032443    line=""
    24042444    found=false
    2405     grep  "$d3par_string" $config_file | grep "PARIN"  >  $tmp_check
     2445    grep  "TOPOGRAPHY_DATA" $config_file  >  $tmp_check
    24062446    while read line1
    24072447    do
     
    24092449       if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
    24102450       then
    2411              # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN
    2412           p3d_suffix=`echo $line | tr -s " " | cut -d" " -s -f5`
    2413           found=true
    2414        fi
    2415     done < $tmp_check
    2416 
    2417     if [[ $found = false ]]
    2418     then
    2419        printf "\n  +++ no PARIN list entry found for $d3par_string in the configuration file."
    2420 
    2421        locat=check_namelist; exit
    2422     fi
    2423 
    2424 #   GET RESTART PARAMETER FILE SUFFIX (USUALLY "_P3DF"). THIS FILE MIGHT IS
    2425 #   NOT NECESSARILY REQUIRED
    2426     line=""
    2427     found=false
    2428     grep  "d3f" $config_file | grep "PARIN"  >  $tmp_check
    2429     while read line1
    2430     do
    2431        line="$line1"
    2432        if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
    2433        then
    2434           p3df_suffix=`echo $line | tr -s " " | cut -d" " -s -f5`
    2435           found=true
    2436        fi
    2437     done < $tmp_check
    2438 
    2439     if [[ $found = false ]]
    2440     then
    2441        printf "\n  +++ no PARIN list entry found for d3f in the configuration file."
    2442     fi
    2443 
    2444 #   GET TOPOGRAPHY PARAMETER FILE SUFFIX (USUALLY "_P3DF"). THIS FILE MIGHT IS
    2445 #   NOT NECESSARILY REQUIRED
    2446     line=""
    2447     found=false
    2448     grep  "d3f" $config_file | grep "TOPOGRAPHY_DATA"  >  $tmp_check
    2449     while read line1
    2450     do
    2451        line="$line1"
    2452        if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
    2453        then
    24542451          topo_suffix=`echo $line | tr -s " " | cut -d" " -s -f5`
    24552452          found=true
     
    24672464    for  item  in  $input_list
    24682465    do
    2469        if [[ "$item" == "restart" || "$item" == d3f || "$item" == d3of ]]
     2466       if [[ "$item" == "restart" ]]
    24702467       then
    24712468          check_restart=1
     
    24762473
    24772474#   ERROR IF NO PARAMETER FILE WAS FOUND, OTHERWISE PROCEED
    2478     if [[ ! -f $working_directory/JOBS/$fname/INPUT/${fname}${p3d_suffix} ]]
    2479     then
    2480        printf "\n\n  +++ ERROR: parameter file (${fname}${p3d_suffix}) not found."
     2475    if [[ ! -f $filename ]]
     2476    then
     2477       printf "\n\n  +++ ERROR: parameter file ($filename) not found."
    24812478       locat=check_namelist; exit
    24822479    fi
     
    24852482    if  [[ $check_restart == 1 ]]
    24862483    then
    2487        if [[ ! -f $working_directory/JOBS/$fname/INPUT/${fname}${p3df_suffix} ]]
    2488        then
    2489           printf "\n\n  +++ WARNING: restart parameter file (${fname}${p3df_suffix}) is missing." 
     2484
     2485
     2486
     2487       filenamef="${filename}f"
     2488       if [[ ! -f $filenamef ]]
     2489       then
     2490          printf "\n\n  +++ WARNING: restart parameter file ($filenamef) is missing." 
    24902491          check_restart=0
    24912492          answer=dummy
     
    25142515    cd $check_sources
    25152516
     2517
    25162518#   CHECK FOR USER CODE, OTHERWISE USE THE PRECOMPILED CHECK_NAMELIST_FILES.X
    2517     if [[ -d $working_directory/USER_CODE/$fname ]]
     2519    if [[ -d $add_source_path ]]
    25182520    then
    25192521       printf "\n\n  *** copying files from $check_depository"
     
    25242526
    25252527       printf "\n\n  *** adding user code."
    2526        cp $working_directory/USER_CODE/$fname/* ./
     2528       cp $add_source_path/* ./
    25272529       touch check_namelist_files.f90
    25282530
     
    25612563    fi
    25622564
    2563     cp $working_directory/JOBS/$fname/INPUT/${fname}${p3d_suffix} ./PARIN
     2565    cp $filename ./PARIN
    25642566    if [[ $check_restart == 1 ]]
    25652567    then
    2566        cp $working_directory/JOBS/$fname/INPUT/${fname}${p3df_suffix} ./PARINF   
    2567     fi
    2568 
    2569 
    2570     if [[ -f $working_directory/JOBS/$fname/INPUT/${fname}${topo_suffix} && $skip_check == false ]]
     2568       cp $filenamef ./PARINF   
     2569    fi
     2570
     2571cat ${pathname}/${fname}${topo_suffix}
     2572    if [[ -f ${pathname}/${fname}${topo_suffix} && $skip_check == false ]]
    25712573    then
    25722574       printf "\n  *** adding topography data"
    2573        cp $working_directory/JOBS/$fname/INPUT/${fname}${topo_suffix} ./TOPOGRAPHY_DATA
     2575       cp ${pathname}/${fname}${topo_suffix} ./TOPOGRAPHY_DATA
    25742576
    25752577#      IN CASE OF TOPOGRAPHY AND HIGH GRID POINT NUMBERS, THE STACK SIZE
     
    26202622
    26212623#      CHECKING THE P3D FILE
    2622        printf "\n\n      (1) checking $fname$p3d_suffix
     2624       printf "\n\n      (1) checking $filename
    26232625       echo "$numprocs 0" > VARIN
    26242626       errors=`./check_namelist_files.x < VARIN 2>&1`
     
    26372639       if [[ $check_restart == 1 && $check_error == false ]]
    26382640       then
    2639           printf "\n\n      (2) checking $fname$p3df_suffix
     2641          printf "\n\n      (2) checking $filenamef
    26402642
    26412643#         FIRST CHECK IF INITIALIZING_ACTIONS="READ_RESTART_DATA" IS SET IN &INIPAR LIST
     
    27112713    fi
    27122714 else
    2713     printf "\n\n  +++ skipping parameter file check\n"
     2715    printf "\n\n  +++ skipping parameter file check due to following reason: $reason"
    27142716 fi
    27152717
     
    27172719 rm -rf  $check_sources
    27182720 cd $working_directory
     2721
    27192722
    27202723    # FALLS AUF DIESER MASCHINE GERECHNET WERDEN SOLL, WERDEN JETZT ENTSPRE-
     
    28762879       if [[ $localhost = nech ]]
    28772880       then
    2878           ssh  136.172.44.192 -l $usern ". /SX/opt/etc/initsx.sh; $module_calls cd \$HOME/work/${usern}.$kennung; sxmake $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" "
     2881#         init_cmds was ". /SX/opt/etc/initsx.sh;"
     2882          ssh  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\" "
    28792883          cp  $TEMPDIR_COMPILE/a.out  .
    28802884          [[ $? != 0 ]]  &&  compile_error=true
     
    28832887       then
    28842888          printf "      compiler is called via ssh on \"plogin1\" \n"
    2885           ssh  plogin1  -l $usern  "export PATH=/sw/ibm/xlf/13.1.0.8/usr/bin:$PATH; $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" "
     2889          ssh  plogin1  -l $usern  "$init_cmds export PATH=/sw/ibm/xlf/13.1.0.8/usr/bin:$PATH; $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" "
    28862890          [[ ! -f a.out ]]  &&  compile_error=true
    28872891          continue   # ANDERENFALLS IST STATUS=1, FALLS A.OUT VORHANDEN
     
    28892893       then
    28902894          printf "      compiler is called via ssh on \"bicegate0\" \n"
    2891           ssh  bicegate0  -l $usern  ". /usr/share/modules/init/bash; $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" "
     2895          ssh  bicegate0  -l $usern  "$init_cmds $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" "
    28922896          [[ ! -f a.out ]]  &&  compile_error=true
    28932897          continue   # ANDERENFALLS IST STATUS=1, FALLS A.OUT VORHANDEN
     
    28952899       then
    28962900          printf "      compiler is called via ssh on \"hicegate0\" \n"
    2897           ssh  hicegate0    -l $usern  ". /usr/share/modules/init/bash; $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" 2>&1 "
     2901          ssh  hicegate0  -l $usern  "$init_cmds $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$fopts\"  LDFLAGS=\"$lopts\" 2>&1 "
    28982902          [[ ! -f a.out ]]  &&  compile_error=true
    28992903          continue   # ANDERENFALLS IST STATUS=1, FALLS A.OUT VORHANDEN
     
    29012905       then
    29022906          printf "      compiler is called via ssh on \"flow\" \n"
    2903           ssh  flow02.hpc.uni-oldenburg.de -l $usern ". /cm/local/apps/environment-modules/3.2.6/Modules/3.2.6/init/bash; echo $MODULEPATH; echo $MODULESHOME; MODULEPATH=/cm/shared/modulefiles/; module load netcdf/intel/64/4.1.3 intel/ics/64/2011.0.013 intel/impi/64/4.0.1.007 hdf5/intel/64/1.8.7; cd $TEMPDIR; make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" "
     2907          ssh  flow02.hpc.uni-oldenburg.de -l $usern "$init_cmds $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" "
    29042908          [[ ! -f a.out ]]  &&  compile_error=true
    29052909          continue   # ANDERENFALLS IST STATUS=1, FALLS A.OUT VORHANDEN
    29062910       else
    2907           [[ $localhost = lcxt4 ]]  &&  . /opt/modules/default/init/ksh
     2911          [[ $localhost = lcxe6 ]]  &&  eval $init_cmds
    29082912          [[ "$module_calls" != "" ]]  &&  eval $module_calls
    29092913          make $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT="$cpp_options"  F90FLAGS="$fopts"  LDFLAGS="$lopts"
     
    37413745                      mpirun -np $tasks_per_node inspxe-cl -r result -collect mi3 -- ./a.out  <  runfile_atmos
    37423746                   fi
    3743                 elif [[ $host = lcxt4  ||  $host = lcxt5m ]]
     3747                elif [[ $host = lcxe6  ||  $host = lcxt5m ]]
    37443748                then
    37453749                    aprun  -n $ii  -N $tasks_per_node  a.out  $ROPTS  < runfile_atmos
     
    37803784                      fi
    37813785
    3782                    elif [[ $host = lcxt4  ||  $host = lcxt5m ]]
     3786                   elif [[ $host = lcxe6  ||  $host = lcxt5m ]]
    37833787                   then
    37843788
     
    38133817                      fi
    38143818
    3815                    elif [[ $host = lcxt4  ||  $host = lcxt5m ]]
     3819                   elif [[ $host = lcxe6  ||  $host = lcxt5m ]]
    38163820                   then
    38173821
Note: See TracChangeset for help on using the changeset viewer.