CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
evf::FastMonitoringService Class Reference

#include <FastMonitoringService.h>

Inheritance diagram for evf::FastMonitoringService:
evf::MicroStateService

Classes

struct  Encoding
 

Public Member Functions

void accumulateFileSize (unsigned int lumi, unsigned long fileSize)
 
 FastMonitoringService (const edm::ParameterSet &, edm::ActivityRegistry &)
 
unsigned int getEventsProcessedForLumi (unsigned int lumi)
 
std::string getRunDirName () const
 
void jobFailure ()
 
std::string makeModuleLegenda ()
 
std::string makePathLegenda ()
 
void postBeginJob ()
 
void postEndJob ()
 
void postEvent (edm::StreamContext const &)
 
void postGlobalBeginRun (edm::GlobalContext const &)
 
void postGlobalEndLumi (edm::GlobalContext const &)
 
void postModuleEvent (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void postSourceEvent (edm::StreamID)
 
void postStreamBeginLumi (edm::StreamContext const &)
 
void postStreamEndLumi (edm::StreamContext const &)
 
void preallocate (edm::service::SystemBounds const &)
 
void preEvent (edm::StreamContext const &)
 
void preGlobalBeginLumi (edm::GlobalContext const &)
 
void preGlobalEndLumi (edm::GlobalContext const &)
 
void preModuleBeginJob (edm::ModuleDescription const &)
 
void preModuleEvent (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void prePathEvent (edm::StreamContext const &, edm::PathContext const &)
 
void preSourceEvent (edm::StreamID)
 
void preStreamBeginLumi (edm::StreamContext const &)
 
void preStreamEndLumi (edm::StreamContext const &)
 
void reportEventsThisLumiInSource (unsigned int lumi, unsigned int events)
 
void setMicroState (MicroStateService::Microstate)
 
void setMicroState (edm::StreamID, MicroStateService::Microstate)
 
void startedLookingForFile ()
 
void stoppedLookingForFile (unsigned int lumi)
 
 ~FastMonitoringService ()
 
- Public Member Functions inherited from evf::MicroStateService
virtual std::string getMicroState1 ()
 
virtual std::string const & getMicroState2 ()
 
 MicroStateService (const edm::ParameterSet &, edm::ActivityRegistry &)
 
virtual ~MicroStateService ()
 

Static Public Attributes

static const std::string macroStateNames [FastMonitoringThread::MCOUNT]
 
static const std::string nopath_ = "NoPath"
 
- Static Public Attributes inherited from evf::MicroStateService
static const edm::ModuleDescription reservedMicroStateNames [mCOUNT]
 

Private Member Functions

void doSnapshot (const unsigned int ls, const bool isGlobalEOL)
 
void doStreamEOLSnapshot (const unsigned int ls, const unsigned int streamID)
 
void dowork ()
 

Private Attributes

std::map< unsigned int,
unsigned long > 
accuSize_
 
std::map< unsigned int, double > avgLeadTime_
 
std::vector< std::atomic< bool > * > collectedPathList_
 
Encoding encModule_
 
std::vector< EncodingencPath_
 
std::vector< unsigned int > eventCountForPathInit_
 
std::string fastMicrostateDefPath_
 
unsigned int fastMonIntervals_
 
std::string fastName_
 
std::string fastPath_
 
timeval fileLookStart_
 
timeval fileLookStop_
 
std::map< unsigned int,
unsigned int > 
filesProcessedDuringLumi_
 
std::vector< unsigned long > firstEventId_
 
FastMonitoringThread fmt_
 
bool isGlobalLumiTransition_
 
unsigned int lastGlobalLumi_
 
std::queue< unsigned int > lastGlobalLumisClosed_
 
std::vector< double > leadTimes_
 
unsigned int lumiFromSource_
 
std::map< unsigned int, timeval > lumiStartTime_
 
FastMonitoringThread::Macrostate macrostate_
 
std::vector< const void * > microstate_
 
std::string microstateDefPath_
 
std::vector< const void * > ministate_
 
std::string moduleLegendFile_
 
std::atomic< bool > monInit_
 
unsigned int nStreams_
 
unsigned int nThreads_
 
std::string pathLegendFile_
 
bool pathLegendWritten_ = false
 
std::vector< bool > pathNamesReady_
 
std::map< unsigned int,
unsigned int > 
processedEventsPerLumi_
 
boost::filesystem::path runDirectory_
 
int sleepTime_
 
std::string slowName_
 
unsigned int snapCounter_ = 0
 
std::map< unsigned int,
unsigned int > 
sourceEventsReport_
 
std::vector< std::atomic< bool > * > streamCounterUpdating_
 
bool threadIDAvailable_ = false
 
std::vector< const void * > threadMicrostate_
 
std::atomic< unsigned long > totalEventsProcessed_
 
boost::filesystem::path workingDirectory_
 

Additional Inherited Members

- Public Types inherited from evf::MicroStateService
enum  Microstate {
  mInvalid = 0, mFwkOvh, mIdle, mInput,
  mInputDone, mDqm, mEoL, mCOUNT
}
 
- Static Protected Attributes inherited from evf::MicroStateService
static const std::string default_return_ ="NotImplemented"
 

Detailed Description

Definition at line 51 of file FastMonitoringService.h.

Constructor & Destructor Documentation

evf::FastMonitoringService::FastMonitoringService ( const edm::ParameterSet iPS,
edm::ActivityRegistry reg 
)

Definition at line 32 of file FastMonitoringService.cc.

References jobFailure(), postBeginJob(), postEndJob(), postEvent(), postGlobalEndLumi(), postModuleEvent(), postSourceEvent(), postStreamBeginLumi(), postStreamEndLumi(), preallocate(), preEvent(), preGlobalBeginLumi(), preGlobalEndLumi(), preModuleBeginJob(), preModuleEvent(), prePathEvent(), preSourceEvent(), preStreamBeginLumi(), preStreamEndLumi(), edm::ActivityRegistry::watchJobFailure(), edm::ActivityRegistry::watchPostBeginJob(), edm::ActivityRegistry::watchPostEndJob(), edm::ActivityRegistry::watchPostEvent(), edm::ActivityRegistry::watchPostGlobalEndLumi(), edm::ActivityRegistry::watchPostModuleEvent(), edm::ActivityRegistry::watchPostSourceEvent(), edm::ActivityRegistry::watchPostStreamBeginLumi(), edm::ActivityRegistry::watchPostStreamEndLumi(), edm::ActivityRegistry::watchPreallocate(), edm::ActivityRegistry::watchPreEvent(), edm::ActivityRegistry::watchPreGlobalBeginLumi(), edm::ActivityRegistry::watchPreGlobalEndLumi(), edm::ActivityRegistry::watchPreModuleBeginJob(), edm::ActivityRegistry::watchPreModuleEvent(), edm::ActivityRegistry::watchPrePathEvent(), edm::ActivityRegistry::watchPreSourceEvent(), edm::ActivityRegistry::watchPreStreamBeginLumi(), and edm::ActivityRegistry::watchPreStreamEndLumi().

33  :
34  MicroStateService(iPS,reg)
35  ,encModule_(33)
36  ,nStreams_(0)//until initialized
37  ,sleepTime_(iPS.getUntrackedParameter<int>("sleepTime", 1))
38  ,fastMonIntervals_(iPS.getUntrackedParameter<unsigned int>("fastMonIntervals", 1))
39  ,microstateDefPath_(iPS.getUntrackedParameter<std::string> ("microstateDefPath", std::string(getenv("CMSSW_BASE"))+"/src/EventFilter/Utilities/plugins/microstatedef.jsd"))
41  ,fastName_(iPS.getUntrackedParameter<std::string>("fastName", "fastmoni"))
42  ,slowName_(iPS.getUntrackedParameter<std::string>("slowName", "slowmoni"))
44  {
45  reg.watchPreallocate(this, &FastMonitoringService::preallocate);//receiving information on number of threads
47 
51 
55 
60 
62 
65 
66  reg.watchPreSourceEvent(this,&FastMonitoringService::preSourceEvent);//source (with streamID of requestor)
68 
71 
72  }
void prePathEvent(edm::StreamContext const &, edm::PathContext const &)
T getUntrackedParameter(std::string const &, T const &) const
void watchPreEvent(PreEvent::slot_type const &iSlot)
void watchPrePathEvent(PrePathEvent::slot_type const &iSlot)
void watchPreallocate(Preallocate::slot_type const &iSlot)
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void preallocate(edm::service::SystemBounds const &)
void preGlobalBeginLumi(edm::GlobalContext const &)
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
void postGlobalEndLumi(edm::GlobalContext const &)
void postEvent(edm::StreamContext const &)
void watchPreGlobalEndLumi(PreGlobalEndLumi::slot_type const &iSlot)
void watchPostEvent(PostEvent::slot_type const &iSlot)
void watchPostStreamEndLumi(PostStreamEndLumi::slot_type const &iSlot)
void watchPreGlobalBeginLumi(PreGlobalBeginLumi::slot_type const &iSlot)
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
void watchPostSourceEvent(PostSourceEvent::slot_type const &iSlot)
void preGlobalEndLumi(edm::GlobalContext const &)
void watchPreStreamEndLumi(PreStreamEndLumi::slot_type const &iSlot)
void watchJobFailure(JobFailure::slot_type const &iSlot)
convenience function for attaching to signal
void preModuleBeginJob(edm::ModuleDescription const &)
MicroStateService(const edm::ParameterSet &, edm::ActivityRegistry &)
void preStreamEndLumi(edm::StreamContext const &)
void watchPostStreamBeginLumi(PostStreamBeginLumi::slot_type const &iSlot)
void watchPostGlobalEndLumi(PostGlobalEndLumi::slot_type const &iSlot)
void watchPreModuleBeginJob(PreModuleBeginJob::slot_type const &iSlot)
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postStreamBeginLumi(edm::StreamContext const &)
void postStreamEndLumi(edm::StreamContext const &)
void preStreamBeginLumi(edm::StreamContext const &)
std::atomic< unsigned long > totalEventsProcessed_
void watchPreStreamBeginLumi(PreStreamBeginLumi::slot_type const &iSlot)
void preEvent(edm::StreamContext const &)
void watchPreSourceEvent(PreSourceEvent::slot_type const &iSlot)
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
void watchPostBeginJob(PostBeginJob::slot_type const &iSlot)
convenience function for attaching to signal
evf::FastMonitoringService::~FastMonitoringService ( )

Definition at line 75 of file FastMonitoringService.cc.

76  {
77  }

Member Function Documentation

void evf::FastMonitoringService::accumulateFileSize ( unsigned int  lumi,
unsigned long  fileSize 
)

Definition at line 496 of file FastMonitoringService.cc.

References accuSize_, filesProcessedDuringLumi_, fmt_, fff_deleter::lock(), fjr2json::lumi, and evf::FastMonitoringThread::monlock_.

Referenced by evf::EvFDaqDirector::bumpFile().

496  {
497  std::lock_guard<std::mutex> lock(fmt_.monlock_);
498 
499  if (accuSize_.find(lumi)==accuSize_.end()) accuSize_[lumi] = fileSize;
500  else accuSize_[lumi] += fileSize;
501 
504  else
506  }
std::map< unsigned int, unsigned long > accuSize_
tuple lumi
Definition: fjr2json.py:35
std::map< unsigned int, unsigned int > filesProcessedDuringLumi_
void evf::FastMonitoringService::doSnapshot ( const unsigned int  ls,
const bool  isGlobalEOL 
)
private

Definition at line 558 of file FastMonitoringService.cc.

References avgLeadTime_, encModule_, evf::FastMonitoringService::Encoding::encode(), encPath_, evf::FastMonitoringThread::MonitorData::fastAvgLeadTimeJ_, evf::FastMonitoringThread::MonitorData::fastFilesProcessedJ_, evf::FastMonitoringThread::MonitorData::fastMacrostateJ_, filesProcessedDuringLumi_, fmt_, i, isGlobalLumiTransition_, evf::FastMonitoringThread::jsonMonitor_, evf::FastMonitoringThread::m_data, macrostate_, microstate_, evf::FastMonitoringThread::MonitorData::microstateEncoded_, ministate_, evf::FastMonitoringThread::MonitorData::ministateEncoded_, and nStreams_.

Referenced by dowork(), and preGlobalEndLumi().

558  {
559  // update macrostate
561 
562  //update these unless in the midst of a global transition
564 
565  auto itd = avgLeadTime_.find(ls);
566  if (itd != avgLeadTime_.end())
567  fmt_.m_data.fastAvgLeadTimeJ_ = itd->second;
568  else fmt_.m_data.fastAvgLeadTimeJ_=0.;
569 
570  auto iti = filesProcessedDuringLumi_.find(ls);
571  if (iti != filesProcessedDuringLumi_.end())
572  fmt_.m_data.fastFilesProcessedJ_ = iti->second;
574  }
575  else return;
576 
577  //capture latest mini/microstate of streams
578  for (unsigned int i=0;i<nStreams_;i++) {
581  }
582  //for (unsigned int i=0;i<nThreads_;i++)
583  // fmt_.m_data.threadMicrostateEncoded_[i] = encModule_.encode(threadMicrostate_[i]);
584 
585  if (isGlobalEOL)
586  {//only update global variables
587  fmt_.jsonMonitor_->snapGlobal(ls);
588  }
589  else
590  fmt_.jsonMonitor_->snap(ls);
591  }
int i
Definition: DBlmapReader.cc:9
std::map< unsigned int, unsigned int > filesProcessedDuringLumi_
std::map< unsigned int, double > avgLeadTime_
std::vector< const void * > microstate_
std::vector< unsigned int > microstateEncoded_
FastMonitoringThread::Macrostate macrostate_
std::unique_ptr< FastMonitor > jsonMonitor_
std::vector< const void * > ministate_
std::vector< Encoding > encPath_
std::vector< unsigned int > ministateEncoded_
void evf::FastMonitoringService::doStreamEOLSnapshot ( const unsigned int  ls,
const unsigned int  streamID 
)
inlineprivate

Definition at line 156 of file FastMonitoringService.h.

References fmt_, and evf::FastMonitoringThread::jsonMonitor_.

Referenced by preStreamEndLumi().

156  {
157  //pick up only event count here
158  fmt_.jsonMonitor_->snapStreamAtomic(ls,streamID);
159  }
std::unique_ptr< FastMonitor > jsonMonitor_
void evf::FastMonitoringService::dowork ( )
inlineprivate

Definition at line 161 of file FastMonitoringService.h.

References doSnapshot(), encModule_, evf::FastMonitoringService::Encoding::encode(), encPath_, evf::FastMonitoringThread::MonitorData::fastMacrostateJ_, fastMonIntervals_, fastPath_, fmt_, evf::FastMonitoringThread::jsonMonitor_, lastGlobalLumi_, fff_deleter::lock(), evf::FastMonitoringThread::m_data, evf::FastMonitoringThread::m_stoprequest, microstate_, ministate_, monInit_, evf::FastMonitoringThread::monlock_, sleepTime_, snapCounter_, AlCaHLTBitMon_QueryRunRegistry::string, and jsoncollector::IntJ::value().

Referenced by preallocate().

161  { // the function to be called in the thread. Thread completes when function returns.
162  monInit_.exchange(true,std::memory_order_acquire);
163  while (!fmt_.m_stoprequest) {
164  edm::LogInfo("FastMonitoringService") << "Current states: Ms=" << fmt_.m_data.fastMacrostateJ_.value()
165  << " ms=" << encPath_[0].encode(ministate_[0])
166  << " us=" << encModule_.encode(microstate_[0]) << std::endl;
167 
168  {
169  std::lock_guard<std::mutex> lock(fmt_.monlock_);
170 
172 
174  std::string CSV = fmt_.jsonMonitor_->getCSVString();
175  //release mutex before writing out fast path file
176  fmt_.monlock_.unlock();
177  if (CSV.size())
178  fmt_.jsonMonitor_->outputCSV(fastPath_,CSV);
179  }
180 
181  snapCounter_++;
182 
183  }
184  ::sleep(sleepTime_);
185  }
186  }
void doSnapshot(const unsigned int ls, const bool isGlobalEOL)
std::vector< const void * > microstate_
std::atomic< bool > m_stoprequest
std::unique_ptr< FastMonitor > jsonMonitor_
std::vector< const void * > ministate_
std::vector< Encoding > encPath_
unsigned int evf::FastMonitoringService::getEventsProcessedForLumi ( unsigned int  lumi)

Definition at line 543 of file FastMonitoringService.cc.

References edm::hlt::Exception, fmt_, fff_deleter::lock(), fjr2json::lumi, evf::FastMonitoringThread::monlock_, proc, and processedEventsPerLumi_.

Referenced by DQMFileSaver::fillJson(), and DQMFileSaver::globalEndLuminosityBlock().

543  {
544  std::lock_guard<std::mutex> lock(fmt_.monlock_);
545 
546  auto it = processedEventsPerLumi_.find(lumi);
547  if (it!=processedEventsPerLumi_.end()) {
548  unsigned int proc = it->second;
549  return proc;
550  }
551  else {
552  throw cms::Exception("FastMonitoringService") << "output module wants already deleted (or never reported by SOURCE) lumisection event count for LUMI -: "<<lumi;
553  return 0;
554  }
555  }
TrainProcessor *const proc
Definition: MVATrainer.cc:101
tuple lumi
Definition: fjr2json.py:35
std::map< unsigned int, unsigned int > processedEventsPerLumi_
std::string evf::FastMonitoringService::getRunDirName ( ) const
inline

Definition at line 150 of file FastMonitoringService.h.

References runDirectory_.

150 { return runDirectory_.stem().string(); }
boost::filesystem::path runDirectory_
void evf::FastMonitoringService::jobFailure ( )
std::string evf::FastMonitoringService::makeModuleLegenda ( )

Definition at line 91 of file FastMonitoringService.cc.

References evf::FastMonitoringService::Encoding::current_, evf::FastMonitoringService::Encoding::decode(), encModule_, and i.

Referenced by postBeginJob().

92  {
93  std::ostringstream ost;
94  for(int i = 0; i < encModule_.current_; i++)
95  ost<<i<<"="<<((const edm::ModuleDescription *)(encModule_.decode(i)))->moduleLabel()<<" ";
96  return ost.str();
97  }
int i
Definition: DBlmapReader.cc:9
const void * decode(unsigned int index)
std::string evf::FastMonitoringService::makePathLegenda ( )

Definition at line 80 of file FastMonitoringService.cc.

References edm::decode(), encPath_, i, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by prePathEvent().

80  {
81  //taken from first stream
82  std::ostringstream ost;
83  for(int i = 0;
84  i < encPath_[0].current_;
85  i++)
86  ost<<i<<"="<<*((std::string *)(encPath_[0].decode(i)))<<" ";
87  return ost.str();
88  }
int i
Definition: DBlmapReader.cc:9
bool decode(bool &, std::string const &)
Definition: types.cc:62
std::vector< Encoding > encPath_
void evf::FastMonitoringService::postBeginJob ( )

Definition at line 229 of file FastMonitoringService.cc.

References encModule_, fmt_, fff_deleter::lock(), evf::FastMonitoringThread::m_data, macrostate_, makeModuleLegenda(), evf::FastMonitoringThread::MonitorData::microstateBins_, moduleLegendFile_, evf::FastMonitoringThread::monlock_, evf::FastMonitoringThread::sJobReady, AlCaHLTBitMon_QueryRunRegistry::string, and evf::FastMonitoringService::Encoding::vecsize().

Referenced by FastMonitoringService().

230  {
231  std::string && moduleLegStr = makeModuleLegenda();
232  FileIO::writeStringToFile(moduleLegendFile_, moduleLegStr);
233 
235 
236  //update number of entries in module histogram
237  std::lock_guard<std::mutex> lock(fmt_.monlock_);
239  }
FastMonitoringThread::Macrostate macrostate_
void evf::FastMonitoringService::postEndJob ( )
void evf::FastMonitoringService::postEvent ( edm::StreamContext const &  sc)

Definition at line 431 of file FastMonitoringService.cc.

References eventCountForPathInit_, evf::FastMonitoringThread::MonitorData::fastPathProcessedJ_, fmt_, evf::FastMonitoringThread::m_data, microstate_, evf::MicroStateService::mIdle, ministate_, nopath_, evf::FastMonitoringThread::MonitorData::processed_, evf::MicroStateService::reservedMicroStateNames, streamCounterUpdating_, edm::StreamContext::streamID(), and totalEventsProcessed_.

Referenced by FastMonitoringService().

432  {
433  microstate_[sc.streamID()] = &reservedMicroStateNames[mIdle];
434 
435  ministate_[sc.streamID()] = &nopath_;
436 
437  #if ATOMIC_LEVEL>=2
438  //use atomic flag to make sure end of lumi sees this
439  streamCounterUpdating_[sc.streamID()]->store(true,std::memory_order_release);
440  fmt_.m_data.processed_[sc.streamID()]->fetch_add(1,std::memory_order_release);
441  streamCounterUpdating_[sc.streamID()]->store(false,std::memory_order_release);
442 
443  #elif ATOMIC_LEVEL==1
444  //writes are atomic, we assume writes propagate to memory before stream EOL snap
445  fmt_.m_data.processed_[sc.streamID()]->fetch_add(1,std::memory_order_relaxed);
446 
447  #elif ATOMIC_LEVEL==0 //default
448  (*(fmt_.m_data.processed_[sc.streamID()]))++;
449  #endif
450  eventCountForPathInit_[sc.streamID()]++;
451 
452  //fast path counter (events accumulated in a run)
453  unsigned long res = totalEventsProcessed_.fetch_add(1,std::memory_order_relaxed);
455  //fmt_.m_data.fastPathProcessedJ_ = totalEventsProcessed_.load(std::memory_order_relaxed);
456  }
static const edm::ModuleDescription reservedMicroStateNames[mCOUNT]
std::vector< AtomicMonUInt * > processed_
std::vector< unsigned int > eventCountForPathInit_
std::vector< std::atomic< bool > * > streamCounterUpdating_
static const std::string nopath_
std::vector< const void * > microstate_
std::atomic< unsigned long > totalEventsProcessed_
std::vector< const void * > ministate_
void evf::FastMonitoringService::postGlobalBeginRun ( edm::GlobalContext const &  gc)
void evf::FastMonitoringService::postGlobalEndLumi ( edm::GlobalContext const &  gc)

Definition at line 348 of file FastMonitoringService.cc.

References lastGlobalLumisClosed_, edm::LuminosityBlockID::luminosityBlock(), and edm::GlobalContext::luminosityBlockID().

Referenced by FastMonitoringService().

349  {
350  //mark closed lumis (still keep map entries until next one)
351  lastGlobalLumisClosed_.push(gc.luminosityBlockID().luminosityBlock());
352  }
std::queue< unsigned int > lastGlobalLumisClosed_
void evf::FastMonitoringService::postModuleEvent ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)

Definition at line 473 of file FastMonitoringService.cc.

References evf::MicroStateService::mFwkOvh, microstate_, evf::MicroStateService::reservedMicroStateNames, edm::StreamContext::streamID(), and edm::StreamID::value().

Referenced by FastMonitoringService().

474  {
475  //microstate_[sc.streamID().value()] = (void*)(mcc.moduleDescription());
476  microstate_[sc.streamID().value()] = &reservedMicroStateNames[mFwkOvh];
477  }
static const edm::ModuleDescription reservedMicroStateNames[mCOUNT]
std::vector< const void * > microstate_
void evf::FastMonitoringService::postSourceEvent ( edm::StreamID  sid)

Definition at line 463 of file FastMonitoringService.cc.

References evf::MicroStateService::mFwkOvh, microstate_, evf::MicroStateService::reservedMicroStateNames, and edm::StreamID::value().

Referenced by FastMonitoringService().

464  {
466  }
static const edm::ModuleDescription reservedMicroStateNames[mCOUNT]
std::vector< const void * > microstate_
unsigned int value() const
Definition: StreamID.h:46
void evf::FastMonitoringService::postStreamBeginLumi ( edm::StreamContext const &  sc)
void evf::FastMonitoringService::postStreamEndLumi ( edm::StreamContext const &  sc)
void evf::FastMonitoringService::preallocate ( edm::service::SystemBounds const &  bounds)

Definition at line 100 of file FastMonitoringService.cc.

References collectedPathList_, evf::FastMonitoringService::Encoding::completeReservedWithDummies(), dowork(), encModule_, encPath_, eventCountForPathInit_, edm::hlt::Exception, fastMicrostateDefPath_, fastName_, fastPath_, firstEventId_, fmt_, i, isGlobalLumiTransition_, evf::FastMonitoringThread::jsonMonitor_, lastGlobalLumi_, LogDebug, lumiFromSource_, evf::FastMonitoringThread::m_data, macrostate_, evf::FastMonitoringThread::MonitorData::macrostateBins_, edm::service::SystemBounds::maxNumberOfStreams(), edm::service::SystemBounds::maxNumberOfThreads(), evf::FastMonitoringThread::MCOUNT, evf::MicroStateService::mCOUNT, microstate_, evf::FastMonitoringThread::MonitorData::microstateBins_, microstateDefPath_, ministate_, evf::FastMonitoringThread::MonitorData::ministateBins_, evf::MicroStateService::mInvalid, moduleLegendFile_, monInit_, nopath_, nStreams_, nThreads_, cppFunctionSkipper::operator, cmsHarvester::path, pathLegendFile_, evf::FastMonitoringThread::MonitorData::registerVariables(), evf::MicroStateService::reservedMicroStateNames, evf::FastMonitoringThread::resetFastMonitor(), runDirectory_, evf::FastMonitoringThread::sInit, evf::FastMonitoringThread::start(), streamCounterUpdating_, threadIDAvailable_, evf::FastMonitoringService::Encoding::updateReserved(), and workingDirectory_.

Referenced by FastMonitoringService().

101  {
102 
103  // FIND RUN DIRECTORY
104  // The run dir should be set via the configuration of EvFDaqDirector
105 
106  if (edm::Service<evf::EvFDaqDirector>().operator->()==nullptr)
107  {
108  throw cms::Exception("FastMonitoringService") << "EvFDaqDirector is not present";
109 
110  }
111  boost::filesystem::path runDirectory(edm::Service<evf::EvFDaqDirector>()->baseRunDir());
112  workingDirectory_ = runDirectory_ = runDirectory;
113  workingDirectory_ /= "mon";
114 
115  if ( !boost::filesystem::is_directory(workingDirectory_)) {
116  LogDebug("FastMonitoringService") << "<MON> DIR NOT FOUND! Trying to create -: " << workingDirectory_.string() ;
117  boost::filesystem::create_directories(workingDirectory_);
118  if ( !boost::filesystem::is_directory(workingDirectory_))
119  edm::LogWarning("FastMonitoringService") << "Unable to create <MON> DIR -: " << workingDirectory_.string()
120  << ". No monitoring data will be written.";
121  }
122 
123  std::ostringstream fastFileName;
124 
125  fastFileName << fastName_ << "_pid" << std::setfill('0') << std::setw(5) << getpid() << ".fast";
127  fast /= fastFileName.str();
128  fastPath_ = fast.string();
129 
130  std::ostringstream moduleLegFile;
131  moduleLegFile << "microstatelegend_pid" << std::setfill('0') << std::setw(5) << getpid() << ".leg";
132  moduleLegendFile_ = (workingDirectory_/moduleLegFile.str()).string();
133 
134  std::ostringstream pathLegFile;
135  pathLegFile << "pathlegend_pid" << std::setfill('0') << std::setw(5) << getpid() << ".leg";
136  pathLegendFile_ = (workingDirectory_/pathLegFile.str()).string();
137 
138  LogDebug("FastMonitoringService") << "Initializing FastMonitor with microstate def path -: "
140  //<< encPath_.current_ + 1 << " " << encModule_.current_ + 1
141 
142  nStreams_=bounds.maxNumberOfStreams();
143  nThreads_=bounds.maxNumberOfThreads();
144 
145  //this should already be >=1
146  if (nStreams_==0) nStreams_=1;
147  if (nThreads_==0) nThreads_=1;
148 
149  /*
150  * initialize the fast monitor with:
151  * vector of pointers to monitorable parameters
152  * path to definition
153  *
154  */
155 
157 
158  for(unsigned int i = 0; i < (mCOUNT); i++)
161 
162  for (unsigned int i=0;i<nStreams_;i++) {
163  ministate_.push_back(&nopath_);
165 
166  //for synchronization
167  streamCounterUpdating_.push_back(new std::atomic<bool>(0));
168 
169  //path (mini) state
170  encPath_.emplace_back(0);
171  encPath_[i].update((void*)&nopath_);
172  eventCountForPathInit_.push_back(0);
173  firstEventId_.push_back(0);
174  collectedPathList_.push_back(new std::atomic<bool>(0));
175 
176  }
177  //for (unsigned int i=0;i<nThreads_;i++)
178  // threadMicrostate_.push_back(&reservedMicroStateNames[mInvalid]);
179 
180  //initial size until we detect number of bins
184 
185  lastGlobalLumi_=0;
187  lumiFromSource_=0;
188 
189  //startup monitoring
191  fmt_.jsonMonitor_->setNStreams(nStreams_);
193  monInit_.store(false,std::memory_order_release);
195 
196  //this definition needs: #include "tbb/compat/thread"
197  //however this would results in TBB imeplementation replacing std::thread
198  //(both supposedly call pthread_self())
199  //number of threads created in process could be obtained from /proc,
200  //assuming that all posix threads are true kernel threads capable of running in parallel
201 
202  //#if TBB_IMPLEMENT_CPP0X
204  //threadIDAvailable_=true;
205  //#endif
206 
207  }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
static const edm::ModuleDescription reservedMicroStateNames[mCOUNT]
boost::filesystem::path runDirectory_
void start(void(FastMonitoringService::*fp)(), FastMonitoringService *cp)
std::vector< unsigned int > eventCountForPathInit_
std::vector< std::atomic< bool > * > streamCounterUpdating_
std::vector< std::atomic< bool > * > collectedPathList_
tuple path
else: Piece not in the list, fine.
static const std::string nopath_
void resetFastMonitor(std::string const &microStateDefPath, std::string const &fastMicroStateDefPath)
std::vector< unsigned long > firstEventId_
std::vector< const void * > microstate_
void registerVariables(FastMonitor *fm, unsigned int nStreams, unsigned int nThreads)
FastMonitoringThread::Macrostate macrostate_
boost::filesystem::path workingDirectory_
std::unique_ptr< FastMonitor > jsonMonitor_
std::vector< const void * > ministate_
std::vector< Encoding > encPath_
void evf::FastMonitoringService::preEvent ( edm::StreamContext const &  sc)

Definition at line 427 of file FastMonitoringService.cc.

Referenced by FastMonitoringService().

428  {
429  }
void evf::FastMonitoringService::preGlobalBeginLumi ( edm::GlobalContext const &  gc)

Definition at line 252 of file FastMonitoringService.cc.

References accuSize_, avgLeadTime_, filesProcessedDuringLumi_, fmt_, isGlobalLumiTransition_, lastGlobalLumi_, lastGlobalLumisClosed_, fff_deleter::lock(), edm::LuminosityBlockID::luminosityBlock(), edm::GlobalContext::luminosityBlockID(), lumiStartTime_, evf::FastMonitoringThread::monlock_, and processedEventsPerLumi_.

Referenced by FastMonitoringService().

253  {
254 
255  timeval lumiStartTime;
256  gettimeofday(&lumiStartTime, 0);
257  unsigned int newLumi = gc.luminosityBlockID().luminosityBlock();
258 
259  std::lock_guard<std::mutex> lock(fmt_.monlock_);
260 
261  lumiStartTime_[newLumi]=lumiStartTime;
262  while (!lastGlobalLumisClosed_.empty()) {
263  //wipe out old map entries as they aren't needed and slow down access
264  unsigned int oldLumi = lastGlobalLumisClosed_.back();
266  lumiStartTime_.erase(oldLumi);
267  avgLeadTime_.erase(oldLumi);
268  filesProcessedDuringLumi_.erase(oldLumi);
269  accuSize_.erase(oldLumi);
270  processedEventsPerLumi_.erase(oldLumi);
271  }
272  lastGlobalLumi_= newLumi;
274  }
std::map< unsigned int, timeval > lumiStartTime_
std::map< unsigned int, unsigned long > accuSize_
std::map< unsigned int, unsigned int > filesProcessedDuringLumi_
std::queue< unsigned int > lastGlobalLumisClosed_
std::map< unsigned int, double > avgLeadTime_
std::map< unsigned int, unsigned int > processedEventsPerLumi_
void evf::FastMonitoringService::preGlobalEndLumi ( edm::GlobalContext const &  gc)

Definition at line 276 of file FastMonitoringService.cc.

References accuSize_, doSnapshot(), edm::hlt::Exception, evf::FastMonitoringThread::MonitorData::fastThroughputJ_, fmt_, isGlobalLumiTransition_, evf::FastMonitoringThread::jsonMonitor_, fff_deleter::lock(), LogDebug, fjr2json::lumi, edm::LuminosityBlockID::luminosityBlock(), edm::GlobalContext::luminosityBlockID(), lumiStartTime_, evf::FastMonitoringThread::m_data, evf::FastMonitoringThread::monlock_, cmsHarvester::path, processedEventsPerLumi_, edm::shutdown_flag, slowName_, sourceEventsReport_, throughputFactor(), jsoncollector::IntJ::value(), jsoncollector::DoubleJ::value(), and workingDirectory_.

Referenced by FastMonitoringService().

277  {
278  unsigned int lumi = gc.luminosityBlockID().luminosityBlock();
279  LogDebug("FastMonitoringService") << "Lumi ended. Writing JSON information. LUMI -: "
280  << lumi;
281  timeval lumiStopTime;
282  gettimeofday(&lumiStopTime, 0);
283 
284  std::lock_guard<std::mutex> lock(fmt_.monlock_);
285 
286  // Compute throughput
287  timeval stt = lumiStartTime_[lumi];
288  unsigned long usecondsForLumi = (lumiStopTime.tv_sec - stt.tv_sec)*1000000
289  + (lumiStopTime.tv_usec - stt.tv_usec);
290  unsigned long accuSize = accuSize_.find(lumi)==accuSize_.end() ? 0 : accuSize_[lumi];
291  double throughput = throughputFactor()* double(accuSize) / double(usecondsForLumi);
292  //store to registered variable
293  fmt_.m_data.fastThroughputJ_.value() = throughput;
294 
295  //update
296  doSnapshot(lumi,true);
297 
298  // create file name for slow monitoring file
299  std::stringstream slowFileName;
300  slowFileName << slowName_ << "_ls" << std::setfill('0') << std::setw(4)
301  << lumi << "_pid" << std::setfill('0')
302  << std::setw(5) << getpid() << ".jsn";
304  slow /= slowFileName.str();
305 
306  //retrieve one result we need (todo: sanity check if it's found)
307  IntJ *lumiProcessedJptr = dynamic_cast<IntJ*>(fmt_.jsonMonitor_->getMergedIntJForLumi("Processed",lumi));
308  if (!lumiProcessedJptr)
309  throw cms::Exception("FastMonitoringService") << "Internal error: got null pointer from FastMonitor";
310  processedEventsPerLumi_[lumi] = lumiProcessedJptr->value();
311 
312  {
313  auto itr = sourceEventsReport_.find(lumi);
314  if (itr==sourceEventsReport_.end()) {
315  //do not throw exception in case of signal termination
316  if (edm::shutdown_flag) {
317  edm::LogInfo("FastMonitoringService") << "Run interrupted. Skip writing EoL information -: "
318  << processedEventsPerLumi_[lumi] << " events were processed in LUMI " << lumi;
319  //this will prevent output modules from producing json file for possibly incomplete lumi
321  return;
322  }
323  //disable this exception, so service can be used standalone (will be thrown if output module asks for this information)
324  //throw cms::Exception("FastMonitoringService") << "SOURCE did not send update for lumi block. LUMI -:" << lumi;
325  }
326  else {
327  if (itr->second!=processedEventsPerLumi_[lumi]) {
328  throw cms::Exception("FastMonitoringService") << "MISMATCH with SOURCE update. LUMI -: "
329  << lumi
330  << ", events(processed):" << processedEventsPerLumi_[lumi]
331  << " events(source):" << itr->second;
332  }
333  sourceEventsReport_.erase(itr);
334  }
335  }
336  edm::LogInfo("FastMonitoringService") << "Statistics for lumisection -: lumi = " << lumi << " events = "
337  << lumiProcessedJptr->value() << " time = " << usecondsForLumi/1000000
338  << " size = " << accuSize << " thr = " << throughput;
339  delete lumiProcessedJptr;
340 
341  //full global and stream merge&output for this lumi
342  fmt_.jsonMonitor_->outputFullJSON(slow.string(),lumi);//full global and stream merge and JSON write for this lumi
343  fmt_.jsonMonitor_->discardCollected(lumi);//we don't do further updates for this lumi
344 
346  }
#define LogDebug(id)
std::map< unsigned int, timeval > lumiStartTime_
std::map< unsigned int, unsigned long > accuSize_
tuple lumi
Definition: fjr2json.py:35
volatile std::atomic< bool > shutdown_flag
tuple path
else: Piece not in the list, fine.
void doSnapshot(const unsigned int ls, const bool isGlobalEOL)
constexpr double throughputFactor()
boost::filesystem::path workingDirectory_
std::map< unsigned int, unsigned int > processedEventsPerLumi_
std::map< unsigned int, unsigned int > sourceEventsReport_
std::unique_ptr< FastMonitor > jsonMonitor_
void evf::FastMonitoringService::preModuleBeginJob ( edm::ModuleDescription const &  desc)

Definition at line 215 of file FastMonitoringService.cc.

References encModule_, fmt_, fff_deleter::lock(), edm::ModuleDescription::moduleName(), evf::FastMonitoringThread::monlock_, evf::FastMonitoringService::Encoding::update(), and evf::FastMonitoringService::Encoding::updateReserved().

Referenced by FastMonitoringService().

216  {
217  std::lock_guard<std::mutex> lock(fmt_.monlock_);
218  //std::cout << " Pre module Begin Job module: " << desc.moduleName() << std::endl;
219 
220  //build a map of modules keyed by their module description address
221  //here we need to treat output modules in a special way so they can be easily singled out
222  if(desc.moduleName() == "Stream" || desc.moduleName() == "ShmStreamConsumer" ||
223  desc.moduleName() == "EventStreamFileWriter" || desc.moduleName() == "PoolOutputModule")
224  encModule_.updateReserved((void*)&desc);
225  else
226  encModule_.update((void*)&desc);
227  }
void evf::FastMonitoringService::preModuleEvent ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)

Definition at line 468 of file FastMonitoringService.cc.

References microstate_, edm::ModuleCallingContext::moduleDescription(), edm::StreamContext::streamID(), and edm::StreamID::value().

Referenced by FastMonitoringService().

469  {
470  microstate_[sc.streamID().value()] = (void*)(mcc.moduleDescription());
471  }
std::vector< const void * > microstate_
void evf::FastMonitoringService::prePathEvent ( edm::StreamContext const &  sc,
edm::PathContext const &  pc 
)

Definition at line 394 of file FastMonitoringService.cc.

References collectedPathList_, encPath_, edm::EventID::event(), eventCountForPathInit_, edm::StreamContext::eventID(), firstEventId_, fmt_, fff_deleter::lock(), evf::FastMonitoringThread::m_data, makePathLegenda(), ministate_, evf::FastMonitoringThread::MonitorData::ministateBins_, evf::FastMonitoringThread::monlock_, pathLegendFile_, pathLegendWritten_, edm::PathContext::pathName(), edm::StreamContext::streamID(), AlCaHLTBitMon_QueryRunRegistry::string, and unlikely.

Referenced by FastMonitoringService().

395  {
396  //make sure that all path names are retrieved before allowing ministate to change
397  //hack: assume memory is synchronized after ~50 events seen by each stream
398  if (unlikely(eventCountForPathInit_[sc.streamID()]<50) && false==collectedPathList_[sc.streamID()]->load(std::memory_order_acquire))
399  {
400  //protection between stream threads, as well as the service monitoring thread
401  std::lock_guard<std::mutex> lock(fmt_.monlock_);
402 
403  if (firstEventId_[sc.streamID()]==0)
404  firstEventId_[sc.streamID()]=sc.eventID().event();
405  if (sc.eventID().event()==firstEventId_[sc.streamID()])
406  {
407  encPath_[sc.streamID()].update((void*)&pc.pathName());
408  return;
409  }
410  else {
411  //finished collecting path names
412  collectedPathList_[sc.streamID()]->store(true,std::memory_order_seq_cst);
413  fmt_.m_data.ministateBins_=encPath_[sc.streamID()].vecsize();
414  if (!pathLegendWritten_) {
415  std::string pathLegendStr = makePathLegenda();
416  FileIO::writeStringToFile(pathLegendFile_, pathLegendStr);
417  pathLegendWritten_=true;
418  }
419  }
420  }
421  else {
422  ministate_[sc.streamID()] = &(pc.pathName());
423  }
424  }
std::vector< unsigned int > eventCountForPathInit_
#define unlikely(x)
Definition: Likely.h:21
std::vector< std::atomic< bool > * > collectedPathList_
std::vector< unsigned long > firstEventId_
std::vector< const void * > ministate_
std::vector< Encoding > encPath_
void evf::FastMonitoringService::preSourceEvent ( edm::StreamID  sid)

Definition at line 458 of file FastMonitoringService.cc.

References microstate_, evf::MicroStateService::mInput, evf::MicroStateService::reservedMicroStateNames, and edm::StreamID::value().

Referenced by FastMonitoringService().

459  {
461  }
static const edm::ModuleDescription reservedMicroStateNames[mCOUNT]
std::vector< const void * > microstate_
unsigned int value() const
Definition: StreamID.h:46
void evf::FastMonitoringService::preStreamBeginLumi ( edm::StreamContext const &  sc)

Definition at line 354 of file FastMonitoringService.cc.

References edm::StreamContext::eventID(), fmt_, fff_deleter::lock(), edm::EventID::luminosityBlock(), evf::FastMonitoringThread::m_data, evf::MicroStateService::mFwkOvh, microstate_, ministate_, evf::FastMonitoringThread::monlock_, nopath_, evf::FastMonitoringThread::MonitorData::processed_, evf::MicroStateService::reservedMicroStateNames, edm::StreamContext::streamID(), evf::FastMonitoringThread::MonitorData::streamLumi_, and edm::StreamID::value().

Referenced by FastMonitoringService().

355  {
356  unsigned int sid = sc.streamID().value();
357  std::lock_guard<std::mutex> lock(fmt_.monlock_);
358  fmt_.m_data.streamLumi_[sid] = sc.eventID().luminosityBlock();
359 
360  //reset collected values for this stream
361  *(fmt_.m_data.processed_[sid])=0;
362 
363  ministate_[sid]=&nopath_;
365  }
static const edm::ModuleDescription reservedMicroStateNames[mCOUNT]
std::vector< AtomicMonUInt * > processed_
static const std::string nopath_
std::vector< const void * > microstate_
std::vector< const void * > ministate_
std::vector< unsigned int > streamLumi_
void evf::FastMonitoringService::preStreamEndLumi ( edm::StreamContext const &  sc)

Definition at line 372 of file FastMonitoringService.cc.

References doStreamEOLSnapshot(), edm::StreamContext::eventID(), fmt_, svgfig::load(), fff_deleter::lock(), edm::EventID::luminosityBlock(), evf::MicroStateService::mEoL, microstate_, ministate_, evf::FastMonitoringThread::monlock_, nopath_, evf::MicroStateService::reservedMicroStateNames, streamCounterUpdating_, edm::StreamContext::streamID(), and edm::StreamID::value().

Referenced by FastMonitoringService().

373  {
374  unsigned int sid = sc.streamID().value();
375  std::lock_guard<std::mutex> lock(fmt_.monlock_);
376 
377  #if ATOMIC_LEVEL>=2
378  //spinlock to make sure we are not still updating event counter somewhere
379  while (streamCounterUpdating_[sid]->load(std::memory_order_acquire)) {}
380  #endif
381 
382  //update processed count to be complete at this time
383  doStreamEOLSnapshot(sc.eventID().luminosityBlock(),sid);
384  //reset this in case stream does not get notified of next lumi (we keep processed events only)
385  ministate_[sid]=&nopath_;
387  }
static const edm::ModuleDescription reservedMicroStateNames[mCOUNT]
std::vector< std::atomic< bool > * > streamCounterUpdating_
void doStreamEOLSnapshot(const unsigned int ls, const unsigned int streamID)
static const std::string nopath_
def load
Definition: svgfig.py:546
std::vector< const void * > microstate_
std::vector< const void * > ministate_
void evf::FastMonitoringService::reportEventsThisLumiInSource ( unsigned int  lumi,
unsigned int  events 
)

Definition at line 593 of file FastMonitoringService.cc.

References fmt_, fff_deleter::lock(), evf::FastMonitoringThread::monlock_, and sourceEventsReport_.

Referenced by FedRawDataInputSource::checkNextEvent(), and FedRawDataInputSource::getNextEvent().

594  {
595 
596  std::lock_guard<std::mutex> lock(fmt_.monlock_);
597  auto itr = sourceEventsReport_.find(lumi);
598  if (itr!=sourceEventsReport_.end())
599  itr->second+=events;
600  else
602 
603  }
tuple lumi
Definition: fjr2json.py:35
tuple events
Definition: patZpeak.py:19
std::map< unsigned int, unsigned int > sourceEventsReport_
void evf::FastMonitoringService::setMicroState ( MicroStateService::Microstate  m)
virtual

Implements evf::MicroStateService.

Definition at line 483 of file FastMonitoringService.cc.

References i, microstate_, nStreams_, and evf::MicroStateService::reservedMicroStateNames.

484  {
485  for (unsigned int i=0;i<nStreams_;i++)
487  }
int i
Definition: DBlmapReader.cc:9
static const edm::ModuleDescription reservedMicroStateNames[mCOUNT]
std::vector< const void * > microstate_
void evf::FastMonitoringService::setMicroState ( edm::StreamID  sid,
MicroStateService::Microstate  m 
)
virtual

Implements evf::MicroStateService.

Definition at line 490 of file FastMonitoringService.cc.

References m, microstate_, and evf::MicroStateService::reservedMicroStateNames.

491  {
493  }
static const edm::ModuleDescription reservedMicroStateNames[mCOUNT]
std::vector< const void * > microstate_
void evf::FastMonitoringService::startedLookingForFile ( )

Definition at line 508 of file FastMonitoringService.cc.

References fileLookStart_.

Referenced by FedRawDataInputSource::readSupervisor().

508  {
509  gettimeofday(&fileLookStart_, 0);
510  /*
511  std::cout << "Started looking for .raw file at: s=" << fileLookStart_.tv_sec << ": ms = "
512  << fileLookStart_.tv_usec / 1000.0 << std::endl;
513  */
514  }
void evf::FastMonitoringService::stoppedLookingForFile ( unsigned int  lumi)

Definition at line 516 of file FastMonitoringService.cc.

References avgLeadTime_, fileLookStart_, fileLookStop_, fmt_, i, leadTimes_, fff_deleter::lock(), fjr2json::lumi, lumiFromSource_, and evf::FastMonitoringThread::monlock_.

Referenced by FedRawDataInputSource::readSupervisor().

516  {
517  gettimeofday(&fileLookStop_, 0);
518  /*
519  std::cout << "Stopped looking for .raw file at: s=" << fileLookStop_.tv_sec << ": ms = "
520  << fileLookStop_.tv_usec / 1000.0 << std::endl;
521  */
522  std::lock_guard<std::mutex> lock(fmt_.monlock_);
523 
524  if (lumi>lumiFromSource_) {
526  leadTimes_.clear();
527  }
528  unsigned long elapsedTime = (fileLookStop_.tv_sec - fileLookStart_.tv_sec) * 1000000 // sec to us
529  + (fileLookStop_.tv_usec - fileLookStart_.tv_usec); // us
530  // add this to lead times for this lumi
531  leadTimes_.push_back((double)elapsedTime);
532 
533  // recompute average lead time for this lumi
534  if (leadTimes_.size() == 1) avgLeadTime_[lumi] = leadTimes_[0];
535  else {
536  double totTime = 0;
537  for (unsigned int i = 0; i < leadTimes_.size(); i++) totTime += leadTimes_[i];
538  avgLeadTime_[lumi] = 0.001*(totTime / leadTimes_.size());
539  }
540  }
int i
Definition: DBlmapReader.cc:9
tuple lumi
Definition: fjr2json.py:35
std::map< unsigned int, double > avgLeadTime_
std::vector< double > leadTimes_

Member Data Documentation

std::map<unsigned int, unsigned long> evf::FastMonitoringService::accuSize_
private
std::map<unsigned int, double> evf::FastMonitoringService::avgLeadTime_
private

Definition at line 221 of file FastMonitoringService.h.

Referenced by doSnapshot(), preGlobalBeginLumi(), and stoppedLookingForFile().

std::vector<std::atomic<bool>*> evf::FastMonitoringService::collectedPathList_
private

Definition at line 235 of file FastMonitoringService.h.

Referenced by preallocate(), and prePathEvent().

Encoding evf::FastMonitoringService::encModule_
private
std::vector<Encoding> evf::FastMonitoringService::encPath_
private
std::vector<unsigned int> evf::FastMonitoringService::eventCountForPathInit_
private

Definition at line 236 of file FastMonitoringService.h.

Referenced by postEvent(), preallocate(), and prePathEvent().

std::string evf::FastMonitoringService::fastMicrostateDefPath_
private

Definition at line 198 of file FastMonitoringService.h.

Referenced by preallocate().

unsigned int evf::FastMonitoringService::fastMonIntervals_
private

Definition at line 196 of file FastMonitoringService.h.

Referenced by dowork().

std::string evf::FastMonitoringService::fastName_
private

Definition at line 199 of file FastMonitoringService.h.

Referenced by preallocate().

std::string evf::FastMonitoringService::fastPath_
private

Definition at line 199 of file FastMonitoringService.h.

Referenced by dowork(), and preallocate().

timeval evf::FastMonitoringService::fileLookStart_
private

Definition at line 204 of file FastMonitoringService.h.

Referenced by startedLookingForFile(), and stoppedLookingForFile().

timeval evf::FastMonitoringService::fileLookStop_
private

Definition at line 204 of file FastMonitoringService.h.

Referenced by stoppedLookingForFile().

std::map<unsigned int, unsigned int> evf::FastMonitoringService::filesProcessedDuringLumi_
private

Definition at line 222 of file FastMonitoringService.h.

Referenced by accumulateFileSize(), doSnapshot(), and preGlobalBeginLumi().

std::vector<unsigned long> evf::FastMonitoringService::firstEventId_
private

Definition at line 234 of file FastMonitoringService.h.

Referenced by preallocate(), and prePathEvent().

FastMonitoringThread evf::FastMonitoringService::fmt_
private
bool evf::FastMonitoringService::isGlobalLumiTransition_
private
unsigned int evf::FastMonitoringService::lastGlobalLumi_
private

Definition at line 206 of file FastMonitoringService.h.

Referenced by dowork(), preallocate(), and preGlobalBeginLumi().

std::queue<unsigned int> evf::FastMonitoringService::lastGlobalLumisClosed_
private

Definition at line 207 of file FastMonitoringService.h.

Referenced by postGlobalEndLumi(), and preGlobalBeginLumi().

std::vector<double> evf::FastMonitoringService::leadTimes_
private

Definition at line 225 of file FastMonitoringService.h.

Referenced by stoppedLookingForFile().

unsigned int evf::FastMonitoringService::lumiFromSource_
private

Definition at line 209 of file FastMonitoringService.h.

Referenced by preallocate(), and stoppedLookingForFile().

std::map<unsigned int, timeval> evf::FastMonitoringService::lumiStartTime_
private

Definition at line 203 of file FastMonitoringService.h.

Referenced by preGlobalBeginLumi(), and preGlobalEndLumi().

FastMonitoringThread::Macrostate evf::FastMonitoringService::macrostate_
private
const std::string evf::FastMonitoringService::macroStateNames
static
Initial value:
=
{"Init","JobReady","RunGiven","Running",
"Stopping","Done","JobEnded","Error","ErrorEnded","End",
"Invalid"}

Definition at line 108 of file FastMonitoringService.h.

std::vector<const void*> evf::FastMonitoringService::microstate_
private
std::string evf::FastMonitoringService::microstateDefPath_
private

Definition at line 198 of file FastMonitoringService.h.

Referenced by preallocate().

std::vector<const void*> evf::FastMonitoringService::ministate_
private
std::string evf::FastMonitoringService::moduleLegendFile_
private

Definition at line 247 of file FastMonitoringService.h.

Referenced by postBeginJob(), and preallocate().

std::atomic<bool> evf::FastMonitoringService::monInit_
private

Definition at line 251 of file FastMonitoringService.h.

Referenced by dowork(), and preallocate().

const std::string evf::FastMonitoringService::nopath_ = "NoPath"
static
unsigned int evf::FastMonitoringService::nStreams_
private

Definition at line 193 of file FastMonitoringService.h.

Referenced by doSnapshot(), preallocate(), and setMicroState().

unsigned int evf::FastMonitoringService::nThreads_
private

Definition at line 194 of file FastMonitoringService.h.

Referenced by preallocate().

std::string evf::FastMonitoringService::pathLegendFile_
private

Definition at line 248 of file FastMonitoringService.h.

Referenced by preallocate(), and prePathEvent().

bool evf::FastMonitoringService::pathLegendWritten_ = false
private

Definition at line 249 of file FastMonitoringService.h.

Referenced by prePathEvent().

std::vector<bool> evf::FastMonitoringService::pathNamesReady_
private

Definition at line 237 of file FastMonitoringService.h.

std::map<unsigned int, unsigned int> evf::FastMonitoringService::processedEventsPerLumi_
private
boost::filesystem::path evf::FastMonitoringService::runDirectory_
private

Definition at line 239 of file FastMonitoringService.h.

Referenced by getRunDirName(), and preallocate().

int evf::FastMonitoringService::sleepTime_
private

Definition at line 195 of file FastMonitoringService.h.

Referenced by dowork().

std::string evf::FastMonitoringService::slowName_
private

Definition at line 199 of file FastMonitoringService.h.

Referenced by preGlobalEndLumi().

unsigned int evf::FastMonitoringService::snapCounter_ = 0
private

Definition at line 197 of file FastMonitoringService.h.

Referenced by dowork().

std::map<unsigned int,unsigned int> evf::FastMonitoringService::sourceEventsReport_
private

Definition at line 241 of file FastMonitoringService.h.

Referenced by preGlobalEndLumi(), and reportEventsThisLumiInSource().

std::vector<std::atomic<bool>*> evf::FastMonitoringService::streamCounterUpdating_
private

Definition at line 232 of file FastMonitoringService.h.

Referenced by postEvent(), preallocate(), and preStreamEndLumi().

bool evf::FastMonitoringService::threadIDAvailable_ = false
private

Definition at line 243 of file FastMonitoringService.h.

Referenced by preallocate().

std::vector<const void*> evf::FastMonitoringService::threadMicrostate_
private

Definition at line 217 of file FastMonitoringService.h.

std::atomic<unsigned long> evf::FastMonitoringService::totalEventsProcessed_
private

Definition at line 245 of file FastMonitoringService.h.

Referenced by postEvent().

boost::filesystem::path evf::FastMonitoringService::workingDirectory_
private

Definition at line 239 of file FastMonitoringService.h.

Referenced by preallocate(), and preGlobalEndLumi().