15 #include "interface/evb/i2oEVBMsgs.h"
33 bu_(bu), sm_(sm), log_(
logger), nbDqmCells_(nbDqmCells),
34 nbRawCells_(nbRawCells), nbRecoCells_(nbRecoCells),
35 acceptSMDataDiscard_(0), acceptSMDqmDiscard_(0), doCrcCheck_(1),
36 shutdownTimeout_(timeout), nbPending_(0), nbClientsToShutDown_(0),
37 isReadyToShutDown_(
true), isActive_(
false),
runNumber_(0xffffffff),
38 frb_(frb), app_(app) {
43 freeResRequiredForAllocate_ = nbRawCells_ / 2;
45 freeResRequiredForAllocate_ = freeResReq;
47 sem_init(&lock_, 0, 1);
75 std::ostringstream oss;
76 oss <<
"/tmp/evt" << cell->
evtNumber() <<
".dump";
77 ofstream
fout(oss.str().c_str());
81 for (
unsigned int i = 0;
i < cell->
nFed();
i++) {
84 fout <<
"# fedid " <<
i << endl;
85 unsigned char* addr = cell->
fedAddr(
i);
86 for (
unsigned int j = 0;
j < cell->
fedSize(
i);
j++) {
87 fout << std::setiosflags(std::ios::right) << std::setw(2)
88 << std::hex << (int) (*addr) << std::dec;
117 if (nbFreeSlots > nbFreeSlotsMax) {
134 <<
" pending ALLOCATE messages! Forgetting...");
160 LOG4CPLUS_ERROR(
log_,
"No StorageManager, DROP INIT MESSAGE!");
164 fuProcessId, fuGuid, data, dataSize, nExpectedEPs);
175 LOG4CPLUS_ERROR(
log_,
"No StorageManager, DROP DATA EVENT!");
179 outModId, fuProcessId, fuGuid, data, dataSize);
190 LOG4CPLUS_ERROR(
log_,
"No StorageManager, DROP ERROR EVENT!");
194 evtNumber, fuProcessId, fuGuid, data, dataSize);
228 LOG4CPLUS_WARN(
log_,
"No StorageManager, DROP DQM EVENT.");
237 "DQM Cell " << fuDqmId
238 <<
" being sent more than once for folder "
239 << folderId <<
" process " << fuProcessId
240 <<
" guid " << fuGuid);
243 fuProcessId, fuGuid, data, dataSize);
249 while (0 != bufRef->getNextReference())
250 bufRef = bufRef->getNextReference();
252 I2O_EVENT_DATA_BLOCK_MESSAGE_FRAME *
block =
253 (I2O_EVENT_DATA_BLOCK_MESSAGE_FRAME*) bufRef->getDataLocation();
255 UInt_t iBlock = block->blockNb;
256 UInt_t nBlock = block->nbBlocksInSuperFragment;
257 UInt_t iSuperFrag = block->superFragmentNb;
258 UInt_t nSuperFrag = block->nbSuperFragmentsInEvent;
260 return ((iSuperFrag == nSuperFrag - 1) && (iBlock == nBlock - 1));
static const char runNumber_[]
void sendDiscard(UInt_t buResourceId)
bool * acceptSMDataDiscard_
void releaseResources()
releases all FUResource's
void sendDiscard(UInt_t buResourceId)
void sendAllocate(const UIntVec_t &fuResourceIds)
toolbox::mem::Reference MemRef_t
bool isLastMessageOfEvent(MemRef_t *bufRef)
virtual std::string printStatus()
unsigned int evtNumber() const
void resetPendingAllocates()
resets free resources to the maximum number
void dumpEvent(evf::FUShmRawCell *cell)
IPCMethod(bool segmentationMode, UInt_t nbRawCells, UInt_t nbRecoCells, UInt_t nbDqmCells, UInt_t rawCellSize, UInt_t recoCellSize, UInt_t dqmCellSize, int freeResReq, BUProxy *bu, SMProxy *sm, log4cplus::Logger logger, unsigned int timeout, EvffedFillerRB *frb, xdaq::Application *app)
UInt_t sendDqmEvent(UInt_t fuDqmId, UInt_t runNumber, UInt_t evtAtUpdate, UInt_t folderId, UInt_t fuProcessId, UInt_t fuGuid, UChar_t *data, UInt_t dataSize)
UInt_t allocateResource()
void sendDqmEvent(UInt_t fuDqmId, UInt_t runNumber, UInt_t evtAtUpdate, UInt_t folderId, UInt_t fuProcessId, UInt_t fuGuid, UChar_t *data, UInt_t dataSize)
int * acceptSMDqmDiscard_
FUResourceVec_t resources_
unsigned int freeResRequiredForAllocate_
UInt_t sendErrorEvent(UInt_t fuResourceId, UInt_t runNumber, UInt_t evtNumber, UInt_t fuProcessId, UInt_t fuGuid, UChar_t *data, UInt_t dataSize)
block
Formating index page's pieces.
unsigned char * fedAddr(unsigned int i) const
UInt_t nbFreeSlots() const
unsigned long long uint64_t
UInt_t sendDataEvent(UInt_t fuResourceId, UInt_t runNumber, UInt_t evtNumber, UInt_t outModId, UInt_t fuProcessId, UInt_t fuGuid, UChar_t *data, UInt_t dataSize)
std::atomic< int > nbPendingSMDqmDiscards_
void sendErrorEvent(UInt_t fuResourceId, UInt_t runNumber, UInt_t evtNumber, UInt_t fuProcessId, UInt_t fuGuid, UChar_t *data, UInt_t dataSize)
unsigned int nFed() const
char data[epos_bytes_allocation]
void sendDataEvent(UInt_t fuResourceId, UInt_t runNumber, UInt_t evtNumber, UInt_t outModId, UInt_t fuProcessId, UInt_t fuGuid, UChar_t *data, UInt_t dataSize)
std::queue< UInt_t > freeResourceIds_
unsigned int fedSize(unsigned int i) const
void sendInitMessage(UInt_t fuResourceId, UInt_t outModId, UInt_t fuProcessId, UInt_t fuGuid, UChar_t *data, UInt_t dataSize, UInt_t nExpectedEPs)
UInt_t sendInitMessage(UInt_t fuResourceId, UInt_t outModId, UInt_t fuProcessId, UInt_t fuGuid, UChar_t *data, UInt_t dataSize, UInt_t nExpectedEPs)
std::vector< UInt_t > UIntVec_t