Changeset 437


Ignore:
Timestamp:
04/06/11 17:16:38 (13 years ago)
Author:
sdipsl
Message:

Send mail notification when computing job stops
It could be that we send a notification if a post-processing job stops in PROD mode ---> need some refactoring and caution...

Location:
trunk/libIGCM
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_job

    r436 r437  
    276276# Test if all was right before proceeding further 
    277277# ------------------------------------------------------------------ 
    278 IGCM_debug_Verif_Exit_Post 
    279  
    280 #D- 
    281 # ------------------------------------------------------------------ 
    282 #D- Test if all was right before proceeding further 
    283 # ------------------------------------------------------------------ 
    284278IGCM_debug_Verif_Exit 
    285279 
  • trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh

    r409 r437  
    207207            echo 
    208208        fi 
     209        # Mail notification 
     210        IGCM_sys_SendMail 
     211        # And Good Bye 
    209212        date 
    210213        exit 1 
     
    228231                echo 
    229232            fi 
     233            # Mail notification 
     234            #IGCM_sys_SendMail 
     235            # And Good Bye 
    230236            date 
    231237            exit 1 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh

    r434 r437  
    183183    fi 
    184184 
    185     cat  << END_MAIL > job_end.mail 
     185    if ( ${ExitFlag} ) ; then 
     186        status=FAILED 
     187        cat  << END_MAIL > job_end.mail 
     188Dear ${LOGIN}, 
     189 
     190  Simulation ${config_UserChoices_JobName} failed on supercomputer `hostname`. 
     191  Job started : ${PeriodDateBegin} 
     192  Job ended   : ${PeriodDateEnd} 
     193  Output files are available in ${R_SAVE} 
     194  Script files, Script Outputs and Debug files are available in ${SUBMIT_DIR} 
     195END_MAIL 
     196    else 
     197        status=COMPLETED 
     198        cat  << END_MAIL > job_end.mail 
    186199Dear ${LOGIN}, 
    187200 
     
    193206END_MAIL 
    194207 
     208    fi 
     209 
    195210    if [ X${config_UserChoices_MailName} != X ] ; then 
    196         mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail 
     211        mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
    197212    elif [ -f ~/.forward ] ; then 
    198         mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail 
     213        mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
    199214    else 
    200         mailx -s "${config_UserChoices_JobName} completed" ${USER} < job_end.mail 
     215        mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail 
    201216    fi 
    202217 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh

    r434 r437  
    252252       mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail 
    253253    fi 
    254  
    255254    sleep 10 
    256255    rm -f job_end.mail 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh

    r434 r437  
    214214    fi 
    215215 
    216     cat  << END_MAIL > job_end.mail 
     216    if ( ${ExitFlag} ) ; then 
     217        status=FAILED 
     218        cat  << END_MAIL > job_end.mail 
     219Dear ${LOGIN}, 
     220 
     221  Simulation ${config_UserChoices_JobName} failed on supercomputer `hostname`. 
     222  Job started : ${PeriodDateBegin} 
     223  Job ended   : ${PeriodDateEnd} 
     224  Output files are available in ${R_SAVE} 
     225  Script files, Script Outputs and Debug files are available in ${SUBMIT_DIR} 
     226END_MAIL 
     227    else 
     228        status=COMPLETED 
     229        cat  << END_MAIL > job_end.mail 
    217230Dear ${LOGIN}, 
    218231 
     
    223236  Script files and Script Outputs are available in ${SUBMIT_DIR} 
    224237END_MAIL 
     238    fi 
    225239 
    226240    if [ ! -z ${config_UserChoices_MailName} ] ; then 
    227         mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail 
     241        mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
    228242    elif [ -f ~/.forward ] ; then 
    229         mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail 
     243        mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
    230244    fi 
    231245 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh

    r428 r437  
    201201        echo "IGCM_sys_SendMail :" $@ 
    202202    fi 
    203     cat  << END_MAIL > job_end.mail 
     203 
     204    if ( ${ExitFlag} ) ; then 
     205        status=FAILED 
     206        cat  << END_MAIL > job_end.mail 
     207Dear ${LOGIN}, 
     208 
     209  Simulation ${config_UserChoices_JobName} failed on supercomputer `hostname`. 
     210  Job started : ${PeriodDateBegin} 
     211  Job ended   : ${PeriodDateEnd} 
     212  Output files are available in ${R_SAVE} 
     213  Script files, Script Outputs and Debug files are available in ${SUBMIT_DIR} 
     214END_MAIL 
     215    else 
     216        status=COMPLETED 
     217        cat  << END_MAIL > job_end.mail 
    204218Dear ${LOGIN}, 
    205219 
     
    210224  Script files and Script Outputs are available in ${SUBMIT_DIR} 
    211225END_MAIL 
     226    fi 
    212227 
    213228    if [ ! -z ${config_UserChoices_MailName} ] ; then 
    214         mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail 
     229        mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
    215230    elif [ -f ~/.forward ] ; then 
    216         mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail 
     231        mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
    217232    else 
    218         mailx -s "${config_UserChoices_JobName} completed" ${USER} < job_end.mail 
     233        mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail 
    219234    fi 
    220235 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex8.ksh

    r434 r437  
    228228    fi 
    229229 
    230     ssh mercure /bin/ksh <<-EOF 
     230    if ( ${ExitFlag} ) ; then 
     231        status=FAILED 
     232        # Nothing fo now 
     233    else 
     234        status=COMPLETED 
     235        ssh mercure /bin/ksh <<-EOF 
    231236    export LOGIN=${LOGIN} 
    232237    export config_UserChoices_JobName=${config_UserChoices_JobName} 
     
    256261    rm -f job_end.mail 
    257262EOF 
     263    fi 
    258264 
    259265    if [ $? -gt 0 ] ; then 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh

    r434 r437  
    236236    fi 
    237237 
    238     cat  << END_MAIL > job_end.mail 
     238    if ( ${ExitFlag} ) ; then 
     239        status=FAILED 
     240        cat  << END_MAIL > job_end.mail 
     241Dear ${LOGIN}, 
     242 
     243  Simulation ${config_UserChoices_JobName} failed on supercomputer `hostname`. 
     244  Job started : ${PeriodDateBegin} 
     245  Job ended   : ${PeriodDateEnd} 
     246  Output files are available in ${R_SAVE} 
     247  Script files, Script Outputs and Debug files are available in ${SUBMIT_DIR} 
     248END_MAIL 
     249    else 
     250        status=COMPLETED 
     251        cat  << END_MAIL > job_end.mail 
    239252Dear ${LOGIN}, 
    240253 
     
    245258  Script files and Script Outputs are available in ${SUBMIT_DIR} 
    246259END_MAIL 
     260    fi 
    247261 
    248262    if  [ X"${config_UserChoices_MailName}" != X ] ; then 
    249        mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail 
     263       mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
    250264    elif [ -f ~/.forward ] ; then 
    251        mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail 
     265       mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
    252266    else 
    253        mailx -s "${config_UserChoices_JobName} completed" ${LOGIN} < job_end.mail 
     267       mailx -s "${config_UserChoices_JobName} ${status}" ${LOGIN} < job_end.mail 
    254268    fi 
    255269 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh

    r434 r437  
    230230    fi 
    231231 
    232     cat  << END_MAIL > job_end.mail 
     232    if ( ${ExitFlag} ) ; then 
     233        status=FAILED 
     234        cat  << END_MAIL > job_end.mail 
     235Dear ${LOGIN}, 
     236 
     237  Simulation ${config_UserChoices_JobName} failed on supercomputer `hostname`. 
     238  Job started : ${PeriodDateBegin} 
     239  Job ended   : ${PeriodDateEnd} 
     240  Output files are available in ${R_SAVE} 
     241  Script files, Script Outputs and Debug files are available in ${SUBMIT_DIR} 
     242END_MAIL 
     243    else 
     244        status=COMPLETED 
     245        cat  << END_MAIL > job_end.mail 
    233246Dear ${LOGIN}, 
    234247 
     
    239252  Script files and Script Outputs are available in ${SUBMIT_DIR} 
    240253END_MAIL 
     254    fi 
    241255 
    242256    if [ ! -z ${config_UserChoices_MailName} ] ; then 
    243         mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail 
     257        mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
    244258    elif [ -f ~/.forward ] ; then 
    245         mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail 
     259        mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
    246260    fi 
    247261 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh

    r434 r437  
    224224       echo "IGCM_sys_SendMail :" $@ 
    225225    fi 
    226     cat  << END_MAIL > job_end.mail 
     226 
     227    if ( ${ExitFlag} ) ; then 
     228        status=FAILED 
     229        cat  << END_MAIL > job_end.mail 
     230Dear ${LOGIN}, 
     231 
     232  Simulation ${config_UserChoices_JobName} failed on supercomputer `hostname`. 
     233  Job started : ${PeriodDateBegin} 
     234  Job ended   : ${PeriodDateEnd} 
     235  Output files are available in ${R_SAVE} 
     236  Script files, Script Outputs and Debug files are available in ${SUBMIT_DIR} 
     237END_MAIL 
     238    else 
     239        status=COMPLETED 
     240        cat  << END_MAIL > job_end.mail 
    227241Dear ${LOGIN}, 
    228242 
     
    233247  Script files and Script Outputs are available in ${SUBMIT_DIR} 
    234248END_MAIL 
     249    fi 
    235250 
    236251    if [ ! -z ${config_UserChoices_MailName} ] ; then 
    237         mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} < job_end.mail 
     252        mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < job_end.mail 
    238253    elif [ -f ~/.forward ] ; then 
    239         mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail 
     254        mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
    240255    fi 
    241256 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh

    r434 r437  
    252252    fi 
    253253 
    254     IGCM_sys_RshPost <<-EOF 
     254    if ( ${ExitFlag} ) ; then 
     255        status=FAILED 
     256        # Nothing more at this point of time 
     257    else 
     258        status=COMPLETED 
     259        IGCM_sys_RshPost <<-EOF 
    255260    export LOGIN=${LOGIN} 
    256261    export config_UserChoices_JobName=${config_UserChoices_JobName} 
     
    280285    rm -f job_end.mail 
    281286EOF 
     287    fi 
    282288 
    283289    if [ $? -gt 0 ] ; then 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh

    r434 r437  
    183183        echo "IGCM_sys_SendMail :" $@ 
    184184    fi 
    185     cat  << END_MAIL > job_end.mail 
     185 
     186    if ( ${ExitFlag} ) ; then 
     187        status=FAILED 
     188        cat  << END_MAIL > job_end.mail 
     189Dear ${LOGIN}, 
     190 
     191  Simulation ${config_UserChoices_JobName} failed on supercomputer `hostname`. 
     192  Job started : ${PeriodDateBegin} 
     193  Job ended   : ${PeriodDateEnd} 
     194  Output files are available in ${R_SAVE} 
     195  Script files, Script Outputs and Debug files are available in ${SUBMIT_DIR} 
     196END_MAIL 
     197    else 
     198        status=COMPLETED 
     199        cat  << END_MAIL > job_end.mail 
    186200Dear ${LOGIN}, 
    187201 
     
    192206  Script files and Script Outputs are available in ${SUBMIT_DIR} 
    193207END_MAIL 
     208    fi 
    194209 
    195210    if [ ! -z ${config_UserChoices_MailName} ] ; then 
    196         mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail 
     211        mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
    197212    elif [ -f ~/.forward ] ; then 
    198         mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail 
     213        mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
    199214    else 
    200         mailx -s "${config_UserChoices_JobName} completed" ${USER} < job_end.mail 
     215        mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail 
    201216    fi 
    202217 
Note: See TracChangeset for help on using the changeset viewer.