CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FUEventProcessor.h
Go to the documentation of this file.
1 #ifndef FUEVENTPROCESSOR_H
2 #define FUEVENTPROCESSOR_H 1
3 
10 
13 #include "SubProcess.h"
14 #include "FWEPWrapper.h"
15 
17 
18 #include "xdaq/Application.h"
19 #include "xdaq/NamespaceURI.h"
20 
21 #include "xdata/String.h"
22 #include "xdata/Integer.h"
23 #include "xdata/Boolean.h"
24 #include "xdata/Vector.h"
25 #include "xdata/UnsignedInteger32.h"
26 #include "xdata/ActionListener.h"
27 #include "xdata/InfoSpaceFactory.h"
28 
29 #include "xgi/Input.h"
30 #include "xgi/Output.h"
31 #include "xgi/exception/Exception.h"
32 
33 #include <sys/time.h>
34 #include <pthread.h>
35 
36 #include <list>
37 #include <vector>
38 #include <map>
39 
40 namespace evf
41 {
42 
43  /* to be filled in with summary from paths */
44  struct filter {
45 
46  };
47  class CPUStat;
48  class RateStat;
49  namespace internal{
50 
51  class MyCgi : public xgi::Input{
52  public:
53  MyCgi() : xgi::Input("",0){}
54  // MyCgi(xgi::Input &b) : xgi::Input("",0) {environment_ = b.environment_;}
55  std::map<std::string, std::string, std::less<std::string> > &getEnvironment(){return environment_;}
56  };
57  }
58  class FUEventProcessor : public xdaq::Application,
59  public xdata::ActionListener
60  {
61  public:
62  //
63  // construction/destruction
64  //
66  FUEventProcessor(xdaq::ApplicationStub *s);
67  virtual ~FUEventProcessor();
68 
69 
70  //
71  // member functions
72  //
73 
74  // work loop functions to be executed during transitional states (async)
75  bool configuring(toolbox::task::WorkLoop* wl);
76  bool enabling(toolbox::task::WorkLoop* wl);
77  bool stopping(toolbox::task::WorkLoop* wl);
78  bool halting(toolbox::task::WorkLoop* wl);
79 
80  // fsm soap command callback
81  xoap::MessageReference fsmCallback(xoap::MessageReference msg)
83 
84  // xdata:ActionListener interface
85  void actionPerformed(xdata::Event& e);
86 
87  // trigger report related helper functions
88  // std::string triggerReportToString(const edm::TriggerReport& tr);
89  // void triggerReportToTable(const edm::TriggerReport& tr);
90  // void printTriggerReport(const edm::TriggerReport& tr);
91 
92  // HyperDAQ related functions
102  {
103  css_.css(in,out);
104  }
105 
106  void subWeb(xgi::Input *in,xgi::Output *out);
109  void microState(xgi::Input *in,xgi::Output *out);
110  void updater(xgi::Input *in,xgi::Output *out);
111  void procStat(xgi::Input *in,xgi::Output *out);
113 
114  private:
115 
116  void attachDqmToShm() throw (evf::Exception);
117  void detachDqmFromShm() throw (evf::Exception);
118 
119  std::string logsAsString();
120  void localLog(std::string);
121 
122  // MPEP functions
123  void startSupervisorLoop();
124  void startReceivingLoop();
126  // calculate scalers information in separate thread
127  void startScalersWorkLoop() throw (evf::Exception);
128  bool scalers(toolbox::task::WorkLoop* wl);
129  void startSummarizeWorkLoop() throw (evf::Exception);
130  bool summarize(toolbox::task::WorkLoop* wl);
131 
132  bool receiving(toolbox::task::WorkLoop* wl);
133  bool receivingAndMonitor(toolbox::task::WorkLoop* wl);
134  bool supervisor(toolbox::task::WorkLoop* wl);
135  bool enableCommon();
136  bool enableClassic();
137  // void enableMPEPMaster();
138  bool enableMPEPSlave();
139  bool stopClassic();
141  void makeStaticInfo();
142 
143  //
144  // member data
145  //
146 
147  // finite state machine
149 
150  // logger
151  Logger log_;
152 
153  // edm event processor
155 
156  // parameters published to XDAQ info space(s)
157  xdata::String url_;
158  xdata::String class_;
159  xdata::UnsignedInteger32 instance_;
160  xdata::UnsignedInteger32 runNumber_;
161  xdata::Boolean epInitialized_;
162  xdata::String configString_;
163  std::string configuration_;
164 
165  xdata::Boolean outPut_;
166 
167  xdata::Boolean autoRestartSlaves_;
168  xdata::UnsignedInteger32 slaveRestartDelaySecs_;
169 
170  xdata::Boolean hasShMem_;
171  xdata::Boolean hasPrescaleService_;
172  xdata::Boolean hasModuleWebRegistry_;
173  xdata::Boolean hasServiceWebRegistry_;
174  xdata::Boolean isRunNumberSetter_;
175  xdata::Boolean iDieStatisticsGathering_;
176  bool outprev_;
177 
178  // application identifier
179  std::string sourceId_;
180 
181  // flashlist variables, squids
182  xdata::Boolean squidPresent_;
183 
184  // behavior on error - configurable
185 
186  xdata::Boolean exitOnError_;
187 
188  // HyperDAQ related
190 
191  // Misc
193 
195  std::vector<std::string> logRing_;
196  unsigned int logRingIndex_;
197  static const unsigned int logRingSize_ = 50;
198  bool logWrap_;
199 
200  xdata::UnsignedInteger32 nbSubProcesses_;
201  xdata::UnsignedInteger32 nbSubProcessesReporting_;
202  std::vector<SubProcess> subs_;
203  unsigned int nblive_;
204  unsigned int nbdead_;
205 
206  unsigned int nbTotalDQM_;
207 
208  // workloop / action signature for message passing
209  toolbox::task::WorkLoop *wlReceiving_;
210  toolbox::task::ActionSignature *asReceiveMsgAndExecute_;
212  toolbox::task::WorkLoop *wlReceivingMonitor_;
213  toolbox::task::ActionSignature *asReceiveMsgAndRead_;
216  toolbox::task::WorkLoop *wlSupervising_;
217  toolbox::task::ActionSignature *asSupervisor_;
219 
220  xdata::InfoSpace* monitorInfoSpace_;
221  xdata::InfoSpace* monitorLegendaInfoSpace_;
222  xdata::InfoSpace* applicationInfoSpace_;
223  pthread_mutex_t stop_lock_;
224  pthread_mutex_t start_lock_;
225  pthread_mutex_t pickup_lock_;
226  std::string updaterStatic_;
227  xdata::Serializable *nbProcessed;
228  xdata::Serializable *nbAccepted;
229 
230  // flahslist variables, scalers
231  xdata::InfoSpace *scalersInfoSpace_;
232  xdata::InfoSpace *scalersLegendaInfoSpace_;
233 
234  //scalers workloop
235  toolbox::task::WorkLoop *wlScalers_;
236  toolbox::task::ActionSignature *asScalers_;
238  unsigned int scalersUpdates_;
239 
240  //summarize workloop
241  toolbox::task::WorkLoop *wlSummarize_;
242  toolbox::task::ActionSignature *asSummarize_;
245  xdata::Vector<xdata::Integer> spMStates_;
246  xdata::Vector<xdata::Integer> spmStates_;
247  xdata::UnsignedInteger32 superSleepSec_;
248  std::list<std::string> names_;
249  xdata::String iDieUrl_;
251  pid_t vp_;
254 
260  };
261 
262 } // namespace evf
263 
264 
265 #endif
xdata::Boolean hasModuleWebRegistry_
void spotlightWebPage(xgi::Input *, xgi::Output *)
xdata::Vector< xdata::Integer > spMStates_
xdata::InfoSpace * monitorInfoSpace_
void subWeb(xgi::Input *in, xgi::Output *out)
#define Input(cl)
Definition: vmac.h:189
std::vector< std::string > logRing_
bool receivingAndMonitor(toolbox::task::WorkLoop *wl)
xdata::UnsignedInteger32 slaveRestartDelaySecs_
xdata::UnsignedInteger32 runNumber_
void updater(xgi::Input *in, xgi::Output *out)
toolbox::task::WorkLoop * wlScalers_
void serviceWeb(xgi::Input *in, xgi::Output *out)
pthread_mutex_t start_lock_
void moduleWeb(xgi::Input *in, xgi::Output *out)
Definition: FWEPWrapper.cc:990
std::map< std::string, std::string, std::less< std::string > > & getEnvironment()
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:28
xdata::Boolean isRunNumberSetter_
xdata::Boolean hasServiceWebRegistry_
toolbox::task::WorkLoop * wlReceiving_
xdata::Boolean hasShMem_
toolbox::task::ActionSignature * asReceiveMsgAndExecute_
xdata::InfoSpace * scalersLegendaInfoSpace_
toolbox::task::ActionSignature * asSupervisor_
xdata::Boolean autoRestartSlaves_
xdata::UnsignedInteger32 nbSubProcessesReporting_
void css(xgi::Input *in, xgi::Output *out)
toolbox::task::ActionSignature * asReceiveMsgAndRead_
xdata::Boolean exitOnError_
std::vector< SubProcess > subs_
xdata::InfoSpace * monitorLegendaInfoSpace_
bool summarize(toolbox::task::WorkLoop *wl)
xdata::Serializable * nbProcessed
xoap::MessageReference fsmCallback(xoap::MessageReference msg)
bool halting(toolbox::task::WorkLoop *wl)
evf::StateMachine fsm_
bool scalers(toolbox::task::WorkLoop *wl)
toolbox::task::WorkLoop * wlSupervising_
std::string reasonForFailedState_
FUEventProcessor(xdaq::ApplicationStub *s)
xdata::Boolean iDieStatisticsGathering_
void css(xgi::Input *in, xgi::Output *out)
Definition: Css.h:15
void scalersWeb(xgi::Input *, xgi::Output *)
xdata::Boolean squidPresent_
std::list< std::string > names_
Definition: Css.h:12
xdata::Boolean hasPrescaleService_
bool receiving(toolbox::task::WorkLoop *wl)
bool stopping(toolbox::task::WorkLoop *wl)
void procStat(xgi::Input *in, xgi::Output *out)
toolbox::task::WorkLoop * wlSummarize_
xdata::Serializable * nbAccepted
tuple out
Definition: dbtoconf.py:99
void localLog(std::string)
bool configuring(toolbox::task::WorkLoop *wl)
xdata::InfoSpace * applicationInfoSpace_
xdata::UnsignedInteger32 nbSubProcesses_
bool enabling(toolbox::task::WorkLoop *wl)
unsigned int scalersUpdates_
xdata::String configString_
xdata::UnsignedInteger32 superSleepSec_
string const
Definition: compareJSON.py:14
void sendMessageOverMonitorQueue(MsgBuf &)
void moduleWeb(xgi::Input *in, xgi::Output *out)
void pathNames(xgi::Input *, xgi::Output *)
#define Output(cl)
Definition: vmac.h:193
pthread_mutex_t pickup_lock_
void defaultWebPage(xgi::Input *in, xgi::Output *out)
toolbox::task::ActionSignature * asSummarize_
xdata::Vector< xdata::Integer > spmStates_
xdata::UnsignedInteger32 instance_
void serviceWeb(xgi::Input *in, xgi::Output *out)
string s
Definition: asciidump.py:422
toolbox::task::WorkLoop * wlReceivingMonitor_
toolbox::task::ActionSignature * asScalers_
bool supervisor(toolbox::task::WorkLoop *wl)
pthread_mutex_t stop_lock_
xdata::InfoSpace * scalersInfoSpace_
void actionPerformed(xdata::Event &e)
void microState(xgi::Input *in, xgi::Output *out)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
static const unsigned int logRingSize_
xdata::Boolean epInitialized_