Changeset 922


Ignore:
Timestamp:
08/14/13 14:17:29 (11 years ago)
Author:
sdipsl
Message:

Once per simulation send email containing estimated consumed hours for the whole simulation and a recommended PeriodNb?

Location:
trunk/libIGCM
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_config/libIGCM_config.ksh

    r920 r922  
    420420  # DateBegin + CumulPeriod*PeriodLength = PeriodDateBegin 
    421421  echo 
    422    
     422 
    423423  case ${config_UserChoices_PeriodLength} in 
    424424  *Y|*y) 
     
    11081108  fi 
    11091109 
     1110  # Send some accounting element to the user if CumulPeriod=3 
     1111  if [ ${CumulPeriod} -eq 3 ] ; then 
     1112    echo 
     1113    IGCM_debug_Print 1 "Send email containing some accounting information : " 
     1114 
     1115    RealCpuTime=$( echo ${ExeCpuLog} | gawk '{print $3}' ) 
     1116 
     1117    consumeHoursPerPeriod=$( echo "scale=6;${RealCpuTime}*${PROCESSUS_NUMBER}/3600" | bc ) 
     1118 
     1119    consumeHoursPerWholeSimulation=$( echo "scale=6;${consumeHoursPerPeriod}/${PeriodLengthInDays}*${ExperienceLengthInDays}" | bc ) 
     1120 
     1121    recommendedPeriodNb=$( echo "scale=6;24/${consumeHoursPerPeriod}*${PROCESSUS_NUMBER}" | bc ) 
     1122 
     1123    IGCM_sys_SendMail Accounting 
     1124  fi 
     1125 
    11101126  #=================================================# 
    11111127  #         Modification of libIGCM behaviour       # 
     
    12801296 
    12811297    IGCM_debug_Print 1 "Submit next job" 
    1282     # SUBMIT NEXT JOB from SUBMIT_DIR and come back in RUN_DIR  
    1283     IGCM_sys_Cd ${SUBMIT_DIR}  
     1298    # SUBMIT NEXT JOB from SUBMIT_DIR and come back in RUN_DIR 
     1299    IGCM_sys_Cd ${SUBMIT_DIR} 
    12841300    # Keep only the 5 latest ${Script_Output_Prefix}_${config_UserChoices_JobName} 
    12851301    ScriptTot=$( ls ${Script_Output_Prefix}_${config_UserChoices_JobName}.?????? 2>/dev/null | wc -l ) 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh

    r918 r922  
    297297  fi 
    298298 
    299   if ( ${ExitFlag} ) ; then 
     299  if [ X${1} = XAccounting ] ; then 
     300    status=Accounting 
     301    mailText=jobAccounting.mail 
     302  elif ( ${ExitFlag} ) ; then 
    300303    status=failed 
     304    mailText=jobEnd.mail 
    301305  else 
    302306    status=completed 
    303   fi 
    304  
    305   cat  << END_MAIL > job_end.mail 
    306 Dear ${LOGIN}, 
    307  
    308   Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`. 
    309   Job started : ${DateBegin} 
    310   Job ended   : ${DateEnd} 
    311   Output files are available in ${R_SAVE} 
    312   Files to be rebuild are temporarily available in ${REBUILD_DIR} 
    313   Pre-packed files are temporarily available in ${R_BUFR} 
    314   Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR} 
    315 END_MAIL 
     307    mailText=jobEnd.mail 
     308  fi 
     309 
     310  # Update selected mail template 
     311  while read -r line; do 
     312    eval echo $line >> mail.txt ; 
     313  done < ${libIGCM}/libIGCM_sys/${mailText} 
    316314 
    317315  if [ ! -z ${config_UserChoices_MailName} ] ; then 
    318     mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
     316    mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  mail.txt 
    319317  elif [ -f ~/.forward ] ; then 
    320     mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
     318    mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt 
    321319  else 
    322     mail -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail 
     320    mail -s "${config_UserChoices_JobName} ${status}" ${USER} < mail.txt 
    323321  fi 
    324322 
    325323  sleep 10 
    326   rm -f job_end.mail 
    327  
    328   if [ $? -gt 0 ] ; then 
    329     echo "IGCM_sys_SendMail : erreur." 
    330     IGCM_debug_Exit "IGCM_sys_SendMail" 
    331   fi 
     324  rm -f mail.txt 
     325 
    332326  IGCM_debug_PopStack "IGCM_sys_SendMail" 
    333327} 
     
    376370    mkdir -p $1 
    377371    status=$? 
    378   fi   
     372  fi 
    379373 
    380374  if [ ${status} -gt 0 ] ; then 
     
    969963      status=$? 
    970964    else 
    971       \cp -r $1 $2 > out_rsync 2>&1  
     965      \cp -r $1 $2 > out_rsync 2>&1 
    972966      status=$? 
    973967    fi 
     
    16711665#D-#================================================== 
    16721666#D-function IGCM_sys_rebuild_station 
    1673 #D-* Purpose: rebuild parallel files describing station  
     1667#D-* Purpose: rebuild parallel files describing station 
    16741668#D-* Examples: 
    16751669#D- 
     
    17001694  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out} 
    17011695 
    1702   # Station re-ordering is too expansive to be run within libICGM 
     1696  # Station re-ordering is too expansive to be run within libIGCM 
    17031697  # This is due to (ncpdq - nrcat - ncpdq) I/O sequence. 
    17041698  # This re-ordering must be done "in memory" by the cmorization process 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh

    r918 r922  
    357357function IGCM_sys_SendMail { 
    358358  IGCM_debug_PushStack "IGCM_sys_SendMail" $@ 
     359 
     360set -vx 
     361 
    359362  if ( $DEBUG_sys ) ; then 
    360363    echo "IGCM_sys_SendMail :" $@ 
    361364  fi 
    362365 
    363   if ( ${ExitFlag} ) ; then 
     366  if [ X${1} = XAccounting ] ; then 
     367    status=Accounting 
     368    mailText=jobAccounting.mail 
     369  elif ( ${ExitFlag} ) ; then 
    364370    status=failed 
     371    mailText=jobEnd.mail 
    365372  else 
    366373    status=completed 
    367   fi 
    368  
    369   cat  << END_MAIL > job_end.mail 
    370 Dear ${LOGIN}, 
    371  
    372   Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`. 
    373   Job started : ${DateBegin} 
    374   Job ended   : ${DateEnd} 
    375   Output files are available in ${R_SAVE} 
    376   Files to be rebuild are temporarily available in ${REBUILD_DIR} 
    377   Pre-packed files are temporarily available in ${R_BUFR} 
    378   Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR} 
    379 END_MAIL 
     374    mailText=jobEnd.mail 
     375  fi 
     376 
     377  # Update selected mail template 
     378  while read -r line; do 
     379    eval echo $line >> mail.txt ; 
     380  done < ${libIGCM}/libIGCM_sys/${mailText} 
    380381 
    381382  if [ ! -z ${config_UserChoices_MailName} ] ; then 
    382     mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < job_end.mail 
     383    mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < mail.txt 
    383384  elif [ -f ~/.forward ] ; then 
    384     mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
     385    mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt 
    385386  fi 
    386387 
    387388  sleep 10 
    388   rm -f job_end.mail 
    389  
    390   if [ $? -gt 0 ] ; then 
    391     echo "IGCM_sys_SendMail : erreur." 
    392     IGCM_debug_Exit "IGCM_sys_SendMail" 
    393   fi 
     389  rm -f mail.txt 
     390 
     391set +vx 
     392 
    394393  IGCM_debug_PopStack "IGCM_sys_SendMail" 
    395394} 
     
    19131912  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out} 
    19141913 
    1915   # Station re-ordering is too expansive to be run within libICGM 
     1914  # Station re-ordering is too expansive to be run within libIGCM 
    19161915  # This is due to (ncpdq - nrcat - ncpdq) I/O sequence. 
    19171916  # This re-ordering must be done "in memory" by the cmorization process 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh

    r918 r922  
    244244  fi 
    245245 
    246   if ( ${ExitFlag} ) ; then 
     246  if [ X${1} = XAccounting ] ; then 
     247    status=Accounting 
     248    mailText=jobAccounting.mail 
     249  elif ( ${ExitFlag} ) ; then 
    247250    status=failed 
     251    mailText=jobEnd.mail 
    248252  else 
    249253    status=completed 
    250   fi 
    251  
    252   cat  << END_MAIL > job_end.mail 
    253 Dear ${LOGIN}, 
    254  
    255   Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`. 
    256   Job started : ${DateBegin} 
    257   Job ended   : ${DateEnd} 
    258   Output files are available in ${R_SAVE} 
    259   Files to be rebuild are temporarily available in ${REBUILD_DIR} 
    260   Pre-packed files are temporarily available in ${R_BUFR} 
    261   Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR} 
    262 END_MAIL 
     254    mailText=jobEnd.mail 
     255  fi 
     256 
     257  # Update selected mail template 
     258  while read -r line; do 
     259    eval echo $line >> mail.txt ; 
     260  done < ${libIGCM}/libIGCM_sys/${mailText} 
    263261 
    264262  if [ ! -z ${config_UserChoices_MailName} ] ; then 
    265     mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
     263    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  mail.txt 
    266264  elif [ -f ~/.forward ] ; then 
    267     mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
     265    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt 
    268266  fi 
    269267 
    270268  sleep 10 
    271   rm -f job_end.mail 
    272  
    273   if [ $? -gt 0 ] ; then 
    274     echo "IGCM_sys_SendMail : erreur." 
    275     IGCM_debug_Exit "IGCM_sys_SendMail" 
    276   fi 
     269  rm -f mail.txt 
     270 
    277271  IGCM_debug_PopStack "IGCM_sys_SendMail" 
    278272} 
     
    14541448#D-#================================================== 
    14551449#D-function IGCM_sys_rebuild_station 
    1456 #D-* Purpose: rebuild parallel files describing station  
     1450#D-* Purpose: rebuild parallel files describing station 
    14571451#D-* Examples: 
    14581452#D- 
     
    14831477  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out} 
    14841478 
    1485   # Station re-ordering is too expansive to be run within libICGM 
     1479  # Station re-ordering is too expansive to be run within libIGCM 
    14861480  # This is due to (ncpdq - nrcat - ncpdq) I/O sequence. 
    14871481  # This re-ordering must be done "in memory" by the cmorization process 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh

    r918 r922  
    257257  fi 
    258258 
    259   if ( ${ExitFlag} ) ; then 
     259  if [ X${1} = XAccounting ] ; then 
     260    status=Accounting 
     261    mailText=jobAccounting.mail 
     262  elif ( ${ExitFlag} ) ; then 
    260263    status=failed 
     264    mailText=jobEnd.mail 
    261265  else 
    262266    status=completed 
    263   fi 
    264  
    265   cat  << END_MAIL > job_end.mail 
    266 Dear ${LOGIN}, 
    267  
    268   Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`. 
    269   Job started : ${DateBegin} 
    270   Job ended   : ${DateEnd} 
    271   Output files are available in ${R_SAVE} 
    272   Files to be rebuild are temporarily available in ${REBUILD_DIR} 
    273   Pre-packed files are temporarily available in ${R_BUFR} 
    274   Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR} 
    275 END_MAIL 
     267    mailText=jobEnd.mail 
     268  fi 
     269 
     270  # Update selected mail template 
     271  while read -r line; do 
     272    eval echo $line >> mail.txt ; 
     273  done < ${libIGCM}/libIGCM_sys/${mailText} 
    276274 
    277275  if [ ! -z ${config_UserChoices_MailName} ] ; then 
    278     mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
     276    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < mail.txt 
    279277  elif [ -f ~/.forward ] ; then 
    280     mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
     278    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt 
    281279  else 
    282     mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail 
     280    mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < mail.txt 
    283281  fi 
    284282 
    285283  sleep 10 
    286   rm -f job_end.mail 
    287  
    288   if [ $? -gt 0 ] ; then 
    289     echo "IGCM_sys_SendMail : erreur." 
    290     IGCM_debug_Exit "IGCM_sys_SendMail" 
    291   fi 
     284  rm -f mail.txt 
     285 
    292286  IGCM_debug_PopStack "IGCM_sys_SendMail" 
    293287} 
     
    14911485#D-#================================================== 
    14921486#D-function IGCM_sys_rebuild_station 
    1493 #D-* Purpose: rebuild parallel files describing station  
     1487#D-* Purpose: rebuild parallel files describing station 
    14941488#D-* Examples: 
    14951489#D- 
     
    15201514  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out} 
    15211515 
    1522   # Station re-ordering is too expansive to be run within libICGM 
     1516  # Station re-ordering is too expansive to be run within libIGCM 
    15231517  # This is due to (ncpdq - nrcat - ncpdq) I/O sequence. 
    15241518  # This re-ordering must be done "in memory" by the cmorization process 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh

    r918 r922  
    256256  fi 
    257257 
    258   if ( ${ExitFlag} ) ; then 
     258  if [ X${1} = XAccounting ] ; then 
     259    status=Accounting 
     260    mailText=jobAccounting.mail 
     261  elif ( ${ExitFlag} ) ; then 
    259262    status=failed 
     263    mailText=jobEnd.mail 
    260264  else 
    261265    status=completed 
    262   fi 
    263  
    264   cat  << END_MAIL > job_end.mail 
    265 Dear ${LOGIN}, 
    266  
    267   Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`. 
    268   Job started : ${DateBegin} 
    269   Job ended   : ${DateEnd} 
    270   Output files are available in ${R_SAVE} 
    271   Files to be rebuild are temporarily available in ${REBUILD_DIR} 
    272   Pre-packed files are temporarily available in ${R_BUFR} 
    273   Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR} 
    274 END_MAIL 
     266    mailText=jobEnd.mail 
     267  fi 
     268 
     269  # Update selected mail template 
     270  while read -r line; do 
     271    eval echo $line >> mail.txt ; 
     272  done < ${libIGCM}/libIGCM_sys/${mailText} 
    275273 
    276274  if [ ! -z ${config_UserChoices_MailName} ] ; then 
    277     mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
     275    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < mail.txt 
    278276  elif [ -f ~/.forward ] ; then 
    279     mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
     277    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt 
    280278  fi 
    281279 
    282280  sleep 10 
    283   rm -f job_end.mail 
    284  
    285   if [ $? -gt 0 ] ; then 
    286     echo "IGCM_sys_SendMail : erreur." 
    287     IGCM_debug_Exit "IGCM_sys_SendMail" 
    288   fi 
     281  rm -f mail.txt 
     282 
    289283  IGCM_debug_PopStack "IGCM_sys_SendMail" 
    290284} 
     
    14821476#D-#================================================== 
    14831477#D-function IGCM_sys_rebuild_station 
    1484 #D-* Purpose: rebuild parallel files describing station  
     1478#D-* Purpose: rebuild parallel files describing station 
    14851479#D-* Examples: 
    14861480#D- 
     
    15111505  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out} 
    15121506 
    1513   # Station re-ordering is too expansive to be run within libICGM 
     1507  # Station re-ordering is too expansive to be run within libIGCM 
    15141508  # This is due to (ncpdq - nrcat - ncpdq) I/O sequence. 
    15151509  # This re-ordering must be done "in memory" by the cmorization process 
Note: See TracChangeset for help on using the changeset viewer.