Changeset 481


Ignore:
Timestamp:
06/09/11 10:22:34 (13 years ago)
Author:
mafoipsl
Message:

Modification for brodie (copied from vargas and not tested yet) :

  • add the possibility to postpone rebuild jobs when ulam is down. SUBMIT_DIR/POSTPONE directory is used to store temporary rebuild jobs.
File:
1 edited

Legend:

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

    r453 r481  
    164164        echo "IGCM_sys_RshPost :" $@ 
    165165    fi 
    166     rsh ulam exec /bin/ksh ${@} 
    167     if [ $? -gt 0 ] ; then 
    168         echo "IGCM_sys_RshPost : erreur." 
    169         IGCM_debug_Exit "IGCM_sys_RshPost" 
     166 
     167    # keep standard input to keep it for postpone if ulam don't answer 
     168    cat >/tmp/tmp_IGCM_sys_RshPost_$$ 
     169 
     170    ## Add submission for old postponed files only if command is a Qsub 
     171    ## 
     172    ISITQSUB=0 
     173    grep Qsub /tmp/tmp_IGCM_sys_RshPost_$$ >/dev/null 2>&1 && ISITQSUB=1 
     174    if  ( [ ${ISITQSUB} -gt 0 ] ) ; then 
     175      if [ -d ${SUBMIT_DIR}/POSTPONE ] ; then 
     176            for postponed_file in ${SUBMIT_DIR}/POSTPONE/* ; do 
     177              if [ -f ${postponed_file} ] ; then 
     178                IGCM_debug_Print 2 " submit postponed file : " ${postponed_file} 
     179                rsh ulam exec /bin/ksh <${postponed_file} 
     180                if [ $? -eq 0 ] ; then 
     181                     IGCM_sys_Rm ${postponed_file} 
     182                else 
     183                     IGCM_debug_Print 2 "keep postponed file for an other submission :" ${postponed_file} 
     184                fi 
     185              fi 
     186          done 
     187      fi 
     188    fi 
     189 
     190    RETURN=0 
     191    # rsh ulam command 
     192    rsh ulam exec /bin/ksh </tmp/tmp_IGCM_sys_RshPost_$$ 
     193    RETURN=$? 
     194 
     195    # keep standard input for postpone if ulam don't answer 
     196    if ( [ ${RETURN} -gt 0 ] ) ; then 
     197        IGCM_debug_Print 2 "Postpone tmp_IGCM_sys_RshPost_$$" 
     198        [ -d ${SUBMIT_DIR}/POSTPONE ] || mkdir ${SUBMIT_DIR}/POSTPONE 
     199        mv /tmp/tmp_IGCM_sys_RshPost_$$ ${SUBMIT_DIR}/POSTPONE 
    170200    fi 
    171201    IGCM_debug_PopStack "IGCM_sys_RshPost" 
     202 
    172203} 
    173204 
Note: See TracChangeset for help on using the changeset viewer.