Skip to content

Commit 2ff2179

Browse files
committed
use tbb concurrent queue because unpacking can go on in parallel
1 parent ec64e25 commit 2ff2179

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

EventFilter/Utilities/interface/DAQSourceModelsFRD.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <filesystem>
55
#include <queue>
6+
#include "oneapi/tbb/concurrent_unordered_set.h"
67

78
#include "EventFilter/Utilities/interface/DAQSourceModels.h"
89
#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
@@ -169,8 +170,8 @@ class DataModeFRDPreUnpack : public DataMode {
169170
uint16_t MINTCDSuTCAFEDID_ = FEDNumbering::MINTCDSuTCAFEDID;
170171
uint16_t MAXTCDSuTCAFEDID_ = FEDNumbering::MAXTCDSuTCAFEDID;
171172
bool eventCached_ = false;
172-
std::unordered_set<unsigned short> fedIdSet_;
173-
unsigned int expectedFedsInEvent_ = 0;
173+
oneapi::tbb::concurrent_unordered_set<unsigned short> fedIdSet_;
174+
std::atomic<unsigned int> expectedFedsInEvent_ = 0;
174175
bool verifyFEDs_ = true;
175176
};
176177

EventFilter/Utilities/interface/FedRawDataInputSource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class FedRawDataInputSource : public edm::RawInputSource {
185185

186186
std::map<unsigned int, unsigned int> sourceEventsReport_;
187187
std::mutex monlock_;
188-
expectedFedsInEvent_ = 0;
188+
unsigned int expectedFedsInEvent_ = 0;
189189
};
190190

191191
#endif // EventFilter_Utilities_FedRawDataInputSource_h

EventFilter/Utilities/src/FedRawDataInputSource.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ edm::Timestamp FedRawDataInputSource::fillFEDRawDataCollection(FEDRawDataCollect
658658
tcds_pointer_ = nullptr;
659659
tcdsInRange = false;
660660
uint16_t selectedTCDSFed = 0;
661-
fedsInEvent = 0;
661+
unsigned int fedsInEvent = 0;
662662
while (eventSize > 0) {
663663
assert(eventSize >= FEDTrailer::length);
664664
eventSize -= FEDTrailer::length;
@@ -706,7 +706,7 @@ edm::Timestamp FedRawDataInputSource::fillFEDRawDataCollection(FEDRawDataCollect
706706

707707
if (fedsInEvent != expectedFedsInEvent_ && expectedFedsInEvent_)
708708
edm::LogWarning("DataModeFRDStriped:::fillFRDCollection")
709-
<< "Event " << events_.at(0)->event() << " does not contain same number of FEDs as previous: "
709+
<< "Event " << event_->event() << " does not contain same number of FEDs as previous: "
710710
<< fedsInEvent << "/" << expectedFedsInEvent_;
711711

712712
return tstamp;

EventFilter/Utilities/test/RunBUFU.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ CMDLINE_STARTFU="cmsRun startFU_daqsource.py daqSourceMode=FRDStriped runNumber=
171171
${CMDLINE_STARTFU} > out_2_fu.log 2>&1 || diefu "${CMDLINE_STARTFU}" $? $OUTDIR out_2_fu.log
172172
rm -rf $OUTDIR/{ramdisk,data,*.log}
173173

174-
echo "running DAQSource test with FRDPreUnpack"
174+
echo "running DAQSource test with unpacking in reader threads"
175175
CMDLINE_STARTBU="cmsRun startBU.py runNumber=${runnumber} fffBaseDir=${OUTDIR} maxLS=2 fedMeanSize=128 eventsPerFile=20 eventsPerLS=35 frdFileVersion=1"
176176
CMDLINE_STARTFU="cmsRun startFU_daqsource.py daqSourceMode=FRDPreUnpack runNumber=${runnumber} fffBaseDir=${OUTDIR}"
177177
${CMDLINE_STARTBU} > out_2_bu.log 2>&1 || diebu "${CMDLINE_STARTBU}" $? $OUTDIR

0 commit comments

Comments
 (0)