From 4860b31bab528f4aa9e83797b5e594e64d14840d Mon Sep 17 00:00:00 2001 From: hadaq Date: Fri, 22 Nov 2002 21:54:37 +0000 Subject: [PATCH] regression test -mm --- hadaq/evt.c | 9 ++------- hadaq/evt.h | 2 +- hadaq/evtbuild.c | 40 ++++++++++++++++++++++++---------------- hadaq/hades.tcl | 45 ++++++++++++++++++++++++++++----------------- 4 files changed, 55 insertions(+), 41 deletions(-) diff --git a/hadaq/evt.c b/hadaq/evt.c index 100f34e..bd8910d 100644 --- a/hadaq/evt.c +++ b/hadaq/evt.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evt.c,v 6.11 2001-11-18 11:56:21 hadaq Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evt.c,v 6.12 2002-11-22 21:54:37 hadaq Exp $"; #define _ANSI_C_SOURCE @@ -171,10 +171,9 @@ char *Evt_2charP(const void *my) return buf; } -void *newEvt(uint32_t decoding, uint32_t id, uint32_t runNr, const char *expId) +void *newEvt(uint32_t decoding, uint32_t id) { void *my; - static uint32_t seqNr = 0; time_t tempo; struct tm *gmTime; uint32_t dummy; @@ -185,10 +184,6 @@ void *newEvt(uint32_t decoding, uint32_t id, uint32_t runNr, const char *expId) Evt_setSize(my, Evt_hdrSize()); Evt_setDecoding(my, decoding); Evt_setId(my, id); - Evt_setRunNr(my, runNr); - Evt_setExpIdCharP(my, expId); - - Evt_setSeqNr(my, seqNr++); tempo = time(NULL); gmTime = gmtime(&tempo); diff --git a/hadaq/evt.h b/hadaq/evt.h index ada06c0..e85644e 100644 --- a/hadaq/evt.h +++ b/hadaq/evt.h @@ -81,7 +81,7 @@ uint32_t Evt_expId(const void *my); void Evt_setRunNr(void *my, uint32_t runNr); void Evt_setExpId(void *my, uint32_t expId); -void *newEvt(uint32_t decoding, uint32_t id, uint32_t runNr, const char *expId); +void *newEvt(uint32_t decoding, uint32_t id); void deleteEvt(void *my); void *Evt_fget(FILE * file); void *Evt_appendSubEvt(void *my, void *subEvt); diff --git a/hadaq/evtbuild.c b/hadaq/evtbuild.c index d1a8f0e..66c542e 100644 --- a/hadaq/evtbuild.c +++ b/hadaq/evtbuild.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.57 2002-11-22 18:15:20 hadaq Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.58 2002-11-22 21:54:37 hadaq Exp $"; #define _POSIX_C_SOURCE 199309L @@ -31,11 +31,13 @@ static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hada #include "ansiTape.h" #include "genid32.h" -#define NTRIGTYPES 64UL /* must be 2^n */ -#define NTRIGTYPES_IN_FILE 0UL /* must be 2^n */ +#define NEVTIDS 64UL /* must be 2^n */ +#define NEVTIDS_IN_FILE 0UL /* must be 2^n */ static FILE *outFile; static AnsiTape *outTape; +static uint32_t seqNr; +static uint32_t runNr; static time_t ourTime; typedef struct TheArgsS { @@ -61,7 +63,7 @@ typedef struct TheStatsS { unsigned long *evtsDataError; unsigned long *evtsTagError; unsigned long *bytesWritten; - unsigned long *triggerType[NTRIGTYPES]; + unsigned long *evtId[NEVTIDS]; unsigned long *trigNr[32]; } @@ -279,9 +281,9 @@ static void statsDump(TheArgs * theArgs, TheStats * my, int interval) fputs("------------------------------------------------------------------------------\n", stderr); col = 0; - for (i = 0; i < NTRIGTYPES; i++) { - if (*my->triggerType[i] != 0) { - fprintf(stderr, "%17s%02x:%6s", "triggerType", i, unit(*my->triggerType[i])); + for (i = 0; i < NEVTIDS; i++) { + if (*my->evtId[i] != 0) { + fprintf(stderr, "%17s%02x:%6s", "evtId", i, unit(*my->evtId[i])); if (++col == 3) { fputc('\n', stderr); col = 0; @@ -357,7 +359,10 @@ static int openFile(TheArgs *theArgs) { static char outPath[_POSIX_PATH_MAX]; static once = 1; - theArgs->runNr = genId32(); + runNr = genId32(); + seqNr = 0; + + theArgs->runNr = runNr; if (once) { strcpy(outPath, theArgs->outPath); @@ -413,6 +418,9 @@ static int openFile(TheArgs *theArgs) { static int writeFile(void *evt) { int writeFileR; + Evt_setSeqNr(evt, seqNr++); + Evt_setRunNr(evt, runNr); + if (outFile != NULL) { writeFileR = fwrite(evt, 1, Evt_paddedSize(evt), outFile); } else if (outTape != NULL) { @@ -510,11 +518,11 @@ int main(int argc, char *argv[]) theStats->evtsDataError = Worker_addStatistic(worker, "evtsDataError"); theStats->evtsTagError = Worker_addStatistic(worker, "evtsTagError"); theStats->bytesWritten = Worker_addStatistic(worker, "bytesWritten"); - for (i = 0; i < NTRIGTYPES; i++) { + for (i = 0; i < NEVTIDS; i++) { char buf[WORKER_MAX_NAME_LEN]; - sprintf(buf, "triggerType%d", i); - theStats->triggerType[i] = Worker_addStatistic(worker, buf); + sprintf(buf, "evtId%d", i); + theStats->evtId[i] = Worker_addStatistic(worker, buf); } for (i = 0; i < theArgs->nrOfMsgs; i++) { char buf[WORKER_MAX_NAME_LEN]; @@ -548,7 +556,7 @@ int main(int argc, char *argv[]) storeInfoStart(argv[0], ourTime, theArgs); - evt = newEvt(EvtDecoding_64bitAligned, EvtId_runStart, theArgs->runNr, theArgs->expId); + evt = newEvt(EvtDecoding_64bitAligned, EvtId_runStart); for (i = 0; i < theArgs->slowCtrlFileCnt; i++) { evt = appendFile(evt, theArgs->slowCtrlFiles[i]); } @@ -557,7 +565,7 @@ int main(int argc, char *argv[]) deleteEvt(evt); } - evt = newEvt(EvtDecoding_64bitAligned, EvtId_data, theArgs->runNr, theArgs->expId); + evt = newEvt(EvtDecoding_64bitAligned, EvtId_data); for (i = 0; i < theArgs->nrOfMsgs && !evtIsBroken; i += step) { uint32_t trigNr; uint32_t trigTag; @@ -615,8 +623,8 @@ int main(int argc, char *argv[]) if (!evtIsBroken) { (*theStats->evtsComplete)++; - (*theStats->triggerType[currId & (NTRIGTYPES - 1)])++; - Evt_setId(evt, currId & (NTRIGTYPES_IN_FILE - 1)); + (*theStats->evtId[currId & (NEVTIDS - 1)])++; + Evt_setId(evt, currId & (NEVTIDS_IN_FILE - 1)); if (dataError) { Evt_setDataError(evt); @@ -635,7 +643,7 @@ int main(int argc, char *argv[]) } deleteEvt(evt); if (*theStats->bytesWritten >= maxFileSize) { - evt = newEvt(EvtDecoding_64bitAligned, EvtId_runStop, theArgs->runNr, theArgs->expId); + evt = newEvt(EvtDecoding_64bitAligned, EvtId_runStop); for (i = 0; i < theArgs->slowCtrlFileCnt; i++) { evt = appendFile(evt, theArgs->slowCtrlFiles[i]); } diff --git a/hadaq/hades.tcl b/hadaq/hades.tcl index 91aa824..52dec4b 100644 --- a/hadaq/hades.tcl +++ b/hadaq/hades.tcl @@ -12,6 +12,13 @@ set evtBuilder hadeb03 # watermark for mdc0 is calculated independently set watermark [expr 12 * 1024] +set bandwidth(0) 27000 +set bandwidth(1) 30000 +set bandwidth(2) 16000 +set bandwidth(3) 16000 +set bandwidth(4) 16000 +set bandwidth(5) 30000 +set bandwidth(6) 20000 if {$evtBuilder == "hadeb01"} { set atmBase 50 @@ -24,9 +31,10 @@ if {$evtBuilder == "hadeb01"} { group create acquisition group create run -set vcc [expr $atmBase + 0] +set atmOffset 0 +set vcc [expr $atmBase + $atmOffset] agent create r2-35 hades /hades/usr/hades/$beamTime/trig/hadaq -worker create r2-35:memnet -a -p -1 -w 27000 -o ATM:0:$vcc +worker create r2-35:memnet -a -p -1 -w $bandwidth($atmOffset) -o ATM:0:$vcc worker create r2-35:readout -s trigconc -a -p -2 -w $watermark -v notice group add acquisition r2-35:memnet group add acquisition r2-35:readout @@ -43,9 +51,10 @@ lappend ctustop r2-35 "cd; . bin/daqenv $beamTime; cd $beamTime/slow; ./ctustop" lappend inPaths "-i ATM:0:$vcc" if {[lsearch $subSystems rich0] >= 0} { - set vcc [expr $atmBase + 2] + set atmOffset 2 + set vcc [expr $atmBase + $atmOffset] agent create r2-24 hades /hades/usr/hades/$beamTime/rich/hadaq - worker create r2-24:memnet -a -p -2 -w 16000 -o ATM:0:$vcc + worker create r2-24:memnet -a -p -2 -w $bandwidth($atmOffset) -o ATM:0:$vcc worker create r2-24:readout -s rich0 -a -p -1 -w $watermark -v notice group add acquisition r2-24:memnet group add acquisition r2-24:readout @@ -57,9 +66,10 @@ if {[lsearch $subSystems rich0] >= 0} { } if {[lsearch $subSystems rich1] >= 0} { - set vcc [expr $atmBase + 3] + set atmOffset 3 + set vcc [expr $atmBase + $atmOffset] agent create r2-28 hades /hades/usr/hades/$beamTime/rich/hadaq - worker create r2-28:memnet -a -p -2 -w 16000 -o ATM:0:$vcc + worker create r2-28:memnet -a -p -2 -w $bandwidth($atmOffset) -o ATM:0:$vcc worker create r2-28:readout -s rich1 -a -p -1 -w $watermark -v notice group add acquisition r2-28:memnet group add acquisition r2-28:readout @@ -71,9 +81,10 @@ if {[lsearch $subSystems rich1] >= 0} { } if {[lsearch $subSystems rich2] >= 0} { - set vcc [expr $atmBase + 4] + set atmOffset 4 + set vcc [expr $atmBase + $atmOffset] agent create r2-27 hades /hades/usr/hades/$beamTime/rich/hadaq - worker create r2-27:memnet -a -p -2 -w 16000 -o ATM:0:$vcc + worker create r2-27:memnet -a -p -2 -w $bandwidth($atmOffset) -o ATM:0:$vcc worker create r2-27:readout -s rich2 -a -p -1 -w $watermark -v notice group add acquisition r2-27:memnet group add acquisition r2-27:readout @@ -85,9 +96,10 @@ if {[lsearch $subSystems rich2] >= 0} { } if {[lsearch $subSystems mdc0] >= 0} { - set vcc [expr $atmBase + 5] + set atmOffset 5 + set vcc [expr $atmBase + $atmOffset] agent create r2-8 hades /hades/usr/hades/$beamTime/mdc/hadaq - worker create r2-8:memnet -a -p -1 -w 30000 -o ATM:0:$vcc + worker create r2-8:memnet -a -p -1 -w $bandwidth($atmOffset) -o ATM:0:$vcc worker create r2-8:readout -s mdc0 -a -p -2 -w 24576 -v notice group add acquisition r2-8:memnet group add acquisition r2-8:readout @@ -99,9 +111,10 @@ if {[lsearch $subSystems mdc0] >= 0} { } if {[lsearch $subSystems mdc1] >= 0} { - set vcc [expr $atmBase + 6] + set atmOffset 6 + set vcc [expr $atmBase + $atmOffset] agent create r2-32 hades /hades/usr/hades/$beamTime/mdc/hadaq - worker create r2-32:memnet -a -p -1 -w 20000 -o ATM:0:$vcc + worker create r2-32:memnet -a -p -1 -w $bandwidth($atmOffset) -o ATM:0:$vcc worker create r2-32:readout -s mdc1 -a -p -2 -w $watermark -v notice group add acquisition r2-32:memnet group add acquisition r2-32:readout @@ -113,9 +126,10 @@ if {[lsearch $subSystems mdc1] >= 0} { } if {[lsearch $subSystems shw] >= 0} { - set vcc [expr $atmBase + 1] + set atmOffset 1 + set vcc [expr $atmBase + $atmOffset] agent create r2-14 hades /hades/usr/hades/$beamTime/shw/hadaq - worker create r2-14:memnet -a -p -1 -w 30000 -o ATM:0:$vcc + worker create r2-14:memnet -a -p -1 -w $bandwidth($atmOffset) -o ATM:0:$vcc worker create r2-14:readout -s show -a -p -2 -w $watermark -v notice group add acquisition r2-14:memnet group add acquisition r2-14:readout @@ -127,7 +141,6 @@ if {[lsearch $subSystems shw] >= 0} { } if {[lsearch $subSystems tof1] >= 0} { - set vcc [expr $atmBase + 0] agent create e7_25 hades /hades/usr/hades/$beamTime/tof/hadaq lappend init e7_25:tof1:init lappend reset [ list e7_25 "cd; . bin/daqenv $beamTime; cd $beamTime/slow; ./tof1 reset" ] @@ -136,7 +149,6 @@ if {[lsearch $subSystems tof1] >= 0} { } if {[lsearch $subSystems tof2] >= 0} { - set vcc [expr $atmBase + 0] agent create e7_21 hades /hades/usr/hades/$beamTime/tof/hadaq lappend init e7_21:tof2:init lappend reset [ list e7_21 "cd; . bin/daqenv $beamTime; cd $beamTime/slow; ./tof2 reset" ] @@ -145,7 +157,6 @@ if {[lsearch $subSystems tof2] >= 0} { } if {[lsearch $subSystems tof3] >= 0} { - set vcc [expr $atmBase + 0] agent create e7_41 hades /hades/usr/hades/$beamTime/tof/hadaq lappend init e7_41:tof3:init lappend reset [ list e7_41 "cd; . bin/daqenv $beamTime; cd $beamTime/slow; ./tof3 reset" ] -- 2.43.0