#include <SharedResources.h>
Public Member Functions | |
void | cancelAllWorkloops () |
void | configureResources (xdaq::Application *app) |
void | lock () |
void | lockRSAccess () |
void | printWorkLoopStatus () |
void | reset () |
void | setFsmPointer (RBStateMachine *const fsm) |
SharedResources (Logger log) | |
int | tryLockRSAccess () |
void | unlock () |
void | unlockRSAccess () |
void | updateGUIExternalState (std::string newState) |
void | updateGUIInternalState (std::string newState) |
~SharedResources () | |
Private Types | |
typedef toolbox::task::ActionSignature | ActionSignature_t |
typedef toolbox::task::WorkLoop | WorkLoop_t |
Private Member Functions | |
double | deltaT (const struct timeval *start, const struct timeval *end) |
bool | discard (toolbox::task::WorkLoop *wl) |
void | goToFailedState (evf::Exception &e) |
bool | monitoring (toolbox::task::WorkLoop *wl) |
bool | sendData (toolbox::task::WorkLoop *wl) |
bool | sendDqm (toolbox::task::WorkLoop *wl) |
void | startDiscardWorkLoop () throw (evf::Exception) |
void | startMonitoringWorkLoop () throw (evf::Exception) |
void | startSendDataWorkLoop () throw (evf::Exception) |
void | startSendDqmWorkLoop () throw (evf::Exception) |
void | startWatchingWorkLoop () throw (evf::Exception) |
bool | watching (toolbox::task::WorkLoop *wl) |
Private Attributes | |
sem_t | accessToResourceStructureLock_ |
bool | allowI2ODiscards_ |
ActionSignature_t * | asDiscard_ |
ActionSignature_t * | asMonitoring_ |
ActionSignature_t * | asSendData_ |
ActionSignature_t * | asSendDqm_ |
ActionSignature_t * | asWatching_ |
xdata::Double | average_ |
BUProxy * | bu_ |
xdata::String | buClassName_ |
xdata::UnsignedInteger32 | buInstance_ |
xdata::String | clientPrcIds_ |
CommandQueue | commands_ |
xdata::UnsignedInteger32 | dataErrorFlag_ |
xdata::UnsignedInteger32 | deltaN_ |
xdata::UnsignedInteger32 | deltaSumOfSizes_ |
xdata::Double | deltaSumOfSquares_ |
xdata::Double | deltaT_ |
xdata::UnsignedInteger32 | doCrcCheck_ |
xdata::Boolean | doDropEvents_ |
xdata::UnsignedInteger32 | doDumpEvents_ |
xdata::Boolean | doFedIdCheck_ |
xdata::UnsignedInteger32 | dqmCellSize_ |
EvffedFillerRB * | frb_ |
xdata::Integer | freeResRequiredForAllocate_ |
RBStateMachine * | fsm_ |
IndependentWebGUI * | gui_ |
xdata::UnsignedInteger32 | highestEolReceived_ |
toolbox::mem::Pool * | i2oPool_ |
IPCManager * | ipcManager_ |
sem_t | lock_ |
Logger | log_ |
xdata::UnsignedInteger32 | monSleepSec_ |
struct timeval | monStartTime_ |
xdata::UnsignedInteger32 | nbAllocatedEvents_ |
xdata::UnsignedInteger32 | nbAllocateSent_ |
xdata::UnsignedInteger32 | nbClients_ |
xdata::UnsignedInteger32 | nbCrcErrors_ |
xdata::UnsignedInteger32 | nbDataDiscardReceived_ |
xdata::UnsignedInteger32 | nbDataErrors_ |
xdata::UnsignedInteger32 | nbDiscardedEvents_ |
xdata::UnsignedInteger32 | nbDqmCells_ |
xdata::UnsignedInteger32 | nbDqmDiscardReceived_ |
xdata::UnsignedInteger32 | nbEolDiscarded_ |
xdata::UnsignedInteger32 | nbEolPosted_ |
xdata::UnsignedInteger32 | nbLostEvents_ |
xdata::UnsignedInteger32 | nbPendingRequests_ |
xdata::UnsignedInteger32 | nbPendingSMDiscards_ |
xdata::UnsignedInteger32 | nbPendingSMDqmDiscards_ |
xdata::UnsignedInteger32 | nbProcessedEvents_ |
xdata::UnsignedInteger32 | nbRawCells_ |
xdata::UnsignedInteger32 | nbReceivedEol_ |
xdata::UnsignedInteger32 | nbReceivedEvents_ |
xdata::UnsignedInteger32 | nbRecoCells_ |
xdata::UnsignedInteger32 | nbSentDqmEvents_ |
xdata::UnsignedInteger32 | nbSentErrorEvents_ |
xdata::UnsignedInteger32 | nbSentEvents_ |
UInt_t | nbSentLast_ |
xdata::UnsignedInteger32 | nbTakeReceived_ |
xdata::UnsignedInteger32 | nbTimeoutsWithEvent_ |
xdata::UnsignedInteger32 | nbTimeoutsWithoutEvent_ |
xdata::Boolean | processKillerEnabled_ |
xdata::Double | rate_ |
xdata::UnsignedInteger32 | rawCellSize_ |
xdata::String | reasonForFailed_ |
xdata::UnsignedInteger32 | recoCellSize_ |
IPCMethod * | resourceStructure_ |
xdata::UnsignedInteger32 | resourceStructureTimeout_ |
xdata::Double | rms_ |
xdata::UnsignedInteger32 | runNumber_ |
xdata::Boolean | segmentationMode_ |
bool | shmInconsistent_ |
SMProxy * | sm_ |
xdata::String | smClassName_ |
xdata::UnsignedInteger32 | smInstance_ |
std::string | sourceId_ |
UInt_t | sumOfSizesLast_ |
uint64_t | sumOfSquaresLast_ |
xdata::Double | throughput_ |
xdata::UnsignedInteger32 | timeOutSec_ |
xdata::Boolean | useEvmBoard_ |
xdata::Boolean | useMessageQueueIPC_ |
xdata::UnsignedInteger32 | watchSleepSec_ |
WorkLoop_t * | wlDiscard_ |
WorkLoop_t * | wlMonitoring_ |
WorkLoop_t * | wlSendData_ |
WorkLoop_t * | wlSendDqm_ |
WorkLoop_t * | wlWatching_ |
Friends | |
class | Configuring |
class | Enabled |
class | Enabling |
class | evf::FUResourceBroker |
class | Failed |
class | Halted |
class | Halting |
class | Normal |
class | Ready |
not [yet] run More... | |
class | Running |
class | Stopped |
class | Stopping |
Class holding resources shared between FSM states.
Definition at line 71 of file SharedResources.h.
|
private |
Definition at line 196 of file SharedResources.h.
|
private |
Definition at line 195 of file SharedResources.h.
SharedResources::SharedResources | ( | Logger | log | ) |
Definition at line 24 of file SharedResources.cc.
References accessToResourceStructureLock_, and lock_.
SharedResources::~SharedResources | ( | ) |
Definition at line 101 of file SharedResources.cc.
void SharedResources::cancelAllWorkloops | ( | ) |
Definition at line 152 of file SharedResources.cc.
References wlDiscard_, wlMonitoring_, wlSendData_, wlSendDqm_, and wlWatching_.
void SharedResources::configureResources | ( | xdaq::Application * | app | ) |
Sets-up the type of IPC to be used, and sets the resourceStructure_ pointer.
Definition at line 106 of file SharedResources.cc.
References bu_, doCrcCheck_, doDumpEvents_, evf::FUResource::doFedIdCheck(), doFedIdCheck_, dqmCellSize_, frb_, freeResRequiredForAllocate_, evf::IPCManager::initialise(), evf::IPCManager::ipc(), ipcManager_, log_, nbDqmCells_, evf::IPCMethod::nbFreeSlots(), nbRawCells_, nbRecoCells_, evf::IPCMethod::nbResources(), rawCellSize_, recoCellSize_, reset(), resourceStructure_, resourceStructureTimeout_, segmentationMode_, evf::IPCMethod::setDoCrcCheck(), evf::IPCMethod::setDoDumpEvents(), shmInconsistent_, sm_, evf::FUResource::useEvmBoard(), useEvmBoard_, and useMessageQueueIPC_.
|
private |
|
private |
Action for Discard Work loop. The forwards the call to the current state of the FSM.
Definition at line 537 of file SharedResources.cc.
References gather_cfg::cout, evf::IPCMethod::discard(), evf::IPCMethod::discardWhileHalting(), alignCSCRings::e, evf::rb_statemachine::FAILED, fsm_, evf::rb_statemachine::RBStateMachine::getCurrentState(), goToFailedState(), evf::rb_statemachine::HALTING, resourceStructure_, evf::rb_statemachine::RUNNING, evf::rb_statemachine::BaseState::stateID(), evf::rb_statemachine::STOPPING, evf::rb_statemachine::RBStateMachine::transitionReadLock(), and evf::rb_statemachine::RBStateMachine::transitionUnlock().
Referenced by startDiscardWorkLoop().
|
private |
Goes to failed state due to the given exception
Definition at line 587 of file SharedResources.cc.
References commands_, evf::rb_statemachine::CommandQueue::enqEvent(), edm::hlt::Fail, cmsPerfPublish::fail(), log_, and reasonForFailed_.
Referenced by discard(), sendData(), sendDqm(), and watching().
|
inline |
Definition at line 107 of file SharedResources.h.
Referenced by monitoring(), and watching().
|
inline |
Definition at line 118 of file SharedResources.h.
References accessToResourceStructureLock_, and log_.
|
private |
Action for Monitoring workloop.
Definition at line 202 of file SharedResources.cc.
References average_, deltaN_, deltaSumOfSizes_, deltaSumOfSquares_, deltaT(), deltaT_, gui_, lock(), timingPdfMaker::mean, evf::IndependentWebGUI::monInfoSpace(), monSleepSec_, monStartTime_, evf::IPCMethod::nbSent(), nbSentLast_, rate_, resourceStructure_, rms_, stor::utils::sleep(), mathSSE::sqrt(), evf::IPCMethod::sumOfSizes(), sumOfSizesLast_, evf::IPCMethod::sumOfSquares(), sumOfSquaresLast_, throughput_, and unlock().
Referenced by startMonitoringWorkLoop().
void SharedResources::printWorkLoopStatus | ( | ) |
Definition at line 574 of file SharedResources.cc.
References gather_cfg::cout, wlDiscard_, wlSendData_, and wlSendDqm_.
void SharedResources::reset | ( | void | ) |
Resets counters
Definition at line 132 of file SharedResources.cc.
References average_, deltaN_, deltaSumOfSizes_, deltaSumOfSquares_, deltaT_, gui_, nbSentLast_, rate_, evf::IndependentWebGUI::resetCounters(), rms_, sumOfSizesLast_, sumOfSquaresLast_, and throughput_.
Referenced by configureResources().
|
private |
Action for SendData Work loop. The forwards the call to the current state of the FSM.
Definition at line 425 of file SharedResources.cc.
References gather_cfg::cout, alignCSCRings::e, evf::rb_statemachine::FAILED, fsm_, evf::rb_statemachine::RBStateMachine::getCurrentState(), goToFailedState(), evf::rb_statemachine::HALTING, resourceStructure_, evf::rb_statemachine::RUNNING, evf::IPCMethod::sendData(), evf::IPCMethod::sendDataWhileHalting(), evf::rb_statemachine::BaseState::stateID(), evf::rb_statemachine::STOPPING, evf::rb_statemachine::RBStateMachine::transitionReadLock(), and evf::rb_statemachine::RBStateMachine::transitionUnlock().
Referenced by startSendDataWorkLoop().
|
private |
Action for SendDqm Work loop. The forwards the call to the current state of the FSM.
Definition at line 480 of file SharedResources.cc.
References gather_cfg::cout, alignCSCRings::e, evf::rb_statemachine::FAILED, fsm_, evf::rb_statemachine::RBStateMachine::getCurrentState(), goToFailedState(), evf::rb_statemachine::HALTING, resourceStructure_, evf::rb_statemachine::RUNNING, evf::IPCMethod::sendDqm(), evf::IPCMethod::sendDqmWhileHalting(), evf::rb_statemachine::BaseState::stateID(), evf::rb_statemachine::STOPPING, evf::rb_statemachine::RBStateMachine::transitionReadLock(), and evf::rb_statemachine::RBStateMachine::transitionUnlock().
Referenced by startSendDqmWorkLoop().
|
inline |
|
private |
Work loop to discard events to Builder Unit
Definition at line 517 of file SharedResources.cc.
References asDiscard_, discard(), alignCSCRings::e, edm::hlt::Exception, log_, lumiQueryAPI::msg, resourceStructure_, evf::IPCMethod::setActive(), evf::IPCMethod::setReadyToShutDown(), and wlDiscard_.
|
private |
Calculate monitoring information in separate thread. Starts the workloop.
Definition at line 182 of file SharedResources.cc.
References asMonitoring_, alignCSCRings::e, edm::hlt::Exception, monitoring(), monStartTime_, lumiQueryAPI::msg, sourceId_, and wlMonitoring_.
|
private |
Work loop to send data events to Storage Manager
Definition at line 407 of file SharedResources.cc.
References asSendData_, alignCSCRings::e, edm::hlt::Exception, log_, lumiQueryAPI::msg, sendData(), and wlSendData_.
|
private |
Work loop to send dqm events to Storage Manager
Definition at line 462 of file SharedResources.cc.
References asSendDqm_, alignCSCRings::e, edm::hlt::Exception, log_, lumiQueryAPI::msg, sendDqm(), and wlSendDqm_.
|
private |
Watch the state of the shm buffer in a separate thread. Start the workloop.
Definition at line 284 of file SharedResources.cc.
References asWatching_, alignCSCRings::e, edm::hlt::Exception, lumiQueryAPI::msg, sourceId_, watching(), and wlWatching_.
|
inline |
Definition at line 126 of file SharedResources.h.
References accessToResourceStructureLock_.
|
inline |
Definition at line 114 of file SharedResources.h.
References lock_.
Referenced by monitoring(), and watching().
|
inline |
Definition at line 131 of file SharedResources.h.
References accessToResourceStructureLock_.
|
inline |
Definition at line 88 of file SharedResources.h.
References gui_, and evf::IndependentWebGUI::updateExternalState().
|
inline |
Definition at line 93 of file SharedResources.h.
References gui_, and evf::IndependentWebGUI::updateInternalState().
|
private |
Action for Watching workloop.
Definition at line 300 of file SharedResources.cc.
References evf::IPCMethod::cellEvtNumbers(), evf::IPCMethod::cellPrcIds(), evf::IPCMethod::cellTimeStamps(), evf::IPCMethod::clientPrcIds(), alignCSCRings::e, fsm_, evf::rb_statemachine::RBStateMachine::getApp(), goToFailedState(), evf::IPCMethod::handleCrashedEP(), i, lock(), log_, evf::IPCMethod::nbFreeSlots(), nbRawCells_, evf::IPCMethod::nbResources(), nbTimeoutsWithEvent_, nbTimeoutsWithoutEvent_, evf::utils::pid, processKillerEnabled_, resourceStructure_, runNumber_, shmInconsistent_, stor::utils::sleep(), ntuplemaker::status, cond::rpcobgas::time, timeOutSec_, unlock(), and watchSleepSec_.
Referenced by startWatchingWorkLoop().
|
friend |
Definition at line 347 of file SharedResources.h.
|
friend |
Definition at line 351 of file SharedResources.h.
|
friend |
Definition at line 350 of file SharedResources.h.
|
friend |
Definition at line 344 of file SharedResources.h.
|
friend |
Definition at line 356 of file SharedResources.h.
|
friend |
Definition at line 346 of file SharedResources.h.
|
friend |
Definition at line 354 of file SharedResources.h.
|
friend |
Definition at line 355 of file SharedResources.h.
|
friend |
not [yet] run
Definition at line 348 of file SharedResources.h.
|
friend |
Definition at line 352 of file SharedResources.h.
|
friend |
Definition at line 349 of file SharedResources.h.
|
friend |
Definition at line 353 of file SharedResources.h.
|
private |
Definition at line 338 of file SharedResources.h.
Referenced by lockRSAccess(), SharedResources(), tryLockRSAccess(), and unlockRSAccess().
|
private |
Definition at line 339 of file SharedResources.h.
|
private |
Definition at line 214 of file SharedResources.h.
Referenced by startDiscardWorkLoop().
|
private |
Definition at line 204 of file SharedResources.h.
Referenced by startMonitoringWorkLoop().
|
private |
Definition at line 210 of file SharedResources.h.
Referenced by startSendDataWorkLoop().
|
private |
Definition at line 212 of file SharedResources.h.
Referenced by startSendDqmWorkLoop().
|
private |
Definition at line 207 of file SharedResources.h.
Referenced by startWatchingWorkLoop().
|
private |
Definition at line 258 of file SharedResources.h.
Referenced by monitoring(), and reset().
|
private |
Definition at line 233 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 305 of file SharedResources.h.
|
private |
Definition at line 306 of file SharedResources.h.
|
private |
Definition at line 290 of file SharedResources.h.
|
private |
Definition at line 227 of file SharedResources.h.
Referenced by goToFailedState().
|
private |
Definition at line 284 of file SharedResources.h.
|
private |
Definition at line 252 of file SharedResources.h.
Referenced by monitoring(), and reset().
|
private |
Definition at line 254 of file SharedResources.h.
Referenced by monitoring(), and reset().
|
private |
Definition at line 253 of file SharedResources.h.
Referenced by monitoring(), and reset().
|
private |
Definition at line 251 of file SharedResources.h.
Referenced by monitoring(), and reset().
|
private |
Definition at line 302 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 300 of file SharedResources.h.
|
private |
Definition at line 303 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 301 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 296 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 333 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 298 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 221 of file SharedResources.h.
Referenced by discard(), sendData(), sendDqm(), setFsmPointer(), and watching().
|
private |
Definition at line 224 of file SharedResources.h.
Referenced by monitoring(), reset(), updateGUIExternalState(), and updateGUIInternalState().
|
private |
Definition at line 275 of file SharedResources.h.
|
private |
Definition at line 239 of file SharedResources.h.
|
private |
Definition at line 242 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 332 of file SharedResources.h.
Referenced by lock(), SharedResources(), and unlock().
|
private |
Definition at line 230 of file SharedResources.h.
Referenced by configureResources(), goToFailedState(), lock(), lockRSAccess(), startDiscardWorkLoop(), startSendDataWorkLoop(), startSendDqmWorkLoop(), and watching().
|
private |
Definition at line 311 of file SharedResources.h.
Referenced by monitoring().
|
private |
Definition at line 326 of file SharedResources.h.
Referenced by monitoring(), and startMonitoringWorkLoop().
|
private |
Definition at line 262 of file SharedResources.h.
|
private |
Definition at line 320 of file SharedResources.h.
|
private |
Definition at line 289 of file SharedResources.h.
|
private |
Definition at line 281 of file SharedResources.h.
|
private |
Definition at line 322 of file SharedResources.h.
|
private |
Definition at line 280 of file SharedResources.h.
|
private |
Definition at line 271 of file SharedResources.h.
|
private |
Definition at line 293 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 323 of file SharedResources.h.
|
private |
Definition at line 277 of file SharedResources.h.
|
private |
Definition at line 276 of file SharedResources.h.
|
private |
Definition at line 279 of file SharedResources.h.
|
private |
Definition at line 263 of file SharedResources.h.
|
private |
Definition at line 269 of file SharedResources.h.
|
private |
Definition at line 270 of file SharedResources.h.
|
private |
Definition at line 265 of file SharedResources.h.
|
private |
Definition at line 291 of file SharedResources.h.
Referenced by configureResources(), and watching().
|
private |
Definition at line 274 of file SharedResources.h.
|
private |
Definition at line 264 of file SharedResources.h.
|
private |
Definition at line 292 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 267 of file SharedResources.h.
|
private |
Definition at line 268 of file SharedResources.h.
|
private |
Definition at line 266 of file SharedResources.h.
|
private |
Definition at line 327 of file SharedResources.h.
Referenced by monitoring(), and reset().
|
private |
Definition at line 321 of file SharedResources.h.
|
private |
Definition at line 282 of file SharedResources.h.
Referenced by watching().
|
private |
Definition at line 283 of file SharedResources.h.
Referenced by watching().
|
private |
Definition at line 314 of file SharedResources.h.
Referenced by watching().
|
private |
Definition at line 257 of file SharedResources.h.
Referenced by monitoring(), and reset().
|
private |
Definition at line 294 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 317 of file SharedResources.h.
Referenced by goToFailedState().
|
private |
Definition at line 295 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 243 of file SharedResources.h.
Referenced by configureResources(), discard(), monitoring(), sendData(), sendDqm(), startDiscardWorkLoop(), and watching().
|
private |
Definition at line 310 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 259 of file SharedResources.h.
Referenced by monitoring(), and reset().
|
private |
Definition at line 249 of file SharedResources.h.
Referenced by watching().
|
private |
Definition at line 287 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 335 of file SharedResources.h.
Referenced by configureResources(), and watching().
|
private |
Definition at line 236 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 307 of file SharedResources.h.
|
private |
Definition at line 308 of file SharedResources.h.
|
private |
Definition at line 246 of file SharedResources.h.
Referenced by startMonitoringWorkLoop(), and startWatchingWorkLoop().
|
private |
Definition at line 329 of file SharedResources.h.
Referenced by monitoring(), and reset().
|
private |
Definition at line 328 of file SharedResources.h.
Referenced by monitoring(), and reset().
|
private |
Definition at line 256 of file SharedResources.h.
Referenced by monitoring(), and reset().
|
private |
Definition at line 313 of file SharedResources.h.
Referenced by watching().
|
private |
Definition at line 315 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 288 of file SharedResources.h.
Referenced by configureResources().
|
private |
Definition at line 312 of file SharedResources.h.
Referenced by watching().
|
private |
Definition at line 213 of file SharedResources.h.
Referenced by cancelAllWorkloops(), printWorkLoopStatus(), and startDiscardWorkLoop().
|
private |
Definition at line 203 of file SharedResources.h.
Referenced by cancelAllWorkloops(), and startMonitoringWorkLoop().
|
private |
Definition at line 209 of file SharedResources.h.
Referenced by cancelAllWorkloops(), printWorkLoopStatus(), and startSendDataWorkLoop().
|
private |
Definition at line 211 of file SharedResources.h.
Referenced by cancelAllWorkloops(), printWorkLoopStatus(), and startSendDqmWorkLoop().
|
private |
Definition at line 206 of file SharedResources.h.
Referenced by cancelAllWorkloops(), and startWatchingWorkLoop().