Changeset 1150
- Timestamp:
- 01/13/15 19:20:09 (9 years ago)
- Location:
- trunk/libIGCM
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
r1127 r1150 95 95 # Define STORAGE : Dedicated to small/medium files 96 96 # Define R_OUT : Output tree located on ARCHIVE 97 # Define R_BUF : Output tree located on STORAGE (files waiting treatment, or file lcoation when SpaceName=!PROD) 97 98 # Define R_FIG : Output tree located on STORAGE hosting figures (monitoring and atlas, and/or small files) 98 # Define R_ BUF : USELESS and DEPRECATED output tree.99 # Define R_TMP : A temporary space used by IGCM_debug_send_AMQP_msg__MAILTUNNEL. Must be persistent in between jobs 99 100 IGCM_sys_defineArchives 100 101 … … 1262 1263 fi 1263 1264 fi 1265 1266 # To be sure we flush message buffer and clean up behind us before the end of the simulation 1267 FlushAMQP=TRUE 1268 1264 1269 else 1265 1270 #=================# … … 1307 1312 fi 1308 1313 1309 # To be sure we flush message buffer before exiting the job1310 FlushAMQP=TRUE1311 1312 1314 IGCM_debug_PopStack "IGCM_config_Finalize" 1313 1315 } -
trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh
r1140 r1150 131 131 b64_encoded_msg=$1 132 132 133 # R_TMP point to RUN_DIR_PATH on Ada and on /tmp otherwise134 buffer=${R_TMP}/buffer.$$135 133 mail_recipient="superviseur@ipsl.jussieu.fr" 136 134 send_messages=0 137 135 mail_frequency=3600 # in seconds 138 136 # use to keep track when was last mail sent (maybe to be replaced with global variable) 139 last_mail_date__file=${R_TMP}/stamp.$$ 137 last_mail_date__file=${R_BUF}/.stamp.${config_UserChoices_TagName}.${config_UserChoices_JobName} 138 # use to accumulate messages before sending them 139 buffer=${R_BUF}/.buffer.${config_UserChoices_TagName}.${config_UserChoices_JobName} 140 140 141 141 # init 142 142 if [ ! -f "${buffer}" ]; then 143 touch "${buffer}" 144 fi 145 146 # retrieve pending messages number 147 messages_count=$( wc -l ${buffer} | gawk {'print $1'} ) 143 touch ${buffer} 144 fi 148 145 149 146 if [ ! -f "${last_mail_date__file}" ]; then 150 # if we are here, it means no mail has been sent yet 151 # send the first mail 152 [ ${messages_count} -gt 0 ] && send_messages=1 147 touch ${last_mail_date__file} 153 148 else 154 149 # compute last time the file was changed (in seconds) 155 150 seconds_since_last_mail=$(( $(date +%s) - $(stat -c %Y ${last_mail_date__file}) )) 156 151 # send message when exceeding threshold … … 169 164 touch ${last_mail_date__file} # memorize last mail date 170 165 initBigBro=false 171 elif ( [ ${send_messages} -eq 1 ] || [ X${FlushAMQP} = XTRUE ] ); then166 elif [ ${send_messages} -eq 1 ] ; then 172 167 #echo $(date +"%Y-%m-%dT%H:%M:%S.%N%z") >> ${SUBMIT_DIR}/mail.txt 173 168 mailx -s "[TEMPORARY AMQP CHANNEL]" ${mail_recipient} < ${buffer} # send buffer 174 rm -f $ buffer ; touch ${buffer} # clearbuffer169 rm -f ${buffer} ; touch ${buffer} # flush the buffer 175 170 touch ${last_mail_date__file} # memorize last mail date 171 fi 172 173 if [ X${FlushAMQP} = XTRUE ] ; then 174 mailx -s "[TEMPORARY AMQP CHANNEL]" ${mail_recipient} < ${buffer} # send buffer 175 rm -f ${buffer} # cleaning behind us 176 rm -f ${last_mail_date__file} # cleaning behind us 176 177 fi 177 178 … … 297 298 fi 298 299 299 if [ X${ActivateBigBro} = Xtrue ] ; then 300 # RabbitMQ message code "PUSHSTACK" 301 code=2000 302 # RabbitMQ message body 303 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${IGCM_debug_Stack[0]}\",\"arguments\":[\"${IGCM_debug_StackArgs[0]}\"],\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 304 # Fill the rabbitMQ queue 305 IGCM_debug_sendAMQP 306 fi 300 # Unplugged message 2000 handling for now. To ease downstream treatment. 301 #if [ X${ActivateBigBro} = Xtrue ] ; then 302 # # RabbitMQ message code "PUSHSTACK" 303 # code=2000 304 # # RabbitMQ message body 305 # Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${IGCM_debug_Stack[0]}\",\"arguments\":[\"${IGCM_debug_StackArgs[0]}\"],\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 306 # # Fill the rabbitMQ queue 307 # IGCM_debug_sendAMQP 308 #fi 307 309 308 310 # Increment LenStack … … 513 515 fi 514 516 515 if [ X${ActivateBigBro} = Xtrue ] ; then 516 # RabbitMQ message code "POPSTACK" 517 code=3000 518 # RabbitMQ message body 519 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${command}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 520 # Fill the rabbitMQ queue 521 IGCM_debug_sendAMQP 522 fi 517 # Unplugged message 3000 handling for now. To ease downstream treatment. 518 #if [ X${ActivateBigBro} = Xtrue ] ; then 519 # # RabbitMQ message code "POPSTACK" 520 # code=3000 521 # # RabbitMQ message body 522 # Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${command}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 523 # # Fill the rabbitMQ queue 524 # IGCM_debug_sendAMQP 525 #fi 523 526 fi 524 527 -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh
r1148 r1150 211 211 #- R_BUF (ONLY FOR double copy an scratch) 212 212 R_BUF=${WORKDIR}/IGCM_OUT 213 214 #====================================================215 #- R_TMP (point a space acting as /tmp)216 R_TMP=${RUN_DIR_PATH}217 213 218 214 IGCM_debug_Print 1 "R_OUT has been defined = ${R_OUT}" -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
r1147 r1150 245 245 #- R_BUF (ONLY FOR double copy an scratch) 246 246 R_BUF=${SCRATCHDIR}/IGCM_OUT 247 248 #====================================================249 #- R_TMP (point a space acting as /tmp)250 R_TMP=/tmp251 247 252 248 IGCM_debug_Print 1 "R_OUT has been defined = ${R_OUT}" -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh
r1147 r1150 188 188 #- R_BUF (ONLY FOR double copy an scratch) 189 189 R_BUF=${STORAGE}/IGCM_OUT 190 191 #====================================================192 #- R_TMP (point a space acting as /tmp)193 R_TMP=/tmp194 190 195 191 IGCM_debug_Print 1 "R_OUT has been defined = ${R_OUT}" -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh
r1147 r1150 196 196 #- R_BUF (ONLY FOR double copy an scratch) 197 197 R_BUF=${WORKDIR}/IGCM_OUT 198 199 #====================================================200 #- R_TMP (point a space acting as /tmp)201 R_TMP=/tmp202 198 203 199 IGCM_debug_Print 1 "R_OUT has been defined = ${R_OUT}" -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
r1147 r1150 198 198 #- R_BUF (ONLY FOR double copy an scratch) 199 199 R_BUF=${STORAGE}/IGCM_OUT 200 201 #====================================================202 #- R_TMP (point a space acting as /tmp)203 R_TMP=/tmp204 200 205 201 IGCM_debug_Print 1 "R_OUT has been defined = ${R_OUT}"
Note: See TracChangeset
for help on using the changeset viewer.