#include <FUResourceTable.h>
Public Member Functions | |
bool | buildResource (MemRef_t *bufRef) |
std::vector< UInt_t > | cellEvtNumbers () const |
std::vector< pid_t > | cellPrcIds () const |
std::vector< std::string > | cellStates () const |
std::vector< time_t > | cellTimeStamps () const |
void | clear () |
std::vector< pid_t > | clientPrcIds () const |
std::string | clientPrcIdsAsString () const |
bool | discard () |
bool | discardDataEvent (MemRef_t *bufRef) |
bool | discardDataEventWhileHalting (MemRef_t *bufRef) |
bool | discardDqmEvent (MemRef_t *bufRef) |
bool | discardDqmEventWhileHalting (MemRef_t *bufRef) |
bool | discardWhileHalting (bool sendDiscards) |
std::vector< std::string > | dqmCellStates () const |
void | dropEvent () |
FUResourceTable (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, EvffedFillerRB *frb, xdaq::Application *) throw (evf::Exception) | |
bool | handleCrashedEP (UInt_t runNumber, pid_t pid) |
void | initialize (bool segmentationMode, UInt_t nbRawCells, UInt_t nbRecoCells, UInt_t nbDqmCells, UInt_t rawCellSize, UInt_t recoCellSize, UInt_t dqmCellSize) throw (evf::Exception) |
void | lastResort () |
UInt_t | nbClients () const |
UInt_t | nbResources () const |
unsigned int | nbResources () |
void | postEndOfLumiSection (MemRef_t *bufRef) |
std::string | printStatus () |
void | resetCounters () |
void | resetIPC () |
reset the ShmBuffer to the initial state More... | |
bool | sendData () |
bool | sendDataWhileHalting () |
bool | sendDqm () |
bool | sendDqmWhileHalting () |
void | shutDownClients () |
virtual | ~FUResourceTable () |
Public Member Functions inherited from evf::IPCMethod | |
UInt_t | allocateResource () |
void | dumpEvent (evf::FUShmRawCell *cell) |
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 |
void | lock () |
UInt_t | nbAllocated () const |
UInt_t | nbAllocSent () const |
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 |
UInt_t | nbSent () const |
UInt_t | nbSentDqm () const |
UInt_t | nbSentError () const |
void | releaseResources () |
releases all FUResource's More... | |
void | resetPendingAllocates () |
resets free resources to the maximum number More... | |
void | sendAllocate () |
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) |
void | sendDiscard (UInt_t buResourceId) |
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) |
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) |
UInt_t | shutdownStatus () |
UInt_t | sumOfSizes () const |
uint64_t | sumOfSquares () const |
void | unlock () |
virtual | ~IPCMethod () |
Private Member Functions | |
void | discardNoReschedule () |
void | rethrowShmBufferException (evf::Exception &e, std::string where) const throw (evf::Exception) |
void | shutdownWatchdog (unsigned int timeout) |
Private Attributes | |
bool | sDataActive_ |
bool | sDqmActive_ |
FUShmBuffer * | shmBuffer_ |
std::atomic_bool | watchDogEnd_ |
std::atomic_bool | watchDogSetFailed_ |
Additional Inherited Members | |
Protected Attributes inherited from evf::IPCMethod | |
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_ |
Table of resources linked with the Shared Memory Buffer
Definition at line 40 of file FUResourceTable.h.
FUResourceTable::FUResourceTable | ( | 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 31 of file FUResourceTable.cc.
|
virtual |
Definition at line 48 of file FUResourceTable.cc.
References hitfit::clear(), and evf::FUShmBuffer::releaseSharedMemory().
|
virtual |
Process buffer received via I2O_FU_TAKE message
Implements evf::IPCMethod.
Definition at line 581 of file FUResourceTable.cc.
References evf::FUResource::allocate(), Association::block, gather_cfg::cout, evf::FUResource::doCrcCheck(), dumpEvent(), alignCSCRings::e, evf::FUResource::fatalError(), evf::FUResource::isAllocated(), evf::FUResource::isComplete(), CommonMethods::lock(), evf::FUResource::nbCrcErrors(), evf::FUResource::nbErrors(), cmsPerfSuiteHarvest::now, evf::FUResource::process(), evf::FUResource::release(), and evf::FUResource::shmCell().
|
virtual |
Implements evf::IPCMethod.
Definition at line 1325 of file FUResourceTable.cc.
References alignCSCRings::e, i, n, and query::result.
|
virtual |
Implements evf::IPCMethod.
Definition at line 1343 of file FUResourceTable.cc.
References alignCSCRings::e, i, n, and query::result.
|
virtual |
Implements evf::IPCMethod.
Definition at line 1246 of file FUResourceTable.cc.
References evf::evt::DISCARDING, alignCSCRings::e, evf::evt::EMPTY, i, evf::evt::LUMISECTION, n, evf::evt::PROCESSED, evf::evt::PROCESSING, evf::evt::RAWREAD, evf::evt::RAWREADING, evf::evt::RAWWRITING, evf::evt::RAWWRITTEN, evf::evt::RECOWRITING, evf::evt::RECOWRITTEN, query::result, evf::evt::SENDING, evf::evt::SENT, evf::utils::state, evf::evt::STOP, and evf::evt::USEDLS.
|
virtual |
Implements evf::IPCMethod.
Definition at line 1360 of file FUResourceTable.cc.
References alignCSCRings::e, i, n, and query::result.
|
virtual |
Clear contents of resource table. (empty all containers)
Implements evf::IPCMethod.
Definition at line 1142 of file FUResourceTable.cc.
References i.
Referenced by Vispa.Views.WidgetView.WidgetView::closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), Vispa.Share.FindAlgorithm.FindAlgorithm::findUsingFindDialog(), Vispa.Views.LineDecayView.LineDecayView::setDataObjects(), Vispa.Views.WidgetView.WidgetView::setDataObjects(), Vispa.Views.TreeView.TreeView::updateContent(), Vispa.Views.TableView.TableView::updateContent(), Vispa.Views.BoxDecayView.BoxDecayView::updateContent(), and Vispa.Views.PropertyView.PropertyView::updateContent().
|
virtual |
Implements evf::IPCMethod.
Definition at line 1211 of file FUResourceTable.cc.
References alignCSCRings::e, i, n, and query::result.
|
virtual |
Implements evf::IPCMethod.
Definition at line 1227 of file FUResourceTable.cc.
References alignCSCRings::e, i, and n.
|
virtual |
Corresponds to the Discard workloop, to be called in normal operation.
Implements evf::IPCMethod.
Definition at line 438 of file FUResourceTable.cc.
References evf::FUShmRawCell::buResourceId(), alignCSCRings::e, evf::evt::EMPTY, evf::FUShmRawCell::fuResourceId(), evf::FUShmRawCell::index(), CommonMethods::lock(), evf::utils::state, evf::evt::STOP, and evf::evt::USEDLS.
|
virtual |
Process buffer received via I2O_SM_DATA_DISCARD message in normal operation.
Implements evf::IPCMethod.
Definition at line 693 of file FUResourceTable.cc.
References alignCSCRings::e, CommonMethods::lock(), lumiQueryAPI::msg, and _I2O_FU_DATA_DISCARD_MESSAGE_FRAME::rbBufferID.
|
virtual |
Process buffer received via I2O_SM_DATA_DISCARD message while halting.
Implements evf::IPCMethod.
Definition at line 727 of file FUResourceTable.cc.
References CommonMethods::lock(), lumiQueryAPI::msg, and _I2O_FU_DATA_DISCARD_MESSAGE_FRAME::rbBufferID.
|
virtual |
Process buffer received via I2O_SM_DQM_DISCARD message in normal operation.
Implements evf::IPCMethod.
Definition at line 754 of file FUResourceTable.cc.
References alignCSCRings::e, lumiQueryAPI::msg, _I2O_FU_DQM_DISCARD_MESSAGE_FRAME::rbBufferID, and evf::dqm::SENT.
|
virtual |
Process buffer received via I2O_SM_DQM_DISCARD message while halting.
Implements evf::IPCMethod.
Definition at line 817 of file FUResourceTable.cc.
References alignCSCRings::e, lumiQueryAPI::msg, _I2O_FU_DQM_DISCARD_MESSAGE_FRAME::rbBufferID, and evf::dqm::SENT.
|
private |
Called when entering the shutdown cycle. The function sets readyToShutDown to true, allowing the Resource Table to be safely shut down.
Definition at line 354 of file FUResourceTable.cc.
References prof2calltree::count, gather_cfg::cout, alignCSCRings::e, evf::dqm::EMPTY, i, n, evf::FUShmBuffer::shm_nattch(), and evf::utils::state.
|
virtual |
Function called when FSM is in state stopping / halting, in Discard workloop.
Implements evf::IPCMethod.
Definition at line 507 of file FUResourceTable.cc.
References evf::FUShmRawCell::buResourceId(), alignCSCRings::e, evf::evt::EMPTY, evf::FUShmRawCell::fuResourceId(), evf::FUShmRawCell::index(), CommonMethods::lock(), evf::utils::state, evf::evt::STOP, and evf::evt::USEDLS.
|
virtual |
Implements evf::IPCMethod.
Definition at line 1294 of file FUResourceTable.cc.
References evf::dqm::DISCARDING, alignCSCRings::e, evf::dqm::EMPTY, i, n, query::result, evf::dqm::SENDING, evf::dqm::SENT, evf::utils::state, evf::dqm::WRITING, and evf::dqm::WRITTEN.
|
virtual |
Drop next available event.
Implements evf::IPCMethod.
Definition at line 908 of file FUResourceTable.cc.
References alignCSCRings::e, and evf::FUShmRawCell::fuResourceId().
|
virtual |
Send event belonging to crashed process to error stream. Return false if no event is found
Implements evf::IPCMethod.
Definition at line 926 of file FUResourceTable.cc.
References alignCSCRings::e, i, and summarizeEdmComparisonLogfiles::success.
void FUResourceTable::initialize | ( | bool | segmentationMode, |
UInt_t | nbRawCells, | ||
UInt_t | nbRecoCells, | ||
UInt_t | nbDqmCells, | ||
UInt_t | rawCellSize, | ||
UInt_t | recoCellSize, | ||
UInt_t | dqmCellSize | ||
) | |||
throw | ( | evf::Exception | |
) |
Initialization of the Resource Table with the required resources
Definition at line 65 of file FUResourceTable.cc.
References hitfit::clear(), evf::FUShmBuffer::createShmBuffer(), i, lumiQueryAPI::msg, and evf::FUResource::release().
|
virtual |
Has to be implemented by subclasses, according to IPC type.
Implements evf::IPCMethod.
Definition at line 1381 of file FUResourceTable.cc.
References gather_cfg::cout, alignCSCRings::e, and evf::FUShmRawCell::index().
|
virtual |
Implements evf::IPCMethod.
Definition at line 1199 of file FUResourceTable.cc.
References alignCSCRings::e, and query::result.
|
inlinevirtual |
Implements evf::IPCMethod.
Definition at line 145 of file FUResourceTable.h.
References evf::IPCMethod::resources_.
|
inline |
|
virtual |
Post End-of-LumiSection to Shared Memory.
Implements evf::IPCMethod.
Definition at line 881 of file FUResourceTable.cc.
References alignCSCRings::e, i, reco::if(), and lumiQueryAPI::msg.
|
virtual |
Print debugging status.
Reimplemented from evf::IPCMethod.
Definition at line 1430 of file FUResourceTable.cc.
References AlCaHLTBitMon_QueryRunRegistry::string.
|
virtual |
Reset event & error counters
Implements evf::IPCMethod.
Definition at line 1157 of file FUResourceTable.cc.
References alignCSCRings::e, and i.
|
virtual |
reset the ShmBuffer to the initial state
Implements evf::IPCMethod.
Definition at line 1412 of file FUResourceTable.cc.
References gather_cfg::cout.
|
private |
Rethrows an exception from the ShmBuffer including details.
Definition at line 1435 of file FUResourceTable.cc.
References alignCSCRings::e, and i.
|
virtual |
Corresponds to the SendData workloop, to be called in normal operation.
Implements evf::IPCMethod.
Definition at line 93 of file FUResourceTable.cc.
References alignCSCRings::e, evf::FUShmRecoCell::eventSize(), evf::FUShmRecoCell::evtNumber(), edm::hlt::Exception, evf::FUShmRecoCell::fuGuid(), evf::FUShmRecoCell::fuProcessId(), evf::FUShmRecoCell::index(), CommonMethods::lock(), evf::FUShmRecoCell::nExpectedEPs(), evf::FUShmRecoCell::outModId(), evf::FUShmRecoCell::payloadAddr(), evf::FUShmRecoCell::rawCellIndex(), evf::FUShmRecoCell::runNumber(), sistrip::runNumber_, and evf::FUShmRecoCell::type().
|
virtual |
Function called when FSM is in state stopping / halting, in SendData workloop.
Implements evf::IPCMethod.
Definition at line 212 of file FUResourceTable.cc.
References alignCSCRings::e, evf::FUShmRecoCell::eventSize(), and evf::FUShmRecoCell::index().
|
virtual |
Corresponds to the SendDqm workloop, to be called in normal operation.
Implements evf::IPCMethod.
Definition at line 251 of file FUResourceTable.cc.
References gather_cfg::cout, alignCSCRings::e, evf::dqm::EMPTY, evf::FUShmDqmCell::eventSize(), evf::FUShmDqmCell::evtAtUpdate(), edm::hlt::Exception, evf::FUShmDqmCell::folderId(), evf::FUShmDqmCell::fuGuid(), evf::FUShmDqmCell::fuProcessId(), evf::FUShmDqmCell::index(), evf::FUShmDqmCell::payloadAddr(), evf::FUShmDqmCell::runNumber(), and evf::utils::state.
|
virtual |
Function called when FSM is in state stopping / halting, in SendDqm workloop.
Implements evf::IPCMethod.
Definition at line 310 of file FUResourceTable.cc.
References gather_cfg::cout, alignCSCRings::e, evf::dqm::EMPTY, evf::FUShmDqmCell::index(), and evf::utils::state.
|
virtual |
Send empty events to notify clients to shutdown
Implements evf::IPCMethod.
Definition at line 984 of file FUResourceTable.cc.
References alignCSCRings::e, evf::evt::EMPTY, i, lumiQueryAPI::msg, n, evf::utils::pid, sistrip::runNumber_, shutdownWatchdog(), evf::utils::state, and ntuplemaker::status.
|
private |
Spawned as a thread watching for shutdown of clients.
Definition at line 963 of file FUResourceTable.cc.
Referenced by shutDownClients().
|
private |
Definition at line 194 of file FUResourceTable.h.
|
private |
Definition at line 195 of file FUResourceTable.h.
|
private |
Definition at line 191 of file FUResourceTable.h.
|
private |
Definition at line 197 of file FUResourceTable.h.
|
private |
Definition at line 198 of file FUResourceTable.h.