Changeset 479


Ignore:
Timestamp:
06/09/11 08:09:35 (13 years ago)
Author:
mafoipsl
Message:

Modification for vargas :

  • add the possibility to postpone rebuild jobs when ulam is down. SUBMIT_DIR/POSTPONE directory is used to store temporary rebuild jobs.
  • correct cds to stay into RUN_DIR for the end of the running job (delete of boundary files, cleaning, ...)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh

    r476 r479  
    165165        echo "IGCM_sys_RshPost :" $@ 
    166166    fi 
    167     rsh ulam exec /bin/ksh ${@} 
    168     if [ $? -gt 0 ] ; then 
    169         echo "IGCM_sys_RshPost : erreur." 
    170         IGCM_debug_Exit "IGCM_sys_RshPost" 
     167 
     168    # keep standard input to keep it for postpone if ulam don't answer 
     169    cat >/tmp/tmp_IGCM_sys_RshPost_$$ 
     170 
     171    ## Add submission for old postponed files only if command is a Qsub 
     172    ## 
     173    ISITQSUB=0 
     174    grep Qsub /tmp/tmp_IGCM_sys_RshPost_$$ >/dev/null 2>&1 && ISITQSUB=1 
     175    if  ( [ ${ISITQSUB} -gt 0 ] ) ; then  
     176      if [ -d ${SUBMIT_DIR}/POSTPONE ] ; then 
     177            for postponed_file in ${SUBMIT_DIR}/POSTPONE/* ; do  
     178              if [ -f ${postponed_file} ] ; then 
     179                IGCM_debug_Print 2 " submit postponed file : " ${postponed_file} 
     180                rsh ulam exec /bin/ksh <${postponed_file} 
     181                if [ $? -eq 0 ] ; then 
     182                     IGCM_sys_Rm ${postponed_file} 
     183                else 
     184                     IGCM_debug_Print 2 "keep postponed file for an other submission :" ${postponed_file} 
     185                fi 
     186              fi 
     187          done 
     188      fi 
     189    fi 
     190 
     191    RETURN=0 
     192    # rsh ulam command 
     193    rsh ulam exec /bin/ksh </tmp/tmp_IGCM_sys_RshPost_$$ 
     194    RETURN=$? 
     195 
     196    # keep standard input for postpone if ulam don't answer 
     197    if ( [ ${RETURN} -gt 0 ] ) ; then 
     198        IGCM_debug_Print 2 "Postpone tmp_IGCM_sys_RshPost_$$" 
     199        [ -d ${SUBMIT_DIR}/POSTPONE ] || mkdir ${SUBMIT_DIR}/POSTPONE 
     200        mv /tmp/tmp_IGCM_sys_RshPost_$$ ${SUBMIT_DIR}/POSTPONE 
    171201    fi 
    172202    IGCM_debug_PopStack "IGCM_sys_RshPost" 
     
    469499    sed -e "s/\# \@ output *= .*/\# \@ output = ${Script_Output}/" -e "s/\# \@ error *= .*/\# \@ error = ${Script_Output}/" <$1 >${REP_FOR_JOB}/JOB_FOR_IGCM 
    470500    { 
    471       [ ${#@} = 1 ] &&  { cd $LOADL_STEP_INITDIR ; /usr/local/bin/llsubmit ${REP_FOR_JOB}/JOB_FOR_IGCM ; ERROR=$? ; cd - ; } 
    472       [ ${#@} = 2 ] &&  { cd $2 ; /usr/local/bin/llsubmit ${REP_FOR_JOB}/JOB_FOR_IGCM ; ERROR=$? ; cd - ; } 
     501       [ ${#@} = 1 ] &&  ( cd $LOADL_STEP_INITDIR ; /usr/local/bin/llsubmit JOB_FOR_IGCM ; ERROR=$? ; cd - ; ) 
     502       [ ${#@} = 2 ] &&  ( cd $2 ; /usr/local/bin/llsubmit JOB_FOR_IGCM ; ERROR=$? ; cd - ; ) 
    473503    } 
    474504    if [ ${ERROR} -gt 0 ] ; then 
Note: See TracChangeset for help on using the changeset viewer.