Changeset 153


Ignore:
Timestamp:
08/14/09 13:02:30 (15 years ago)
Author:
sdipsl
Message:
  • Add generic function to send mail
  • Only one message for now : simulation is finished
  • More to follow (simulation stop too early ...)
Location:
trunk/libIGCM/libIGCM_sys
Files:
8 edited

Legend:

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

    r136 r153  
    173173 
    174174#D-#================================================== 
     175#D-function IGCM_sys_SendMail 
     176#D-* Purpose: Send mail when simulation is over 
     177#D-* Examples: 
     178#D- 
     179function IGCM_sys_SendMail { 
     180    IGCM_debug_PushStack "IGCM_sys_SendMailPost" $@ 
     181    if ( $DEBUG_sys ) ; then 
     182        echo "IGCM_sys_SendMail :" $@ 
     183    fi 
     184 
     185    cat  << END_MAIL > job_atlas.mail 
     186Dear ${LOGIN}, 
     187 
     188  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`. 
     189  Job started : ${DateBegin} 
     190  Job ended   : ${DateEnd} 
     191  Ouput files are available in ${R_SAVE} 
     192END_MAIL 
     193 
     194    if [ ! -z ${config_UserChoices_MailName} ] ; then 
     195        mailx -s "${config_UserChoices_JobName} completed mail" ${config_UserChoices_MailName} <  job_end.mail 
     196    elif [ -f ~/.forward ] ; then 
     197        mailx -s "${config_UserChoices_JobName} completed forward 1" $( cat ~/.forward ) < job_end.mail 
     198    fi 
     199 
     200    if [ $? -gt 0 ] ; then 
     201        echo "IGCM_sys_SendMail : erreur." 
     202        IGCM_debug_Exit "IGCM_sys_SendMail" 
     203    fi 
     204    IGCM_debug_PopStack "IGCM_sys_SendMail" 
     205} 
     206 
     207#D-#================================================== 
    175208#D-function IGCM_sys_Mkdir 
    176209#D-* Purpose: Master locale mkdir command 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_claude.ksh

    r145 r153  
    214214 
    215215#D-#================================================== 
     216#D-function IGCM_sys_SendMail 
     217#D-* Purpose: Send mail when simulation is over 
     218#D-* Examples: 
     219#D- 
     220function IGCM_sys_SendMail { 
     221    IGCM_debug_PushStack "IGCM_sys_SendMailPost" $@ 
     222    if ( $DEBUG_sys ) ; then 
     223        echo "IGCM_sys_SendMail :" $@ 
     224    fi 
     225 
     226    cat  << END_MAIL > job_atlas.mail 
     227Dear ${LOGIN}, 
     228 
     229  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`. 
     230  Job started : ${DateBegin} 
     231  Job ended   : ${DateEnd} 
     232  Ouput files are available in ${R_SAVE} 
     233END_MAIL 
     234 
     235    if [ ! -z ${config_UserChoices_MailName} ] ; then 
     236        mailx -s "${config_UserChoices_JobName} completed mail" ${config_UserChoices_MailName} <  job_end.mail 
     237    elif [ -f ~/.forward ] ; then 
     238        mailx -s "${config_UserChoices_JobName} completed forward 1" $( cat ~/.forward ) < job_end.mail 
     239    fi 
     240 
     241    if [ $? -gt 0 ] ; then 
     242        echo "IGCM_sys_SendMail : erreur." 
     243        IGCM_debug_Exit "IGCM_sys_SendMail" 
     244    fi 
     245    IGCM_debug_PopStack "IGCM_sys_SendMail" 
     246} 
     247 
     248#D-#================================================== 
    216249#D-function IGCM_sys_Mkdir 
    217250#D-* Purpose: Master locale mkdir command 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh

    r145 r153  
    199199 
    200200#D-#================================================== 
     201#D-function IGCM_sys_SendMail 
     202#D-* Purpose: Send mail when simulation is over 
     203#D-* Examples: 
     204#D- 
     205function IGCM_sys_SendMail { 
     206    IGCM_debug_PushStack "IGCM_sys_SendMailPost" $@ 
     207    if ( $DEBUG_sys ) ; then 
     208        echo "IGCM_sys_SendMail :" $@ 
     209    fi 
     210 
     211    cat  << END_MAIL > job_atlas.mail 
     212Dear ${LOGIN}, 
     213 
     214  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`. 
     215  Job started : ${DateBegin} 
     216  Job ended   : ${DateEnd} 
     217  Ouput files are available in ${R_SAVE} 
     218END_MAIL 
     219 
     220    if [ ! -z ${config_UserChoices_MailName} ] ; then 
     221        mailx -s "${config_UserChoices_JobName} completed mail" ${config_UserChoices_MailName} <  job_end.mail 
     222    elif [ -f ~/.forward ] ; then 
     223        mailx -s "${config_UserChoices_JobName} completed forward 1" $( cat ~/.forward ) < job_end.mail 
     224    fi 
     225 
     226    if [ $? -gt 0 ] ; then 
     227        echo "IGCM_sys_SendMail : erreur." 
     228        IGCM_debug_Exit "IGCM_sys_SendMail" 
     229    fi 
     230    IGCM_debug_PopStack "IGCM_sys_SendMail" 
     231} 
     232 
     233#D-#================================================== 
    201234#D-function IGCM_sys_Mkdir 
    202235#D-* Purpose: Master locale mkdir command 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh

    r136 r153  
    170170 
    171171#D-#================================================== 
     172#D-function IGCM_sys_SendMail 
     173#D-* Purpose: Send mail when simulation is over 
     174#D-* Examples: 
     175#D- 
     176function IGCM_sys_SendMail { 
     177    IGCM_debug_PushStack "IGCM_sys_SendMailPost" $@ 
     178    if ( $DEBUG_sys ) ; then 
     179        echo "IGCM_sys_SendMail :" $@ 
     180    fi 
     181 
     182    ssh mercure /bin/ksh <<-EOF 
     183    export LOGIN=${LOGIN} 
     184    export config_UserChoices_JobName=${config_UserChoices_JobName} 
     185    export config_UserChoices_MailName=${config_UserChoices_MailName} 
     186    export DateBegin=${DateBegin} 
     187    export DateEnd=${DateEnd} 
     188    export R_SAVE=${R_SAVE} 
     189 
     190    cat  << END_MAIL > job_end.mail 
     191Dear ${LOGIN}, 
     192 
     193  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`. 
     194  Job started : ${DateBegin} 
     195  Job ended   : ${DateEnd} 
     196  Ouput files are available in ${R_SAVE} 
     197END_MAIL 
     198 
     199    if [ ! -z ${config_UserChoices_MailName} ] ; then 
     200       mailx -s "${config_UserChoices_JobName} completed mail" ${config_UserChoices_MailName} <  job_end.mail 
     201    elif [ -f ~/.forward ] ; then 
     202       mailx -s "${config_UserChoices_JobName} completed forward 1" $( cat ~/.forward ) < job_end.mail 
     203    fi 
     204 
     205    mailx -s "${config_UserChoices_JobName} completed forward 2" $( cat ~/.forward ) < job_end.mail 
     206 
     207    sleep 10 
     208    rm -f job_end.mail 
     209EOF 
     210 
     211    if [ $? -gt 0 ] ; then 
     212        echo "IGCM_sys_SendMail : erreur." 
     213        IGCM_debug_Exit "IGCM_sys_SendMail" 
     214    fi 
     215    IGCM_debug_PopStack "IGCM_sys_SendMail" 
     216} 
     217 
     218#D-#================================================== 
    172219#D-function IGCM_sys_Mkdir 
    173220#D-* Purpose: Master locale mkdir command 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh

    r136 r153  
    170170 
    171171#D-#================================================== 
     172#D-function IGCM_sys_SendMail 
     173#D-* Purpose: Send mail when simulation is over 
     174#D-* Examples: 
     175#D- 
     176function IGCM_sys_SendMail { 
     177    IGCM_debug_PushStack "IGCM_sys_SendMailPost" $@ 
     178    if ( $DEBUG_sys ) ; then 
     179        echo "IGCM_sys_SendMail :" $@ 
     180    fi 
     181 
     182    IGCM_sys_RshPost <<-EOF 
     183    export LOGIN=${LOGIN} 
     184    export config_UserChoices_JobName=${config_UserChoices_JobName} 
     185    export config_UserChoices_MailName=${config_UserChoices_MailName} 
     186    export DateBegin=${DateBegin} 
     187    export DateEnd=${DateEnd} 
     188    export R_SAVE=${R_SAVE} 
     189 
     190    cat  << END_MAIL > job_end.mail 
     191Dear ${LOGIN}, 
     192 
     193  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`. 
     194  Job started : ${DateBegin} 
     195  Job ended   : ${DateEnd} 
     196  Ouput files are available in ${R_SAVE} 
     197END_MAIL 
     198 
     199    if [ ! -z ${config_UserChoices_MailName} ] ; then 
     200       mailx -s "${config_UserChoices_JobName} completed mail" ${config_UserChoices_MailName} <  job_end.mail 
     201    elif [ -f ~/.forward ] ; then 
     202       mailx -s "${config_UserChoices_JobName} completed forward 1" $( cat ~/.forward ) < job_end.mail 
     203    fi 
     204 
     205    mailx -s "${config_UserChoices_JobName} completed forward 2" $( cat ~/.forward ) < job_end.mail 
     206 
     207    sleep 10 
     208    rm -f job_end.mail 
     209EOF 
     210 
     211    if [ $? -gt 0 ] ; then 
     212        echo "IGCM_sys_SendMail : erreur." 
     213        IGCM_debug_Exit "IGCM_sys_SendMail" 
     214    fi 
     215    IGCM_debug_PopStack "IGCM_sys_SendMail" 
     216} 
     217 
     218#D-#================================================== 
    172219#D-function IGCM_sys_Mkdir 
    173220#D-* Purpose: Master locale mkdir command 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh

    r145 r153  
    199199 
    200200#D-#================================================== 
     201#D-function IGCM_sys_SendMail 
     202#D-* Purpose: Send mail when simulation is over 
     203#D-* Examples: 
     204#D- 
     205function IGCM_sys_SendMail { 
     206    IGCM_debug_PushStack "IGCM_sys_SendMailPost" $@ 
     207    if ( $DEBUG_sys ) ; then 
     208        echo "IGCM_sys_SendMail :" $@ 
     209    fi 
     210 
     211    cat  << END_MAIL > job_atlas.mail 
     212Dear ${LOGIN}, 
     213 
     214  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`. 
     215  Job started : ${DateBegin} 
     216  Job ended   : ${DateEnd} 
     217  Ouput files are available in ${R_SAVE} 
     218END_MAIL 
     219 
     220    if [ ! -z ${config_UserChoices_MailName} ] ; then 
     221        mailx -s "${config_UserChoices_JobName} completed mail" ${config_UserChoices_MailName} <  job_end.mail 
     222    elif [ -f ~/.forward ] ; then 
     223        mailx -s "${config_UserChoices_JobName} completed forward 1" $( cat ~/.forward ) < job_end.mail 
     224    fi 
     225 
     226    if [ $? -gt 0 ] ; then 
     227        echo "IGCM_sys_SendMail : erreur." 
     228        IGCM_debug_Exit "IGCM_sys_SendMail" 
     229    fi 
     230    IGCM_debug_PopStack "IGCM_sys_SendMail" 
     231} 
     232 
     233#D-#================================================== 
    201234#D-function IGCM_sys_Mkdir 
    202235#D-* Purpose: Master locale mkdir command 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh

    r145 r153  
    215215 
    216216#D-#================================================== 
     217#D-function IGCM_sys_SendMail 
     218#D-* Purpose: Send mail when simulation is over 
     219#D-* Examples: 
     220#D- 
     221function IGCM_sys_SendMail { 
     222    IGCM_debug_PushStack "IGCM_sys_SendMailPost" $@ 
     223    if ( $DEBUG_sys ) ; then 
     224        echo "IGCM_sys_SendMail :" $@ 
     225    fi 
     226 
     227    cat  << END_MAIL > job_atlas.mail 
     228Dear ${LOGIN}, 
     229 
     230  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`. 
     231  Job started : ${DateBegin} 
     232  Job ended   : ${DateEnd} 
     233  Ouput files are available in ${R_SAVE} 
     234END_MAIL 
     235 
     236    if [ ! -z ${config_UserChoices_MailName} ] ; then 
     237        mailx -s "${config_UserChoices_JobName} completed mail" ${config_UserChoices_MailName} <  job_end.mail 
     238    elif [ -f ~/.forward ] ; then 
     239        mailx -s "${config_UserChoices_JobName} completed forward 1" $( cat ~/.forward ) < job_end.mail 
     240    fi 
     241 
     242    if [ $? -gt 0 ] ; then 
     243        echo "IGCM_sys_SendMail : erreur." 
     244        IGCM_debug_Exit "IGCM_sys_SendMail" 
     245    fi 
     246    IGCM_debug_PopStack "IGCM_sys_SendMail" 
     247} 
     248 
     249#D-#================================================== 
    217250#D-function IGCM_sys_Mkdir 
    218251#D-* Purpose: Master locale mkdir command 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh

    r132 r153  
    173173 
    174174#D-#================================================== 
     175#D-function IGCM_sys_SendMail 
     176#D-* Purpose: Send mail when simulation is over 
     177#D-* Examples: 
     178#D- 
     179function IGCM_sys_SendMail { 
     180    IGCM_debug_PushStack "IGCM_sys_SendMailPost" $@ 
     181    if ( $DEBUG_sys ) ; then 
     182        echo "IGCM_sys_SendMail :" $@ 
     183    fi 
     184 
     185    cat  << END_MAIL > job_atlas.mail 
     186Dear ${LOGIN}, 
     187 
     188  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`. 
     189  Job started : ${DateBegin} 
     190  Job ended   : ${DateEnd} 
     191  Ouput files are available in ${R_SAVE} 
     192END_MAIL 
     193 
     194    if [ ! -z ${config_UserChoices_MailName} ] ; then 
     195        mailx -s "${config_UserChoices_JobName} completed mail" ${config_UserChoices_MailName} <  job_end.mail 
     196    elif [ -f ~/.forward ] ; then 
     197        mailx -s "${config_UserChoices_JobName} completed forward 1" $( cat ~/.forward ) < job_end.mail 
     198    fi 
     199 
     200    if [ $? -gt 0 ] ; then 
     201        echo "IGCM_sys_SendMail : erreur." 
     202        IGCM_debug_Exit "IGCM_sys_SendMail" 
     203    fi 
     204    IGCM_debug_PopStack "IGCM_sys_SendMail" 
     205} 
     206 
     207#D-#================================================== 
    175208#D-function IGCM_sys_Mkdir 
    176209#D-* Purpose: Master locale mkdir command 
Note: See TracChangeset for help on using the changeset viewer.