Changeset 69 for palm/trunk/SCRIPTS/mrun


Ignore:
Timestamp:
Mar 18, 2007 11:44:44 PM (17 years ago)
Author:
raasch
Message:

scripts are running under pdksh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/mrun

    r68 r69  
    1 #!/bin/ksh
     1#!/bin/pdksh
    22
    33##!/home/DSRC/NC/tatuyama/pub/ksh   NEEDED ON NEC AT RIAM !!!!!!!!!!
     
    114114     # 14/03/07 - Siggi  - fimm admitted, revision number added to terminal
    115115     #                     output
     116     # 16/03/07 - Siggi  - adjustments for lctit
    116117
    117118
     
    184185 read_from_config=""
    185186 restart_run=false
    186  return_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
     187# return_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
     188 return_addres=1.2.3.4
    187189 if [[ $return_addres = 130.75.105.158 ]]
    188190 then
     
    246248    # FEHLERBEHANDLUNG
    247249    # BEI EXIT:
    248  trap 'if [[ $locat != localhost ]]
     250 trap 'rm -rf  tmp_mrun
     251       if [[ $locat != localhost ]]
    249252       then
    250253#          if [[ ! -f ${mrun_path}/statistik/mrun_statistik ]]
     
    271274#             fi
    272275#          fi
    273           continue
     276          echo " " > /dev/null
    274277       fi
    275278
     
    308311
    309312    # BEI TERMINAL-BREAK:
    310  trap '[[ $tmpcreate = true ]]  &&  (cd; rm -rf $TEMPDIR)
     313 trap 'rm -rf  tmp_mrun
     314       [[ $tmpcreate = true ]]  &&  (cd; rm -rf $TEMPDIR)
    311315       if [[ -f ~/job_queue/JOBINFO.$QSUB_REQID ]]
    312316       then
     
    520524 if [[ -n $additional_conditions ]]
    521525 then
    522     echo $additional_conditions | cut -d" " -f1-3 | read  cond1  cond2  dummy
    523 #    cond1=`echo $additional_conditions | cut -d" " -f1`
    524 #    cond2=`echo $additional_conditions | cut -d" " -s -f2`
    525 #    dummy=`echo $additional_conditions | cut -d" " -s -f3`
     526#    echo $additional_conditions | cut -d" " -f1-3 | read  cond1  cond2  dummy
     527    cond1=`echo $additional_conditions | cut -d" " -f1`
     528    cond2=`echo $additional_conditions | cut -d" " -s -f2`
     529    dummy=`echo $additional_conditions | cut -d" " -s -f3`
    526530    if [[ -n $dummy ]]
    527531    then
     
    592596             # ZEILE DEFINIERT ENVIRONMENT-VARIABLE
    593597          zeile=$(echo $zeile | cut -c2-)
    594           echo $zeile | cut -d" " -f1-5 | read  var  value  for_host  for_cond1  for_cond2
    595 #          var=`echo $zeile | cut -d" " -f1`
    596 #          value=`echo $zeile | cut -d" " -s -f2`
    597 #          for_host=`echo $zeile | cut -d" " -s -f3`
    598 #          for_cond1=`echo $zeile | cut -d" " -s -f4`
    599 #          for_cond2=`echo $zeile | cut -d" " -s -f5`
     598#          echo $zeile | cut -d" " -f1-5 | read  var  value  for_host  for_cond1  for_cond2
     599          var=`echo $zeile | cut -d" " -f1`
     600          value=`echo $zeile | cut -d" " -s -f2`
     601          for_host=`echo $zeile | cut -d" " -s -f3`
     602          for_cond1=`echo $zeile | cut -d" " -s -f4`
     603          for_cond2=`echo $zeile | cut -d" " -s -f5`
    600604
    601605          if [[ "$for_host" = ""  ||  ( "$for_host" = $host  &&  "$for_cond1" = "$cond1"  &&  "$for_cond2" = "$cond2" )  ||  $(echo "$input_list$output_list"|grep -c "$for_host") != 0 ]]
     
    683687             # s2b: loc    - Feld (optional)
    684688             # s2c: tr/ar  - Feld (optional)
    685           echo $zeile | cut -d" " -f1-2 | read  s1  s2
    686 #          s1=`echo $zeile | cut -d" " -f1`
    687 #          s2=`echo $zeile | cut -d" " -s -f2`
     689#          echo $zeile | cut -d" " -f1-2 | read  s1  s2
     690          s1=`echo $zeile | cut -d" " -f1`
     691          s2=`echo $zeile | cut -d" " -s -f2`
    688692          s2a=$(echo $s2 | cut -d":" -f1)
    689693          if [[ $(echo $s2 | grep -c ":") = 0 ]]
     
    692696             s2c=""
    693697          else
    694              echo $s2 | cut -d":" -f2-3 | sed 's/:/ /g' | read  s2b  s2c
    695 #             s2b=`echo $s2 | cut -d":" -f2 | sed 's/:/ /g'`
    696 #             s2c=`echo $s2 | cut -d":" -s -f3 | sed 's/:/ /g'`
    697           fi
    698           echo $zeile | cut -d" " -f3-6 | read  s3  s4  s5  s6
    699 #          s3=`echo $zeile | cut -d" " -f3`
    700 #          s4=`echo $zeile | cut -d" " -s -f4`
    701 #          s5=`echo $zeile | cut -d" " -s -f5`
    702 #          s6=`echo $zeile | cut -d" " -s -f6`
     698#             echo $s2 | cut -d":" -f2-3 | sed 's/:/ /g' | read  s2b  s2c
     699             s2b=`echo $s2 | cut -d":" -f2 | sed 's/:/ /g'`
     700             s2c=`echo $s2 | cut -d":" -s -f3 | sed 's/:/ /g'`
     701          fi
     702#          echo $zeile | cut -d" " -f3-6 | read  s3  s4  s5  s6
     703          s3=`echo $zeile | cut -d" " -f3`
     704          s4=`echo $zeile | cut -d" " -s -f4`
     705          s5=`echo $zeile | cut -d" " -s -f5`
     706          s6=`echo $zeile | cut -d" " -s -f6`
    703707
    704708       
     
    768772#    esac
    769773
     774
     775       # ENVIRONMENT-VARIABLEN FUER INTERPRET_CONFIG UEBER NAMELIST_DATEI ZUR
     776       # VERFUEGUNG STELLEN
     777    cat  >  .mrun_environment  <<  %%END%%
     778 &mrun_environment  cond1 = '$cond1', cond2 = '$cond2',
     779                    config_file = '$config_file', do_remote = '$do_remote',
     780                    do_trace = '$do_trace', host = '$host',
     781                    input_list = '$input_list', icf = '$interpreted_config_file',
     782                    localhost = '$localhost', output_list = '$output_list' /
     783
     784%%END%%
     785
     786       # WERTE VON MRUN-OPTIONEN SICHERN UND DAMIT GEGEBENENFALLS SPAETER DIE
     787       # IN DER KONFIGURAIONSDATEI ANGEGEBENEN WERTE UEBERSTEUERN
     788    mrun_memory=$memory
     789    mrun_cpumax=$cpumax
     790    mrun_numprocs=$numprocs
     791
    770792    if [[ $localhost_realname = "gate" ]]
    771793    then
     
    779801    export PATH=$PATH:.
    780802    . $interpreted_config_file
    781     rm  $interpreted_config_file
     803#    rm  $interpreted_config_file
     804
     805       # OPTIONSWERTE UEBERSTEUERN KONFIGURATIONSDATEI
     806    [[ "mrun_memory"   != "" ]]  &&  memory=$mrun_memory
     807    [[ "mrun_cpumax"   != "" ]]  &&  cpumax=$mrun_cpumax
     808    [[ "mrun_numprocs" != "" ]]  &&  numprocs=$mrun_numprocs
    782809
    783810 fi
     
    10541081                  fi;;
    10551082     (lctit)      netcdf_support=true
    1056                   netcdf_path=/home2/usr5/mkanda/netcdf-3.6.1;;
     1083                  netcdf_path=/home2/usr5/mkanda/netcdf-3.6.2;;
    10571084     (nech)       netcdf_support=true
    10581085                  netcdf_path=/pool/SX-6/netcdf/netcdf-3.6.0-p1;;
     
    13911418          # ALLE MODIFIZIERTEN QUELLCODEDATEIEN AUFLISTEN
    13921419       Filenames=""
    1393        svn status  |  while  read line
     1420       svn status  >  tmp_mrun
     1421       while  read line
    13941422       do
    13951423          firstc=`echo $line | cut -c1`
     
    14031431             fi
    14041432          fi
    1405        done
     1433       done < tmp_mrun
    14061434
    14071435
     
    18691897       (lcmuk|nech|neck)  FOPTS="-I ${netcdf_path}/include  $FOPTS"
    18701898                          LOPTS="$LOPTS -L${netcdf_path}/lib -lnetcdf";;
    1871        (lctit)            FOPTS="-I ${netcdf_path}/src/f90  $FOPTS"
    1872                           LOPTS="$LOPTS -L${netcdf_path}/src/libsrc -lnetcdf";;
     1899       (lctit)            FOPTS="-I ${netcdf_path}/include  $FOPTS"
     1900                          LOPTS="$LOPTS -L${netcdf_path}/lib -lnetcdf";;
    18731901
    18741902    esac
     
    21752203             # PFADNAMEN FUER DAS MAKE-DEPOSITORY ERMITTELN
    21762204          line=""
    2177           grep "%depository_path" $config_file  |  while read line
     2205          grep "%depository_path" $config_file  >  tmp_mrun
     2206          while read line
    21782207          do
    21792208             if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
     
    21842213                fi
    21852214             fi
    2186           done
     2215          done < tmp_mrun
    21872216
    21882217          line=""
    2189           grep  " $localhost" $config_file | grep "%depository_path"  |  while read line
     2218          grep  " $localhost" $config_file | grep "%depository_path"  >  tmp_mrun
     2219          while read line
    21902220          do
    21912221             if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
     
    21932223                local_depository_path=`echo $line | cut -d" " -s -f2`
    21942224             fi
    2195           done
     2225          done < tmp_mrun
    21962226
    21972227          if [[ "$local_depository_path" = "" ]]
     
    29152945             if [[ "$QUEUE" = interactive ]]
    29162946             then
    2917                 mpirun  -np $numprocs  $runfile  $ROPTS  >  aout_output  2>&1
     2947                mpirun  -np $numprocs  a.out  $ROPTS  >  aout_output  2>&1
    29182948             else
    2919                 n1ge  -fore  -mpi $numprocs  -q $queue  $runfile  $ROPTS  >  aout_output  2>&1
     2949                n1ge  -fore  -mpi $numprocs  -q $queue  a.out  $ROPTS  >  aout_output  2>&1
    29202950             fi
    29212951
     
    38663896
    38673897       # WORKAROUND FUER RIAM-NEC-JOBS WEGEN PROFILE-SCHWIERIGKEITEN
    3868     if [[ $localhost_realname = "gate" ]]
     3898    if [[ $localhost_realname = "gate"  ||  $localhost = lctit ]]
    38693899    then
    38703900       echo  "export PALM_BIN=$PALM_BIN"                >>  $jobfile
Note: See TracChangeset for help on using the changeset viewer.