Ignore:
Timestamp:
Feb 20, 2013 2:15:53 AM (12 years ago)
Author:
raasch
Message:

small bugfixes; mrun and subjob scripts are made bash compatible; further adjustments for lckyuh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/mrun

    r1102 r1103  
    1 #!/bin/bash
     1#!/bin/ksh
    22
    33# mrun - script for running PALM jobs
     
    2222# Current revisions:
    2323# ------------------
    24 #
     24# default script runs again under ksh, because of unsolved problems with read
     25# from stdin: when bash script is called from a ksh, message "read error: 0:
     26# Resource temporarily unavailable" appears and script does not stop,
     27# further bash compatibility adjustments,
     28# shebang line replaced by /bin/bash when running jobs on lckyuh; no restarts
     29# on lckyuh, but mrun does not terminate and issues a warning instead
    2530#
    2631# Former revisions:
     
    151156 if [[ `hostname` = rte10 ]]
    152157 then
    153    return_addres=133.5.185.60
    154    echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"
     158    return_addres=133.5.185.60
     159    echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"
    155160 elif [[ `hostname` = climate0 ]]
    156161 then
    157    return_addres=165.132.26.68
    158    echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"
     162    return_addres=165.132.26.68
     163    echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"
    159164 elif [[ `hostname` = urban00 ]]
    160165 then
    161    return_addres=147.46.30.151
    162    echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"
     166    return_addres=147.46.30.151
     167    echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!"
    163168 else
    164169    return_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
     
    14941499
    14951500             # QUELLTEXT-DATEI DARF KEINE PFADE BEINHALTEN
    1496           if [[ $(print $filename | grep -c "/") != 0 ]]
     1501          if [[ $(echo $filename | grep -c "/") != 0 ]]
    14971502          then
    14981503             printf "\n  +++ source code file:  $filename"
     
    25992604    fi
    26002605 else
    2601     printf "\n\n  +++ skipping parameter file check due to following reason: $reason"
     2606    printf "\n\n  +++ skipping parameter file check due to following reason: $reason \n"
    26022607 fi
    26032608
     
    45774582             then
    45784583                ssh $SSH_PORTOPT $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc "
     4584             elif [[ $localhost = lckyuh ]]
     4585             then
     4586                printf "\n  +++ WARNING: no restart mechanism available for host \"$localhost\" "
     4587                printf "\n               please restart job manually using command:\n"
     4588                printf "\n               \"$mc\" "
    45794589             else
    45804590                eval  $mc                # ' MUESSEN AUSGEWERTET WERDEN
     
    45824592             cd -  > /dev/null
    45834593          fi
    4584           printf "\n$striche\n  *** restart-run initiated \n"
     4594          if [[ $localhost = lckyuh ]]
     4595          then
     4596             printf "\n$striche\n  *** restart-run to be initiated manually\n"
     4597          else
     4598             printf "\n$striche\n  *** restart-run initiated \n"
     4599          fi
    45854600
    45864601
     
    48014816          # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN
    48024817       echo  "cat > $mrun_script_name <<\"%END%\""  >>  $jobfile
    4803        cat   ${PALM_BIN}/$mrun_script_name          >>  $jobfile
     4818       if [[ $host = lckyuh ]]
     4819       then
     4820          sed 's/\/bin\/ksh/\/bin\/bash/g' ${PALM_BIN}/$mrun_script_name  >>  $jobfile
     4821       else
     4822          cat  ${PALM_BIN}/$mrun_script_name        >>  $jobfile
     4823       fi
    48044824       echo  "%END%"                                >>  $jobfile
    48054825       echo  "chmod u+x $mrun_script_name"          >>  $jobfile
Note: See TracChangeset for help on using the changeset viewer.