Skip to content

Commit 77bc9a2

Browse files
committed
use 64-bit pointers for buffer offsets which allows buffers larger than 4G.
Only DAQSource is adapted to this and this concerns SFB mode (for example with large virgin raw events), since it does not read input file in chunks in this mode. FEDRawDataInputSource remains with the 32-bit limitation, but typically only around 200 MB buffers are used with it.
1 parent 5ba596f commit 77bc9a2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

EventFilter/Utilities/interface/SourceRawFile.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ class InputFile {
107107

108108
tbb::concurrent_vector<InputChunk*> chunks_;
109109

110-
uint32_t bufferPosition_ = 0;
111-
uint32_t chunkPosition_ = 0;
110+
uint64_t bufferPosition_ = 0;
111+
uint64_t chunkPosition_ = 0;
112112
unsigned int currentChunk_ = 0;
113113

114114
InputFile(evf::EvFDaqDirector::FileStatus status,

EventFilter/Utilities/src/FedRawDataInputSource.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ inline evf::EvFDaqDirector::FileStatus FedRawDataInputSource::getNextEvent() {
532532
chunkIsFree_ = true;
533533
} else {
534534
//header was contiguous, but check if payload fits the chunk
535-
if (eventChunkSize_ - currentFile_->chunkPosition_ < msgSize) {
535+
if (eventChunkSize_ - (uint32_t)currentFile_->chunkPosition_ < msgSize) {
536536
//rewind to header start position
537537
currentFile_->rewindChunk(FRDHeaderVersionSize[detectedFRDversion_]);
538538
//copy event to a chunk start and move pointers
@@ -1528,12 +1528,12 @@ void FedRawDataInputSource::readNextChunkIntoBuffer(InputFile* file) {
15281528
}
15291529
} else {
15301530
//event didn't fit in last chunk, so leftover must be moved to the beginning and completed
1531-
uint32_t existingSizeLeft = eventChunkSize_ - file->chunkPosition_;
1531+
uint32_t existingSizeLeft = eventChunkSize_ - (uint32_t)file->chunkPosition_;
15321532
memmove((void*)file->chunks_[0]->buf_, file->chunks_[0]->buf_ + file->chunkPosition_, existingSizeLeft);
15331533

15341534
//calculate amount of data that can be added
1535-
const uint32_t blockcount = file->chunkPosition_ / eventChunkBlock_;
1536-
const uint32_t leftsize = file->chunkPosition_ % eventChunkBlock_;
1535+
const uint32_t blockcount = (uint32_t)file->chunkPosition_ / eventChunkBlock_;
1536+
const uint32_t leftsize = (uint32_t)file->chunkPosition_ % eventChunkBlock_;
15371537

15381538
for (uint32_t i = 0; i < blockcount; i++) {
15391539
const ssize_t last =

0 commit comments

Comments
 (0)