-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.153 2011-08-14 14:18:39 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.154 2011-08-16 10:54:41 hadaq Exp $";
#define _POSIX_C_SOURCE 199309L
#define SYSLOG_NAMES
#define DAQVERSION 2 /* needed by Hydra unpackers */
#define RUNID_INFO_DT 600 /* time in s until not available runid info is logged */
-#define LOST_SUBEVT_LIMIT 50000 /* number of popped subevents per trigger sequence until warning */
-#define LOST_SUBEVT_TERM 20 /* terminate after this number of lost sub warnings per trigger sequence */
+#define LOST_SUBEVT_LIMIT 10000 /* number of popped subevents per trigger sequence until warning */
+#define LOST_SUBEVT_DROP 2 /* drop all queue contents after this number of lost sub warnings per trigger sequence */
#define NEVTIDS 64UL /* must be 2^n */
#define NEVTIDS_IN_FILE 0UL /* must be 2^n */
int retVal = 0;
if (theArgs->maxTrigMismatch == -1) {
- theArgs->maxTrigMismatch = 30; /* JAM: set reasonable default if not specified */
+ theArgs->maxTrigMismatch = 90; /* JAM: set reasonable default if not specified */
sprintf(msglog, "<I> Critical trigger mismatch ratio takes default of %d %% ", theArgs->maxTrigMismatch);
storeLogInfo(theArgs, msglog);
/*return retVal; */
/* BUGBUG bailOut not proper yet */
int main(int argc, char *argv[])
{
- int i;
+ int i, q;
TheArgs theArgsS, *theArgs = &theArgsS;
TheStats theStatsS, *theStats = &theStatsS;
TheDebug theDebugS, *theDebug = &theDebugS;
storeLogInfo(theArgs, msglog);
popTermCnt++;
}
- if (popTermCnt > LOST_SUBEVT_TERM) {
- storeLogInfo(theArgs, "<E> too many lost subevents. Exiting now!");
- goto bailOut1;
+ if (popTermCnt > LOST_SUBEVT_DROP) {
+ /* storeLogInfo(theArgs, "<E> too many lost subevents. Exiting now!");
+ goto bailOut1; */
+
+ /* throw away all queues and start again: */
+ storeLogInfo(theArgs, "<E> too many lost subevents. Dropping all queues!");
+ for (q = 0; q < theArgs->nrOfMsgs; q++) {
+ HadTuQueue_clear(hadTuQueue[q]);
+ desHadTuQueue(hadTuQueue[q]);
+ free(hadTuQueue[q]);
+ hadTuQueue[q] = NULL;
+ ShmTrans_free(shmTrans[q]);
+ }
+ i = 0; /* start again with evaluating other double buffer */
+ step = 1;
}
}
} else {