#include <IPCMethod.h>
Public Member Functions | |
UInt_t | allocateResource () |
virtual bool | buildResource (MemRef_t *bufRef)=0 |
virtual std::vector< UInt_t > | cellEvtNumbers () const =0 |
virtual std::vector< pid_t > | cellPrcIds () const =0 |
virtual std::vector< std::string > | cellStates () const =0 |
virtual std::vector< time_t > | cellTimeStamps () const =0 |
virtual void | clear ()=0 |
virtual std::vector< pid_t > | clientPrcIds () const =0 |
virtual std::string | clientPrcIdsAsString () const =0 |
virtual bool | discard ()=0 |
virtual bool | discardDataEvent (MemRef_t *bufRef)=0 |
virtual bool | discardDataEventWhileHalting (MemRef_t *bufRef)=0 |
virtual bool | discardDqmEvent (MemRef_t *bufRef)=0 |
virtual bool | discardDqmEventWhileHalting (MemRef_t *bufRef)=0 |
virtual bool | discardWhileHalting (bool sendDiscards)=0 |
virtual std::vector< std::string > | dqmCellStates () const =0 |
virtual void | dropEvent ()=0 |
void | dumpEvent (evf::FUShmRawCell *cell) |
virtual bool | handleCrashedEP (UInt_t runNumber, pid_t pid)=0 |
void | injectCRCError () |
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) throw (evf::Exception) | |
bool | isActive () const |
bool | isLastMessageOfEvent (MemRef_t *bufRef) |
bool | isReadyToShutDown () const |
virtual void | lastResort ()=0 |
void | lock () |
UInt_t | nbAllocated () const |
UInt_t | nbAllocSent () const |
virtual UInt_t | nbClients () const =0 |
UInt_t | nbCompleted () const |
UInt_t | nbCrcErrors () const |
UInt_t | nbDiscarded () const |
UInt_t | nbEolDiscarded () const |
UInt_t | nbEolPosted () const |
UInt_t | nbErrors () const |
UInt_t | nbFreeSlots () const |
UInt_t | nbLost () const |
UInt_t | nbPending () const |
UInt_t | nbPendingSMDiscards () const |
int | nbPendingSMDqmDiscards () const |
virtual UInt_t | nbResources () const =0 |
UInt_t | nbSent () const |
UInt_t | nbSentDqm () const |
UInt_t | nbSentError () const |
virtual void | postEndOfLumiSection (MemRef_t *bufRef)=0 |
virtual std::string | printStatus () |
void | releaseResources () |
releases all FUResource's | |
virtual void | resetCounters ()=0 |
virtual void | resetIPC ()=0 |
resets the underlying IPC method to the initial state | |
void | resetPendingAllocates () |
resets free resources to the maximum number | |
void | sendAllocate () |
virtual bool | sendData ()=0 |
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) |
virtual bool | sendDataWhileHalting ()=0 |
void | sendDiscard (UInt_t buResourceId) |
virtual bool | sendDqm ()=0 |
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) |
virtual bool | sendDqmWhileHalting ()=0 |
void | sendErrorEvent (UInt_t fuResourceId, UInt_t runNumber, UInt_t evtNumber, UInt_t fuProcessId, UInt_t fuGuid, UChar_t *data, UInt_t dataSize) |
void | sendInitMessage (UInt_t fuResourceId, UInt_t outModId, UInt_t fuProcessId, UInt_t fuGuid, UChar_t *data, UInt_t dataSize, UInt_t nExpectedEPs) |
void | setActive (bool activeValue) |
void | setDoCrcCheck (UInt_t doCrcCheck) |
void | setDoDumpEvents (UInt_t doDumpEvents) |
void | setReadyToShutDown (bool readyValue) |
void | setRunNumber (UInt_t runNumber) |
void | setStopFlag (bool status) |
virtual void | shutDownClients ()=0 |
UInt_t | shutdownStatus () |
UInt_t | sumOfSizes () const |
uint64_t | sumOfSquares () const |
void | unlock () |
virtual | ~IPCMethod () |
Protected Attributes | |
bool * | acceptSMDataDiscard_ |
int * | acceptSMDqmDiscard_ |
xdaq::Application * | app_ |
BUProxy * | bu_ |
UInt_t | doCrcCheck_ |
UInt_t | doDumpEvents_ |
EvffedFillerRB * | frb_ |
std::queue< UInt_t > | freeResourceIds_ |
unsigned int | freeResRequiredForAllocate_ |
bool | isActive_ |
bool | isReadyToShutDown_ |
sem_t | lock_ |
log4cplus::Logger | log_ |
UInt_t | nbAllocated_ |
UInt_t | nbAllocSent_ |
UInt_t | nbClientsToShutDown_ |
UInt_t | nbCompleted_ |
UInt_t | nbCrcErrors_ |
UInt_t | nbDiscarded_ |
UInt_t | nbDqmCells_ |
UInt_t | nbEolDiscarded_ |
UInt_t | nbEolPosted_ |
UInt_t | nbErrors_ |
UInt_t | nbLost_ |
UInt_t | nbPending_ |
UInt_t | nbPendingSMDiscards_ |
std::atomic< int > | nbPendingSMDqmDiscards_ |
UInt_t | nbRawCells_ |
UInt_t | nbRecoCells_ |
UInt_t | nbSent_ |
UInt_t | nbSentDqm_ |
UInt_t | nbSentError_ |
FUResourceVec_t | resources_ |
UInt_t | runNumber_ |
UInt_t | shutdownStatus_ |
unsigned int | shutdownTimeout_ |
SMProxy * | sm_ |
bool | stopFlag_ |
UInt_t | sumOfSizes_ |
uint64_t | sumOfSquares_ |
Base class for methods (types) of IPC. Subclasses: FUResourceTable, FUResourceQueue.
Definition at line 42 of file IPCMethod.h.
IPCMethod::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 | ||
) | throw (evf::Exception) |
Definition at line 28 of file IPCMethod.cc.
: bu_(bu), sm_(sm), log_(logger), nbDqmCells_(nbDqmCells), nbRawCells_(nbRawCells), nbRecoCells_(nbRecoCells), acceptSMDataDiscard_(0), acceptSMDqmDiscard_(0), doCrcCheck_(1), shutdownTimeout_(timeout), nbPending_(0), nbClientsToShutDown_(0), isReadyToShutDown_(true), isActive_(false), runNumber_(0xffffffff), frb_(frb), app_(app) { // if the freeResRequiredForAllocate_ threshold is set in configuration use that // otherwise use nbRawCells / 2 if (freeResReq < 0) freeResRequiredForAllocate_ = nbRawCells_ / 2; else freeResRequiredForAllocate_ = freeResReq; sem_init(&lock_, 0, 1); //pthread_mutex_init(&crashHandlerLock_, NULL); }
IPCMethod::~IPCMethod | ( | ) | [virtual] |
Definition at line 51 of file IPCMethod.cc.
{ }
UInt_t IPCMethod::allocateResource | ( | ) |
Returns the fuResourceId of the allocated resource
Definition at line 60 of file IPCMethod.cc.
References freeResourceIds_, lock(), nbAllocated_, nbPending_, and unlock().
Referenced by sendAllocate().
{ assert(!freeResourceIds_.empty()); lock(); UInt_t fuResourceId = freeResourceIds_.front(); freeResourceIds_.pop(); nbPending_++; nbAllocated_++; unlock(); return fuResourceId; }
virtual bool evf::IPCMethod::buildResource | ( | MemRef_t * | bufRef | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
virtual std::vector<UInt_t> evf::IPCMethod::cellEvtNumbers | ( | ) | const [pure virtual] |
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::SharedResources::watching().
virtual std::vector<pid_t> evf::IPCMethod::cellPrcIds | ( | ) | const [pure virtual] |
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::SharedResources::watching().
virtual std::vector<std::string> evf::IPCMethod::cellStates | ( | ) | const [pure virtual] |
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
virtual std::vector<time_t> evf::IPCMethod::cellTimeStamps | ( | ) | const [pure virtual] |
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::SharedResources::watching().
virtual void evf::IPCMethod::clear | ( | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
virtual std::vector<pid_t> evf::IPCMethod::clientPrcIds | ( | ) | const [pure virtual] |
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::Stopping::emergencyStop(), and evf::rb_statemachine::SharedResources::watching().
virtual std::string evf::IPCMethod::clientPrcIdsAsString | ( | ) | const [pure virtual] |
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
virtual bool evf::IPCMethod::discard | ( | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::SharedResources::discard().
virtual bool evf::IPCMethod::discardDataEvent | ( | MemRef_t * | bufRef | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
virtual bool evf::IPCMethod::discardDataEventWhileHalting | ( | MemRef_t * | bufRef | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
virtual bool evf::IPCMethod::discardDqmEvent | ( | MemRef_t * | bufRef | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
virtual bool evf::IPCMethod::discardDqmEventWhileHalting | ( | MemRef_t * | bufRef | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
virtual bool evf::IPCMethod::discardWhileHalting | ( | bool | sendDiscards | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::SharedResources::discard().
virtual std::vector<std::string> evf::IPCMethod::dqmCellStates | ( | ) | const [pure virtual] |
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
virtual void evf::IPCMethod::dropEvent | ( | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
void IPCMethod::dumpEvent | ( | evf::FUShmRawCell * | cell | ) |
Dump event to ASCII file.
Reimplemented in evf::FUResourceQueue.
Definition at line 74 of file IPCMethod.cc.
References evf::FUShmRawCell::evtNumber(), evf::FUShmRawCell::fedAddr(), evf::FUShmRawCell::fedSize(), groupFilesInBlocks::fout, i, j, and evf::FUShmRawCell::nFed().
{ std::ostringstream oss; oss << "/tmp/evt" << cell->evtNumber() << ".dump"; ofstream fout(oss.str().c_str()); fout.fill('0'); fout << "#\n# evt " << cell->evtNumber() << "\n#\n" << endl; for (unsigned int i = 0; i < cell->nFed(); i++) { if (cell->fedSize(i) == 0) continue; fout << "# fedid " << i << endl; unsigned char* addr = cell->fedAddr(i); for (unsigned int j = 0; j < cell->fedSize(i); j++) { fout << std::setiosflags(std::ios::right) << std::setw(2) << std::hex << (int) (*addr) << std::dec; if ((j + 1) % 8) fout << " "; else fout << endl; ++addr; } fout << endl; } fout.close(); }
virtual bool evf::IPCMethod::handleCrashedEP | ( | UInt_t | runNumber, |
pid_t | pid | ||
) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::Stopping::emergencyStop(), and evf::rb_statemachine::SharedResources::watching().
void IPCMethod::injectCRCError | ( | ) |
Definition at line 264 of file IPCMethod.cc.
References i, and resources_.
{ for (UInt_t i = 0; i < resources_.size(); i++) { resources_[i]->scheduleCRCError(); } }
bool evf::IPCMethod::isActive | ( | ) | const [inline] |
Check if resource table is active (enabled).
Definition at line 175 of file IPCMethod.h.
References isActive_.
{ return isActive_; }
bool IPCMethod::isLastMessageOfEvent | ( | MemRef_t * | bufRef | ) |
Definition at line 248 of file IPCMethod.cc.
References Association::block.
Referenced by evf::FUResourceQueue::buildResource().
{ while (0 != bufRef->getNextReference()) bufRef = bufRef->getNextReference(); I2O_EVENT_DATA_BLOCK_MESSAGE_FRAME *block = (I2O_EVENT_DATA_BLOCK_MESSAGE_FRAME*) bufRef->getDataLocation(); UInt_t iBlock = block->blockNb; UInt_t nBlock = block->nbBlocksInSuperFragment; UInt_t iSuperFrag = block->superFragmentNb; UInt_t nSuperFrag = block->nbSuperFragmentsInEvent; return ((iSuperFrag == nSuperFrag - 1) && (iBlock == nBlock - 1)); }
bool evf::IPCMethod::isReadyToShutDown | ( | ) | const [inline] |
Check if resource table can be safely destroyed.
Definition at line 186 of file IPCMethod.h.
References isReadyToShutDown_.
Referenced by evf::rb_statemachine::Stopping::emergencyStop().
{ return isReadyToShutDown_; }
virtual void evf::IPCMethod::lastResort | ( | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::Stopping::emergencyStop().
void evf::IPCMethod::lock | ( | void | ) | [inline] |
Definition at line 306 of file IPCMethod.h.
Referenced by allocateResource(), evf::FUResourceQueue::buildResource(), evf::FUResourceQueue::discard(), evf::FUResourceQueue::discardWhileHalting(), evf::FUResourceQueue::sendData(), and evf::FUResourceQueue::sendDataWhileHalting().
UInt_t evf::IPCMethod::nbAllocated | ( | ) | const [inline] |
UInt_t evf::IPCMethod::nbAllocSent | ( | ) | const [inline] |
virtual UInt_t evf::IPCMethod::nbClients | ( | ) | const [pure virtual] |
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
UInt_t evf::IPCMethod::nbCompleted | ( | ) | const [inline] |
UInt_t evf::IPCMethod::nbCrcErrors | ( | ) | const [inline] |
UInt_t evf::IPCMethod::nbDiscarded | ( | ) | const [inline] |
UInt_t evf::IPCMethod::nbEolDiscarded | ( | ) | const [inline] |
UInt_t evf::IPCMethod::nbEolPosted | ( | ) | const [inline] |
UInt_t evf::IPCMethod::nbErrors | ( | ) | const [inline] |
UInt_t evf::IPCMethod::nbFreeSlots | ( | ) | const [inline] |
Definition at line 204 of file IPCMethod.h.
References freeResourceIds_.
Referenced by evf::rb_statemachine::SharedResources::configureResources(), sendAllocate(), and evf::rb_statemachine::SharedResources::watching().
{ return freeResourceIds_.size(); }
UInt_t evf::IPCMethod::nbLost | ( | ) | const [inline] |
UInt_t evf::IPCMethod::nbPending | ( | ) | const [inline] |
UInt_t evf::IPCMethod::nbPendingSMDiscards | ( | ) | const [inline] |
Definition at line 225 of file IPCMethod.h.
References nbPendingSMDiscards_.
{ return nbPendingSMDiscards_; }
int evf::IPCMethod::nbPendingSMDqmDiscards | ( | ) | const [inline] |
Definition at line 228 of file IPCMethod.h.
References nbPendingSMDqmDiscards_.
{ return nbPendingSMDqmDiscards_; }
virtual UInt_t evf::IPCMethod::nbResources | ( | ) | const [pure virtual] |
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::SharedResources::configureResources(), and evf::rb_statemachine::SharedResources::watching().
UInt_t evf::IPCMethod::nbSent | ( | ) | const [inline] |
Definition at line 216 of file IPCMethod.h.
References nbSent_.
Referenced by evf::rb_statemachine::SharedResources::monitoring(), evf::FUResourceQueue::sendData(), and evf::FUResourceQueue::sendDataWhileHalting().
{ return nbSent_; }
UInt_t evf::IPCMethod::nbSentDqm | ( | ) | const [inline] |
UInt_t evf::IPCMethod::nbSentError | ( | ) | const [inline] |
virtual void evf::IPCMethod::postEndOfLumiSection | ( | MemRef_t * | bufRef | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
std::string IPCMethod::printStatus | ( | ) | [virtual] |
Print debugging status.
Reimplemented in evf::FUResourceTable.
Definition at line 101 of file IPCMethod.cc.
References alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string s = "Status not implemented"; return s; }
void IPCMethod::releaseResources | ( | ) |
releases all FUResource's
Definition at line 143 of file IPCMethod.cc.
References i, fetchall_from_DQM_v2::release, and resources_.
{ for (UInt_t i = 0; i < resources_.size(); i++) resources_[i]->release(true); }
virtual void evf::IPCMethod::resetCounters | ( | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::Enabling::do_stateAction().
virtual void evf::IPCMethod::resetIPC | ( | ) | [pure virtual] |
resets the underlying IPC method to the initial state
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
void IPCMethod::resetPendingAllocates | ( | ) |
resets free resources to the maximum number
Definition at line 129 of file IPCMethod.cc.
References freeResourceIds_, i, log_, and nbRawCells_.
{ if (freeResourceIds_.size() < nbRawCells_) { LOG4CPLUS_INFO( log_, "There are " << nbRawCells_ - freeResourceIds_.size() << " pending ALLOCATE messages! Forgetting..."); while (!freeResourceIds_.empty()) freeResourceIds_.pop(); for (UInt_t i = 0; i < nbRawCells_; i++) freeResourceIds_.push(i); } }
void IPCMethod::sendAllocate | ( | ) |
Definition at line 111 of file IPCMethod.cc.
References allocateResource(), bu_, freeResRequiredForAllocate_, i, nbAllocSent_, nbFreeSlots(), and evf::BUProxy::sendAllocate().
Referenced by evf::FUResourceQueue::buildResource(), evf::FUResourceQueue::discard(), evf::FUResourceQueue::discardWhileHalting(), and evf::rb_statemachine::Enabling::do_stateAction().
{ UInt_t nbFreeSlots = this->nbFreeSlots(); /*UInt_t nbFreeSlotsMax = 0*///reverting to larger chunk requests for BU //UInt_t nbFreeSlotsMax = nbResources() / 2; UInt_t nbFreeSlotsMax = freeResRequiredForAllocate_; if (nbFreeSlots > nbFreeSlotsMax) { UIntVec_t fuResourceIds; for (UInt_t i = 0; i < nbFreeSlots; i++) fuResourceIds.push_back(allocateResource()); bu_->sendAllocate(fuResourceIds); nbAllocSent_++; } }
virtual bool evf::IPCMethod::sendData | ( | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::SharedResources::sendData().
void IPCMethod::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 | ||
) |
Definition at line 171 of file IPCMethod.cc.
References acceptSMDataDiscard_, log_, evf::SMProxy::sendDataEvent(), sm_, sumOfSizes_, and sumOfSquares_.
Referenced by evf::FUResourceQueue::sendData(), and evf::FUResourceQueue::sendDataWhileHalting().
{ if (0 == sm_) { LOG4CPLUS_ERROR(log_, "No StorageManager, DROP DATA EVENT!"); } else { acceptSMDataDiscard_[fuResourceId] = true; UInt_t nbBytes = sm_->sendDataEvent(fuResourceId, runNumber, evtNumber, outModId, fuProcessId, fuGuid, data, dataSize); sumOfSquares_ += (uint64_t) nbBytes * (uint64_t) nbBytes; sumOfSizes_ += nbBytes; } }
virtual bool evf::IPCMethod::sendDataWhileHalting | ( | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::SharedResources::sendData().
void IPCMethod::sendDiscard | ( | UInt_t | buResourceId | ) |
Definition at line 150 of file IPCMethod.cc.
References bu_, nbDiscarded_, and evf::BUProxy::sendDiscard().
Referenced by evf::FUResourceQueue::discard(), and evf::FUResourceQueue::discardWhileHalting().
{ bu_->sendDiscard(buResourceId); nbDiscarded_++; }
virtual bool evf::IPCMethod::sendDqm | ( | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::SharedResources::sendDqm().
void IPCMethod::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 | ||
) |
Definition at line 224 of file IPCMethod.cc.
References acceptSMDqmDiscard_, log_, nbPendingSMDqmDiscards_, nbSentDqm_, evf::SMProxy::sendDqmEvent(), and sm_.
Referenced by evf::FUResourceQueue::sendDqm(), and evf::FUResourceQueue::sendDqmWhileHalting().
{ if (0 == sm_) { LOG4CPLUS_WARN(log_, "No StorageManager, DROP DQM EVENT."); } else { nbPendingSMDqmDiscards_++; acceptSMDqmDiscard_[fuDqmId]++; if (acceptSMDqmDiscard_[fuDqmId] > 1) LOG4CPLUS_WARN( log_, "DQM Cell " << fuDqmId << " being sent more than once for folder " << folderId << " process " << fuProcessId << " guid " << fuGuid); nbSentDqm_++; sm_->sendDqmEvent(fuDqmId, runNumber, evtAtUpdate, folderId, fuProcessId, fuGuid, data, dataSize); } }
virtual bool evf::IPCMethod::sendDqmWhileHalting | ( | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
Referenced by evf::rb_statemachine::SharedResources::sendDqm().
void IPCMethod::sendErrorEvent | ( | UInt_t | fuResourceId, |
UInt_t | runNumber, | ||
UInt_t | evtNumber, | ||
UInt_t | fuProcessId, | ||
UInt_t | fuGuid, | ||
UChar_t * | data, | ||
UInt_t | dataSize | ||
) |
Definition at line 186 of file IPCMethod.cc.
References acceptSMDataDiscard_, log_, evf::SMProxy::sendErrorEvent(), sm_, sumOfSizes_, and sumOfSquares_.
Referenced by evf::FUResourceQueue::sendData(), and evf::FUResourceQueue::sendDataWhileHalting().
{ if (0 == sm_) { LOG4CPLUS_ERROR(log_, "No StorageManager, DROP ERROR EVENT!"); } else { acceptSMDataDiscard_[fuResourceId] = true; UInt_t nbBytes = sm_->sendErrorEvent(fuResourceId, runNumber, evtNumber, fuProcessId, fuGuid, data, dataSize); sumOfSquares_ += (uint64_t) nbBytes * (uint64_t) nbBytes; sumOfSizes_ += nbBytes; } // if (0!=shmBuffer_) { // UInt_t n=nbDqmCells_; // for (UInt_t i=0;i<n;i++) { // if(shmBuffer_->dqmCell(i)->fuProcessId()==fuProcessId) // { // if(shmBuffer_->dqmState(i)!=dqm::SENT){ // shmBuffer_->setDqmState(i,dqm::SENT); // shmBuffer_->discardDqmCell(i); // acceptSMDqmDiscard_[i] = false; // } // } // } // n=nbRecoCells_; // for (UInt_t i=0;i<n;i++) { // if(shmBuffer_->recoCell(i)->fuProcessId()==fuProcessId) // { // shmBuffer_->discardOrphanedRecoCell(i); // } // } // } }
void IPCMethod::sendInitMessage | ( | UInt_t | fuResourceId, |
UInt_t | outModId, | ||
UInt_t | fuProcessId, | ||
UInt_t | fuGuid, | ||
UChar_t * | data, | ||
UInt_t | dataSize, | ||
UInt_t | nExpectedEPs | ||
) |
Definition at line 156 of file IPCMethod.cc.
References acceptSMDataDiscard_, log_, evf::SMProxy::sendInitMessage(), sm_, sumOfSizes_, and sumOfSquares_.
Referenced by evf::FUResourceQueue::sendData(), and evf::FUResourceQueue::sendDataWhileHalting().
{ if (0 == sm_) { LOG4CPLUS_ERROR(log_, "No StorageManager, DROP INIT MESSAGE!"); } else { acceptSMDataDiscard_[fuResourceId] = true; UInt_t nbBytes = sm_->sendInitMessage(fuResourceId, outModId, fuProcessId, fuGuid, data, dataSize, nExpectedEPs); sumOfSquares_ += (uint64_t) nbBytes * (uint64_t) nbBytes; sumOfSizes_ += nbBytes; } }
void evf::IPCMethod::setActive | ( | bool | activeValue | ) | [inline] |
Definition at line 179 of file IPCMethod.h.
References isActive_.
Referenced by evf::rb_statemachine::SharedResources::startDiscardWorkLoop().
{ isActive_ = activeValue; }
void evf::IPCMethod::setDoCrcCheck | ( | UInt_t | doCrcCheck | ) | [inline] |
Tell resources whether to check the CRC
Definition at line 161 of file IPCMethod.h.
References doCrcCheck_.
Referenced by evf::rb_statemachine::SharedResources::configureResources().
{ doCrcCheck_ = doCrcCheck; }
void evf::IPCMethod::setDoDumpEvents | ( | UInt_t | doDumpEvents | ) | [inline] |
Tell resources whether to dump events to an ASCII file.
Definition at line 168 of file IPCMethod.h.
References doDumpEvents_.
Referenced by evf::rb_statemachine::SharedResources::configureResources().
{ doDumpEvents_ = doDumpEvents; }
void evf::IPCMethod::setReadyToShutDown | ( | bool | readyValue | ) | [inline] |
Definition at line 190 of file IPCMethod.h.
References isReadyToShutDown_.
Referenced by evf::rb_statemachine::SharedResources::startDiscardWorkLoop().
{ isReadyToShutDown_ = readyValue; }
void evf::IPCMethod::setRunNumber | ( | UInt_t | runNumber | ) | [inline] |
Definition at line 61 of file IPCMethod.h.
References convertSQLiteXML::runNumber, and runNumber_.
Referenced by evf::rb_statemachine::Enabling::do_stateAction().
{ runNumber_ = runNumber; }
void evf::IPCMethod::setStopFlag | ( | bool | status | ) | [inline] |
Definition at line 198 of file IPCMethod.h.
References ntuplemaker::status, and stopFlag_.
virtual void evf::IPCMethod::shutDownClients | ( | ) | [pure virtual] |
Has to be implemented by subclasses, according to IPC type.
Implemented in evf::FUResourceQueue, and evf::FUResourceTable.
UInt_t evf::IPCMethod::shutdownStatus | ( | ) | [inline] |
Definition at line 194 of file IPCMethod.h.
References shutdownStatus_.
Referenced by evf::rb_statemachine::Stopping::emergencyStop().
{ return shutdownStatus_; }
UInt_t evf::IPCMethod::sumOfSizes | ( | ) | const [inline] |
Definition at line 259 of file IPCMethod.h.
References sumOfSizes_.
Referenced by evf::rb_statemachine::SharedResources::monitoring().
{ return sumOfSizes_; }
uint64_t evf::IPCMethod::sumOfSquares | ( | ) | const [inline] |
Definition at line 256 of file IPCMethod.h.
References sumOfSquares_.
Referenced by evf::rb_statemachine::SharedResources::monitoring().
{ return sumOfSquares_; }
void evf::IPCMethod::unlock | ( | void | ) | [inline] |
Definition at line 314 of file IPCMethod.h.
References lock_.
Referenced by allocateResource(), evf::FUResourceQueue::buildResource(), evf::FUResourceQueue::discard(), evf::FUResourceQueue::discardWhileHalting(), evf::FUResourceQueue::sendData(), and evf::FUResourceQueue::sendDataWhileHalting().
{ //lock_.give(); sem_post(&lock_); }
bool* evf::IPCMethod::acceptSMDataDiscard_ [protected] |
Definition at line 352 of file IPCMethod.h.
Referenced by sendDataEvent(), sendErrorEvent(), and sendInitMessage().
int* evf::IPCMethod::acceptSMDqmDiscard_ [protected] |
Definition at line 353 of file IPCMethod.h.
Referenced by sendDqmEvent().
xdaq::Application* evf::IPCMethod::app_ [protected] |
Definition at line 391 of file IPCMethod.h.
BUProxy* evf::IPCMethod::bu_ [protected] |
Definition at line 339 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::buildResource(), sendAllocate(), and sendDiscard().
UInt_t evf::IPCMethod::doCrcCheck_ [protected] |
Definition at line 355 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::buildResource(), and setDoCrcCheck().
UInt_t evf::IPCMethod::doDumpEvents_ [protected] |
Definition at line 356 of file IPCMethod.h.
Referenced by setDoDumpEvents().
EvffedFillerRB* evf::IPCMethod::frb_ [protected] |
Definition at line 390 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::buildResource().
std::queue<UInt_t> evf::IPCMethod::freeResourceIds_ [protected] |
Definition at line 348 of file IPCMethod.h.
Referenced by allocateResource(), evf::FUResourceQueue::buildResource(), evf::FUResourceQueue::clear(), evf::FUResourceQueue::discard(), evf::FUResourceQueue::discardWhileHalting(), nbFreeSlots(), and resetPendingAllocates().
unsigned int evf::IPCMethod::freeResRequiredForAllocate_ [protected] |
Definition at line 350 of file IPCMethod.h.
Referenced by sendAllocate().
bool evf::IPCMethod::isActive_ [protected] |
Definition at line 375 of file IPCMethod.h.
Referenced by isActive(), and setActive().
bool evf::IPCMethod::isReadyToShutDown_ [protected] |
Definition at line 374 of file IPCMethod.h.
Referenced by isReadyToShutDown(), setReadyToShutDown(), and evf::FUResourceQueue::shutDownClients().
sem_t evf::IPCMethod::lock_ [protected] |
Definition at line 386 of file IPCMethod.h.
log4cplus::Logger evf::IPCMethod::log_ [protected] |
Definition at line 342 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::buildResource(), lock(), resetPendingAllocates(), evf::FUResourceQueue::sendData(), sendDataEvent(), evf::FUResourceQueue::sendDataWhileHalting(), evf::FUResourceQueue::sendDqm(), sendDqmEvent(), evf::FUResourceQueue::sendDqmWhileHalting(), sendErrorEvent(), sendInitMessage(), and evf::FUResourceQueue::~FUResourceQueue().
UInt_t evf::IPCMethod::nbAllocated_ [protected] |
Definition at line 359 of file IPCMethod.h.
Referenced by allocateResource(), evf::FUResourceQueue::buildResource(), nbAllocated(), and evf::FUResourceQueue::resetCounters().
UInt_t evf::IPCMethod::nbAllocSent_ [protected] |
Definition at line 379 of file IPCMethod.h.
Referenced by nbAllocSent(), evf::FUResourceQueue::resetCounters(), and sendAllocate().
UInt_t evf::IPCMethod::nbClientsToShutDown_ [protected] |
Definition at line 373 of file IPCMethod.h.
UInt_t evf::IPCMethod::nbCompleted_ [protected] |
Definition at line 361 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::buildResource(), nbCompleted(), and evf::FUResourceQueue::resetCounters().
UInt_t evf::IPCMethod::nbCrcErrors_ [protected] |
Definition at line 378 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::buildResource(), nbCrcErrors(), and evf::FUResourceQueue::resetCounters().
UInt_t evf::IPCMethod::nbDiscarded_ [protected] |
Definition at line 367 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::buildResource(), nbDiscarded(), evf::FUResourceQueue::resetCounters(), and sendDiscard().
UInt_t evf::IPCMethod::nbDqmCells_ [protected] |
Definition at line 344 of file IPCMethod.h.
UInt_t evf::IPCMethod::nbEolDiscarded_ [protected] |
Definition at line 371 of file IPCMethod.h.
Referenced by nbEolDiscarded().
UInt_t evf::IPCMethod::nbEolPosted_ [protected] |
Definition at line 370 of file IPCMethod.h.
Referenced by nbEolPosted().
UInt_t evf::IPCMethod::nbErrors_ [protected] |
Definition at line 377 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::buildResource(), nbErrors(), and evf::FUResourceQueue::resetCounters().
UInt_t evf::IPCMethod::nbLost_ [protected] |
Definition at line 368 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::buildResource(), nbLost(), and evf::FUResourceQueue::resetCounters().
UInt_t evf::IPCMethod::nbPending_ [protected] |
Definition at line 360 of file IPCMethod.h.
Referenced by allocateResource(), evf::FUResourceQueue::buildResource(), nbPending(), and evf::FUResourceQueue::resetCounters().
UInt_t evf::IPCMethod::nbPendingSMDiscards_ [protected] |
Definition at line 365 of file IPCMethod.h.
Referenced by nbPendingSMDiscards(), evf::FUResourceQueue::resetCounters(), evf::FUResourceQueue::sendData(), and evf::FUResourceQueue::sendDataWhileHalting().
std::atomic<int> evf::IPCMethod::nbPendingSMDqmDiscards_ [protected] |
Definition at line 366 of file IPCMethod.h.
Referenced by nbPendingSMDqmDiscards(), evf::FUResourceQueue::resetCounters(), and sendDqmEvent().
UInt_t evf::IPCMethod::nbRawCells_ [protected] |
Definition at line 345 of file IPCMethod.h.
Referenced by resetPendingAllocates().
UInt_t evf::IPCMethod::nbRecoCells_ [protected] |
Definition at line 346 of file IPCMethod.h.
UInt_t evf::IPCMethod::nbSent_ [protected] |
Definition at line 362 of file IPCMethod.h.
Referenced by nbSent(), evf::FUResourceQueue::resetCounters(), evf::FUResourceQueue::sendData(), and evf::FUResourceQueue::sendDataWhileHalting().
UInt_t evf::IPCMethod::nbSentDqm_ [protected] |
Definition at line 364 of file IPCMethod.h.
Referenced by nbSentDqm(), evf::FUResourceQueue::resetCounters(), and sendDqmEvent().
UInt_t evf::IPCMethod::nbSentError_ [protected] |
Definition at line 363 of file IPCMethod.h.
Referenced by nbSentError(), evf::FUResourceQueue::resetCounters(), evf::FUResourceQueue::sendData(), and evf::FUResourceQueue::sendDataWhileHalting().
FUResourceVec_t evf::IPCMethod::resources_ [protected] |
Definition at line 393 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::buildResource(), evf::FUResourceQueue::clear(), evf::FUResourceQueue::discard(), evf::FUResourceQueue::discardWhileHalting(), injectCRCError(), evf::FUResourceTable::nbResources(), releaseResources(), evf::FUResourceQueue::sendData(), and evf::FUResourceQueue::sendDataWhileHalting().
UInt_t evf::IPCMethod::runNumber_ [protected] |
Definition at line 384 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::sendData(), evf::FUResourceQueue::sendDataWhileHalting(), and setRunNumber().
UInt_t evf::IPCMethod::shutdownStatus_ [protected] |
Definition at line 395 of file IPCMethod.h.
Referenced by shutdownStatus().
unsigned int evf::IPCMethod::shutdownTimeout_ [protected] |
Definition at line 357 of file IPCMethod.h.
SMProxy* evf::IPCMethod::sm_ [protected] |
Definition at line 340 of file IPCMethod.h.
Referenced by sendDataEvent(), sendDqmEvent(), sendErrorEvent(), and sendInitMessage().
bool evf::IPCMethod::stopFlag_ [protected] |
Definition at line 396 of file IPCMethod.h.
Referenced by setStopFlag().
UInt_t evf::IPCMethod::sumOfSizes_ [protected] |
Definition at line 382 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::resetCounters(), sendDataEvent(), sendErrorEvent(), sendInitMessage(), and sumOfSizes().
uint64_t evf::IPCMethod::sumOfSquares_ [protected] |
Definition at line 381 of file IPCMethod.h.
Referenced by evf::FUResourceQueue::resetCounters(), sendDataEvent(), sendErrorEvent(), sendInitMessage(), and sumOfSquares().