Changeset 442


Ignore:
Timestamp:
04/08/11 14:40:35 (13 years ago)
Author:
sdipsl
Message:

Some update needed for the DRYRUN

Location:
trunk/libIGCM/libIGCM_sys
Files:
2 edited

Legend:

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

    r440 r442  
    11191119            echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 
    11201120            IGCM_debug_Exit "IGCM_sys_Get" 
    1121             #IGCM_debug_PopStack "IGCM_sys_Get" 
    1122             #return 
    11231121        fi 
    11241122 
     
    11281126            echo "WARNING IGCM_sys_Get : demigration error." 
    11291127            cat out_rsync 
    1130             #IGCM_debug_Exit "IGCM_sys_Get" 
    1131             #IGCM_debug_PopStack "IGCM_sys_Get" 
    1132             #return 
     1128            IGCM_debug_Exit "IGCM_sys_Get" 
    11331129        fi 
    11341130 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh

    r438 r442  
    195195 
    196196#D-#================================================== 
     197#D-function IGCM_sys_SendMail 
     198#D-* Purpose: Send mail when simulation is over 
     199#D-* Examples: 
     200#D- 
     201function IGCM_sys_SendMail { 
     202    IGCM_debug_PushStack "IGCM_sys_SendMail" $@ 
     203    if ( $DEBUG_sys ) ; then 
     204        echo "IGCM_sys_SendMail :" $@ 
     205    fi 
     206 
     207    if ( ${ExitFlag} ) ; then 
     208        status=FAILED 
     209        cat  << END_MAIL > job_end.mail 
     210Dear ${LOGIN}, 
     211 
     212  Simulation ${config_UserChoices_JobName} failed on supercomputer `hostname`. 
     213  Job started : ${PeriodDateBegin} 
     214  Job ended   : ${PeriodDateEnd} 
     215  Output files are available in ${R_SAVE} 
     216  Script files, Script Outputs and Debug files are available in ${SUBMIT_DIR} 
     217END_MAIL 
     218    else 
     219        status=COMPLETED 
     220        cat  << END_MAIL > job_end.mail 
     221Dear ${LOGIN}, 
     222 
     223  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`. 
     224  Job started : ${DateBegin} 
     225  Job ended   : ${DateEnd} 
     226  Output files are available in ${R_SAVE} 
     227  Script files and Script Outputs are available in ${SUBMIT_DIR} 
     228END_MAIL 
     229    fi 
     230 
     231    if  [ X"${config_UserChoices_MailName}" != X ] ; then 
     232       mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
     233    elif [ -f ~/.forward ] ; then 
     234       mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
     235    else 
     236       mailx -s "${config_UserChoices_JobName} ${status}" ${LOGIN} < job_end.mail 
     237    fi 
     238 
     239    if [ $? -gt 0 ] ; then 
     240        echo "IGCM_sys_SendMail : erreur." 
     241        IGCM_debug_Exit "IGCM_sys_SendMail" 
     242    fi 
     243    IGCM_debug_PopStack "IGCM_sys_SendMail" 
     244} 
     245 
     246#D-#================================================== 
    197247#D-function IGCM_sys_Mkdir 
    198248#D-* Purpose: Master locale mkdir command 
     
    791841 
    792842#D-#================================================== 
     843#D-function IGCM_sys_Put_Rest 
     844#D-* Purpose: Put computied restarts on $(ARCHIVE). 
     845#D-           File and target directory must exist. 
     846#D-* Examples: 
     847#D- 
     848function IGCM_sys_Put_Rest { 
     849    IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@ 
     850    if ( $DEBUG_sys ) ; then 
     851        echo "IGCM_sys_Put_Rest :" $@ 
     852    fi 
     853    if [ $DRYRUN = 0 ]; then 
     854        if [ ! -f ${1} ] ; then 
     855            echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     856            IGCM_debug_Exit "IGCM_sys_Put_Rest" 
     857        fi 
     858 
     859        typeset RET 
     860        # 
     861        if [ X${JobType} = XRUN ] ; then 
     862            IGCM_sys_Chmod 444 ${1} 
     863        fi 
     864        # 
     865        IGCM_sys_TestDirArchive $( dirname $2 ) 
     866        # 
     867        # USUAL WAY 
     868        putfer $1 $2 > out_rsync 2>&1 
     869        RET=$? 
     870 
     871#       #RSYNC WITH NETWORK SSH CALL 
     872#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1 
     873#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1 
     874 
     875#       #RSYNC WITH NFS USE 
     876#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 
     877#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 
     878 
     879#       RET=$? 
     880#       IGCM_sys_Rsync_out $RET 
     881 
     882#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
     883#       (( RET=RET+$? )) 
     884 
     885        if [ ${RET} -gt 0 ] ; then 
     886            echo "IGCM_sys_Put_Rest : error." 
     887            cat out_rsync 
     888            IGCM_debug_Exit "IGCM_sys_Put_Rest" 
     889        else 
     890            \rm out_rsync 
     891        fi 
     892    else 
     893        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 
     894    fi 
     895    IGCM_debug_PopStack "IGCM_sys_Put_Rest" 
     896} 
     897 
     898#D-#================================================== 
    793899#D-function IGCM_sys_Put_Out 
    794900#D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly 
Note: See TracChangeset for help on using the changeset viewer.