ROOT  6.06/09
Reference Guide
TProofServ.h
Go to the documentation of this file.
1 // @(#)root/proof:$Id$
2 // Author: Fons Rademakers 16/02/97
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 
13 #ifndef ROOT_TProofServ
14 #define ROOT_TProofServ
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TProofServ //
19 // //
20 // TProofServ is the PROOF server. It can act either as the master //
21 // server or as a slave server, depending on its startup arguments. It //
22 // receives and handles message coming from the client or from the //
23 // master server. //
24 // //
25 //////////////////////////////////////////////////////////////////////////
26 
27 #ifndef ROOT_TApplication
28 #include "TApplication.h"
29 #endif
30 #ifndef ROOT_TString
31 #include "TString.h"
32 #endif
33 #ifndef ROOT_TSysEvtHandler
34 #include "TSysEvtHandler.h"
35 #endif
36 #ifndef ROOT_TStopwatch
37 #include "TStopwatch.h"
38 #endif
39 #ifndef ROOT_TTimer
40 #include "TTimer.h"
41 #endif
42 #ifndef ROOT_TProofQueryResult
43 #include "TProofQueryResult.h"
44 #endif
45 
46 class TDataSetManager;
48 class TDSet;
49 class TDSetElement;
50 class TFileCollection;
51 class TFileHandler;
52 class THashList;
53 class TIdleTOTimer;
54 class TList;
55 class TMap;
56 class TMessage;
57 class TMonitor;
58 class TMutex;
59 class TProof;
60 class TProofLockPath;
62 class TReaperTimer;
63 class TServerSocket;
64 class TShutdownTimer;
65 class TSocket;
67 
68 // Hook to external function setting up authentication related stuff
69 // for old versions.
70 // For backward compatibility
72  TString &, TString &, TString &);
73 
74 
75 class TProofServ : public TApplication {
76 
77 friend class TProofServLite;
78 friend class TXProofServ;
79 
80 public:
81  enum EStatusBits { kHighMemory = BIT(16) };
83 
84 private:
85  TString fService; //service we are running, either "proofserv" or "proofslave"
86  TString fUser; //user as which we run
87  TString fGroup; //group the user belongs to
88  TString fConfDir; //directory containing cluster config information
89  TString fConfFile; //file containing config information
90  TString fWorkDir; //directory containing all proof related info
91  TString fImage; //image name of the session
92  TString fSessionTag; //tag for the server session
93  TString fTopSessionTag; //tag for the global session
94  TString fSessionDir; //directory containing session dependent files
95  TString fPackageDir; //directory containing packages and user libs
96  THashList *fGlobalPackageDirList; //list of directories containing global packages libs
97  TString fCacheDir; //directory containing cache of user files
98  TString fQueryDir; //directory containing query results and status
99  TString fDataSetDir; //directory containing info about known data sets
100  TString fDataDir; //directory containing data files produced during queries
101  TString fDataDirOpts; //Url type options for fDataDir
102  TString fAdminPath; //admin path for this session
103  TString fOutputFile; //path with the temporary results of the current or last query
104  TProofLockPath *fPackageLock; //package dir locker
105  TProofLockPath *fCacheLock; //cache dir locker
106  TProofLockPath *fQueryLock; //query dir locker
107  TString fArchivePath; //default archive path
108  TSocket *fSocket; //socket connection to client
109  TProof *fProof; //PROOF talking to slave servers
110  TVirtualProofPlayer *fPlayer; //actual player
111  FILE *fLogFile; //log file
112  Int_t fLogFileDes; //log file descriptor
113  Long64_t fLogFileMaxSize; //max size for log files (enabled if > 0)
114  TList *fEnabledPackages; //list of enabled packages
115  Int_t fProtocol; //protocol version number
116  TString fOrdinal; //slave ordinal number
117  Int_t fGroupId; //slave unique id in the active slave group
118  Int_t fGroupSize; //size of the active slave group
119  Int_t fLogLevel; //debug logging level
120  Int_t fNcmd; //command history number
121  Int_t fGroupPriority; //priority of group the user belongs to (0 - 100)
122  Bool_t fEndMaster; //true for a master in direct contact only with workers
123  Bool_t fMasterServ; //true if we are a master server
124  Bool_t fInterrupt; //if true macro execution will be stopped
125  Float_t fRealTime; //real time spent executing commands
126  Float_t fCpuTime; //CPU time spent executing commands
127  TStopwatch fLatency; //measures latency of packet requests
128  TStopwatch fCompute; //measures time spent processing a packet
129  TStopwatch fSaveOutput; //measures time spent saving the partial result
130  Int_t fQuerySeqNum; //sequential number of the current or last query
131 
132  Int_t fTotSessions; //Total number of PROOF sessions on the cluster
133  Int_t fActSessions; //Total number of active PROOF sessions on the cluster
134  Float_t fEffSessions; //Effective Number of PROOF sessions on the assigned machines
135 
136  TFileHandler *fInputHandler; //Input socket handler
137 
138  TQueryResultManager *fQMgr; //Query-result manager
139 
140  TList *fWaitingQueries; //list of TProofQueryResult waiting to be processed
141  Bool_t fIdle; //TRUE if idle
142  TMutex *fQMtx; // To protect async msg queue
143 
144  TList *fQueuedMsg; //list of messages waiting to be processed
145 
146  TString fPrefix; //Prefix identifying the node
147 
148  Bool_t fRealTimeLog; //TRUE if log messages should be send back in real-time
149 
150  TShutdownTimer *fShutdownTimer; // Timer used to shutdown out-of-control sessions
151  TReaperTimer *fReaperTimer; // Timer used to control children state
152  TIdleTOTimer *fIdleTOTimer; // Timer used to control children state
153 
154  Int_t fCompressMsg; // Compression level for messages
155 
156  TDataSetManager* fDataSetManager; // dataset manager
157  TDataSetManagerFile *fDataSetStgRepo; // repository for staging requests
158 
159  Bool_t fSendLogToMaster; // On workers, controls logs sending to master
160 
161  TServerSocket *fMergingSocket; // Socket used for merging outputs if submerger
162  TMonitor *fMergingMonitor; // Monitor for merging sockets
163  Int_t fMergedWorkers; // Number of workers merged
164 
165  // Quotas (-1 to disable)
166  Int_t fMaxQueries; //Max number of queries fully kept
167  Long64_t fMaxBoxSize; //Max size of the sandbox
168  Long64_t fHWMBoxSize; //High-Water-Mark on the sandbox size
169 
170  // Memory limits (-1 to disable) set by envs ROOTPROFOASHARD, PROOF_VIRTMEMMAX, PROOF_RESMEMMAX
171  static Long_t fgVirtMemMax; //Hard limit enforced by the system (in kB)
172  static Long_t fgResMemMax; //Hard limit on the resident memory checked
173  //in TProofPlayer::Process (in kB)
174  static Float_t fgMemHWM; // Threshold fraction of max for warning and finer monitoring
175  static Float_t fgMemStop; // Fraction of max for stop processing
176 
177  // In bytes; default is 1MB
178  Long64_t fMsgSizeHWM; //High-Water-Mark on the size of messages with results
179 
180  static FILE *fgErrorHandlerFile; // File where to log
181  static Int_t fgRecursive; // Keep track of recursive inputs during processing
182 
183  // Control sending information to syslog
184  static Int_t fgLogToSysLog; // >0 sent to syslog too
185  static TString fgSysLogService; // name of the syslog service (eg: proofm-0, proofw-0.67)
186  static TString fgSysLogEntity; // logging entity (<user>:<group>)
187 
188  Int_t GetCompressionLevel() const;
189 
190  void RedirectOutput(const char *dir = 0, const char *mode = "w");
191  Int_t CatMotd();
192  Int_t UnloadPackage(const char *package);
194  Int_t OldAuthSetup(TString &wconf);
195  Int_t GetPriority();
196 
197  // Query handlers
199  TList *inl, Long64_t first, TDSet *dset,
200  const char *selec, TObject *elist);
202 
203  // Results handling
204  Int_t SendResults(TSocket *sock, TList *outlist = 0, TQueryResult *pq = 0);
205  Bool_t AcceptResults(Int_t connections, TVirtualProofPlayer *mergerPlayer);
206 
207  // Waiting queries handlers
208  void SetIdle(Bool_t st = kTRUE);
209  Bool_t IsWaiting();
213  Int_t CleanupWaitingQueries(Bool_t del = kTRUE, TList *qls = 0);
214 
215 protected:
216  virtual void HandleArchive(TMessage *mess, TString *slb = 0);
217  virtual Int_t HandleCache(TMessage *mess, TString *slb = 0);
218  virtual void HandleCheckFile(TMessage *mess, TString *slb = 0);
219  virtual Int_t HandleDataSets(TMessage *mess, TString *slb = 0);
220  virtual void HandleSubmerger(TMessage *mess);
221  virtual void HandleFork(TMessage *mess);
222  virtual Int_t HandleLibIncPath(TMessage *mess);
223  virtual void HandleProcess(TMessage *mess, TString *slb = 0);
224  virtual void HandleQueryList(TMessage *mess);
225  virtual void HandleRemove(TMessage *mess, TString *slb = 0);
226  virtual void HandleRetrieve(TMessage *mess, TString *slb = 0);
227  virtual Int_t HandleWorkerLists(TMessage *mess);
228 
229  virtual void ProcessNext(TString *slb = 0);
230  virtual Int_t Setup();
231  Int_t SetupCommon();
232  virtual void MakePlayer();
233  virtual void DeletePlayer();
234 
235  virtual Int_t Fork();
237  Bool_t IsIdle();
238  Bool_t UnlinkDataDir(const char *path);
239 
240  static TString fgLastMsg; // Message about status before exception
241  static Long64_t fgLastEntry; // Last entry before exception
242 
243 public:
244  TProofServ(Int_t *argc, char **argv, FILE *flog = 0);
245  virtual ~TProofServ();
246 
247  virtual Int_t CreateServer();
248 
249  TProof *GetProof() const { return fProof; }
250  const char *GetService() const { return fService; }
251  const char *GetConfDir() const { return fConfDir; }
252  const char *GetConfFile() const { return fConfFile; }
253  const char *GetUser() const { return fUser; }
254  const char *GetGroup() const { return fGroup; }
255  const char *GetWorkDir() const { return fWorkDir; }
256  const char *GetImage() const { return fImage; }
257  const char *GetSessionTag() const { return fSessionTag; }
258  const char *GetTopSessionTag() const { return fTopSessionTag; }
259  const char *GetSessionDir() const { return fSessionDir; }
260  const char *GetPackageDir() const { return fPackageDir; }
261  const char *GetCacheDir() const { return fCacheDir; }
262  const char *GetDataDir() const { return fDataDir; }
263  const char *GetDataDirOpts() const { return fDataDirOpts; }
264  Int_t GetProtocol() const { return fProtocol; }
265  const char *GetOrdinal() const { return fOrdinal; }
266  Int_t GetGroupId() const { return fGroupId; }
267  Int_t GetGroupSize() const { return fGroupSize; }
268  Int_t GetLogLevel() const { return fLogLevel; }
269  TSocket *GetSocket() const { return fSocket; }
270  Float_t GetRealTime() const { return fRealTime; }
271  Float_t GetCpuTime() const { return fCpuTime; }
272  Int_t GetQuerySeqNum() const { return fQuerySeqNum; }
273 
274  Int_t GetTotSessions() const { return fTotSessions; }
275  Int_t GetActSessions() const { return fActSessions; }
276  Float_t GetEffSessions() const { return fEffSessions; }
277 
278  void GetOptions(Int_t *argc, char **argv);
280 
281  static Long_t GetVirtMemMax();
282  static Long_t GetResMemMax();
283  static Float_t GetMemHWM();
284  static Float_t GetMemStop();
285 
286  Long64_t GetMsgSizeHWM() const { return fMsgSizeHWM; }
287 
288  const char *GetPrefix() const { return fPrefix; }
289 
290  void FlushLogFile();
291  void TruncateLogFile(); // Called also by TDSetProxy::Next()
292 
293  TProofLockPath *GetCacheLock() { return fCacheLock; } //cache dir locker; used by TProofPlayer
294 
295  virtual EQueryAction GetWorkers(TList *workers, Int_t &prioritychange,
296  Bool_t resume = kFALSE);
297  virtual void HandleException(Int_t sig);
298  virtual Int_t HandleSocketInput(TMessage *mess, Bool_t all);
299  virtual void HandleSocketInput();
300  virtual void HandleUrgentData();
301  virtual void HandleSigPipe();
302  virtual void HandleTermination() { Terminate(0); }
303  void Interrupt() { fInterrupt = kTRUE; }
304  Bool_t IsEndMaster() const { return fEndMaster; }
305  Bool_t IsMaster() const { return fMasterServ; }
306  Bool_t IsParallel() const;
307  Bool_t IsTopMaster() const { return fOrdinal == "0"; }
308 
309  void Run(Bool_t retrn = kFALSE);
310 
311  void Print(Option_t *option="") const;
312 
313  void RestartComputeTime();
314 
315  TObject *Get(const char *namecycle);
316  TDSetElement *GetNextPacket(Long64_t totalEntries = -1);
317  virtual void ReleaseWorker(const char *) { }
318  void Reset(const char *dir);
319  Int_t ReceiveFile(const char *file, Bool_t bin, Long64_t size);
320  virtual Int_t SendAsynMessage(const char *msg, Bool_t lf = kTRUE);
321  virtual void SendLogFile(Int_t status = 0, Int_t start = -1, Int_t end = -1);
322  void SendStatistics();
323  void SendParallel(Bool_t async = kFALSE);
324 
325  Int_t UpdateSessionStatus(Int_t xst = -1);
326 
327  // Disable / Enable read timeout
328  virtual void DisableTimeout() { }
329  virtual void EnableTimeout() { }
330 
331  virtual void Terminate(Int_t status);
332 
333  // Log control
334  void LogToMaster(Bool_t on = kTRUE) { fSendLogToMaster = on; }
335 
336  static FILE *SetErrorHandlerFile(FILE *ferr);
337  static void ErrorHandler(Int_t level, Bool_t abort, const char *location,
338  const char *msg);
339 
340  static void ResolveKeywords(TString &fname, const char *path = 0);
341 
342  static void SetLastMsg(const char *lastmsg);
343  static void SetLastEntry(Long64_t lastentry);
344 
345  // To handle local data server related paths
346  static void FilterLocalroot(TString &path, const char *url = "root://dum/");
347  static void GetLocalServer(TString &dsrv);
348 
349  // To prepara ethe map of files to process
351  static Int_t RegisterDataSets(TList *in, TList *out, TDataSetManager *dsm, TString &e);
352 
353  static Bool_t IsActive();
354  static TProofServ *This();
355 
356  ClassDef(TProofServ,0) //PROOF Server Application Interface
357 };
358 
360 
361 class TProofLockPath : public TNamed {
362 private:
363  Int_t fLockId; //file id of dir lock
364 
365 public:
366  TProofLockPath(const char *path) : TNamed(path,path), fLockId(-1) { }
368 
369  Int_t Lock();
370  Int_t Unlock();
371 
372  Bool_t IsLocked() const { return (fLockId > -1); }
373 };
374 
376 private:
377  TProofLockPath *fLocker; //locker instance
378 
379 public:
380  TProofLockPathGuard(TProofLockPath *l) { fLocker = l; if (fLocker) fLocker->Lock(); }
381  ~TProofLockPathGuard() { if (fLocker) fLocker->Unlock(); }
382 };
383 
384 //----- Handles output from commands executed externally via a pipe. ---------//
385 //----- The output is redirected one level up (i.e., to master or client). ---//
386 //______________________________________________________________________________
388 private:
389  TSocket *fSocket; // Socket where to redirect the message
390  FILE *fFile; // File connected with the open pipe
391  TString fPfx; // Prefix to be prepended to messages
392 
393  static TString fgPfx; // Default prefix to be prepended to messages
394  static Int_t fgCmdRtn; // Return code of the command execution (available only
395  // after closing the pipe)
396 public:
397  enum EStatusBits { kFileIsPipe = BIT(23) };
398  TProofServLogHandler(const char *cmd, TSocket *s, const char *pfx = "");
399  TProofServLogHandler(FILE *f, TSocket *s, const char *pfx = "");
400  virtual ~TProofServLogHandler();
401 
402  Bool_t IsValid() { return ((fFile && fSocket) ? kTRUE : kFALSE); }
403 
404  Bool_t Notify();
405  Bool_t ReadNotify() { return Notify(); }
406 
407  static void SetDefaultPrefix(const char *pfx);
408  static Int_t GetCmdRtn();
409 };
410 
411 //--- Guard class: close pipe, deactivatethe related descriptor --------------//
412 //______________________________________________________________________________
414 
415 private:
417 
418 public:
419  TProofServLogHandlerGuard(const char *cmd, TSocket *s,
420  const char *pfx = "", Bool_t on = kTRUE);
422  const char *pfx = "", Bool_t on = kTRUE);
423  virtual ~TProofServLogHandlerGuard();
424 };
425 
426 //--- Special timer to control delayed shutdowns
427 //______________________________________________________________________________
428 class TShutdownTimer : public TTimer {
429 private:
432 
433 public:
434  TShutdownTimer(TProofServ *p, Int_t delay);
435 
436  Bool_t Notify();
437 };
438 
439 //--- Synchronous timer used to reap children processes change of state
440 //______________________________________________________________________________
441 class TReaperTimer : public TTimer {
442 private:
443  TList *fChildren; // List of children (forked) processes
444 
445 public:
446  TReaperTimer(Long_t frequency = 1000) : TTimer(frequency, kTRUE), fChildren(0) { }
447  virtual ~TReaperTimer();
448 
449  void AddPid(Int_t pid);
450  Bool_t Notify();
451 };
452 
453 //--- Special timer to terminate idle sessions
454 //______________________________________________________________________________
455 class TIdleTOTimer : public TTimer {
456 private:
458 
459 public:
460  TIdleTOTimer(TProofServ *p, Int_t delay) : TTimer(delay, kTRUE), fProofServ(p) { }
461 
462  Bool_t Notify();
463 };
464 //______________________________________________________________________________
466 
467 private:
469 
470 public:
471  TIdleTOTimerGuard(TIdleTOTimer *t) : fIdleTOTimer(t) { if (fIdleTOTimer) fIdleTOTimer->Stop(); }
472  virtual ~TIdleTOTimerGuard() { if (fIdleTOTimer) fIdleTOTimer->Start(-1, kTRUE); }
473 };
474 
475 //______________________________________________________________________________
477 {
478  return (fCompressMsg < 0) ? -1 : fCompressMsg % 100;
479 }
480 
481 #endif
virtual void HandleException(Int_t sig)
Exception handler: we do not try to recover here, just exit.
const char * GetSessionDir() const
Definition: TProofServ.h:259
Bool_t fMasterServ
Definition: TProofServ.h:123
Int_t fNcmd
Definition: TProofServ.h:120
Float_t fEffSessions
Definition: TProofServ.h:134
FILE * fLogFile
Definition: TProofServ.h:111
Bool_t fRealTimeLog
Definition: TProofServ.h:148
Bool_t AcceptResults(Int_t connections, TVirtualProofPlayer *mergerPlayer)
Accept and merge results from a set of workers.
static Int_t GetCmdRtn()
Static method to get the return code from the execution of a command via the pipe.
Definition: TProofServ.cxx:345
static FILE * SetErrorHandlerFile(FILE *ferr)
Set the file stream where to log (default stderr).
Definition: TMutex.h:37
static FILE * fgErrorHandlerFile
Definition: TProofServ.h:180
Int_t CatMotd()
Print message of the day (in the file pointed by the env PROOFMOTD or from fConfDir/etc/proof/motd).
Bool_t IsIdle()
Return the idle status.
virtual void HandleRemove(TMessage *mess, TString *slb=0)
Handle remove request.
Int_t fActSessions
Definition: TProofServ.h:133
TList * fChildren
Definition: TProofServ.h:443
void GetOptions(Int_t *argc, char **argv)
Get and handle command line options.
TString fConfFile
Definition: TProofServ.h:89
TStopwatch fCompute
Definition: TProofServ.h:128
void LogToMaster(Bool_t on=kTRUE)
Definition: TProofServ.h:334
long long Long64_t
Definition: RtypesCore.h:69
Int_t fGroupSize
Definition: TProofServ.h:118
Bool_t IsWaiting()
Return kTRUE if the session is waiting for the OK to start processing.
virtual EQueryAction GetWorkers(TList *workers, Int_t &prioritychange, Bool_t resume=kFALSE)
Get list of workers to be used from now on.
static Long_t fgResMemMax
Definition: TProofServ.h:172
Int_t SetupCommon()
Common part (between TProofServ and TXProofServ) of the setup phase.
float Float_t
Definition: RtypesCore.h:53
TProofLockPath * GetCacheLock()
Definition: TProofServ.h:293
const char Option_t
Definition: RtypesCore.h:62
Long64_t fHWMBoxSize
Definition: TProofServ.h:168
const char * GetDataDir() const
Definition: TProofServ.h:262
static void FilterLocalroot(TString &path, const char *url="root://dum/")
If 'path' is local and 'dsrv' is Xrootd, apply 'path.Localroot' settings, if any. ...
TString fSessionTag
Definition: TProofServ.h:92
Definition: TDSet.h:153
TStopwatch fLatency
Definition: TProofServ.h:127
virtual Int_t HandleDataSets(TMessage *mess, TString *slb=0)
Handle here requests about datasets.
#define BIT(n)
Definition: Rtypes.h:120
virtual void MakePlayer()
Make player instance.
virtual void HandleProcess(TMessage *mess, TString *slb=0)
Handle processing request.
TVirtualProofPlayer * fPlayer
Definition: TProofServ.h:110
Bool_t UnlinkDataDir(const char *path)
Scan recursively the datadir and unlink it if empty Return kTRUE if it can be unlinked, kFALSE otherwise.
const char * GetSessionTag() const
Definition: TProofServ.h:257
TString fGroup
Definition: TProofServ.h:87
static Long_t GetVirtMemMax()
VirtMemMax getter.
TDataSetManager * fDataSetManager
Definition: TProofServ.h:156
Int_t WaitingQueries()
Return the number of waiting queries.
Int_t UpdateSessionStatus(Int_t xst=-1)
Update the session status in the relevant file.
TProofLockPath * fLocker
Definition: TProofServ.h:377
Float_t GetCpuTime() const
Definition: TProofServ.h:271
TString ferr
Definition: pq2main.cxx:38
virtual Int_t HandleLibIncPath(TMessage *mess)
Handle lib, inc search paths modification request.
TList * fQueuedMsg
Definition: TProofServ.h:144
Basic string class.
Definition: TString.h:137
TDataSetManagerFile * fDataSetStgRepo
Definition: TProofServ.h:157
void SetQueryRunning(TProofQueryResult *pq)
Set query in running state.
TAlienJobStatus * status
Definition: TAlienJob.cxx:51
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
TReaperTimer * fReaperTimer
Definition: TProofServ.h:151
TString fImage
Definition: TProofServ.h:91
Int_t GetCompressionLevel() const
Definition: TProofServ.h:476
TString fService
Definition: TProofServ.h:85
TString fOutputFile
Definition: TProofServ.h:103
Long64_t fMaxBoxSize
Definition: TProofServ.h:167
TProofServLogHandlerGuard(const char *cmd, TSocket *s, const char *pfx="", Bool_t on=kTRUE)
Init a guard for executing a command in a pipe.
Definition: TProofServ.cxx:353
const char * GetGroup() const
Definition: TProofServ.h:254
const char * GetTopSessionTag() const
Definition: TProofServ.h:258
TMonitor * fMergingMonitor
Definition: TProofServ.h:162
Int_t GetActSessions() const
Definition: TProofServ.h:275
static void ResolveKeywords(TString &fname, const char *path=0)
Replace , , , , , , , and placeholders in fname...
static Float_t GetMemHWM()
MemHWM getter.
TString fPrefix
Definition: TProofServ.h:146
static Int_t fgRecursive
Definition: TProofServ.h:181
static Long_t fgVirtMemMax
Definition: TProofServ.h:171
virtual void HandleCheckFile(TMessage *mess, TString *slb=0)
Handle file checking request.
void SendParallel(Bool_t async=kFALSE)
Send number of parallel nodes to master or client.
Int_t fMaxQueries
Definition: TProofServ.h:166
const char * GetService() const
Definition: TProofServ.h:250
static TString fgPfx
Definition: TProofServ.h:393
virtual void HandleSocketInput()
Handle input coming from the client or from the master server.
virtual void HandleArchive(TMessage *mess, TString *slb=0)
Handle archive request.
TString fArchivePath
Definition: TProofServ.h:107
Int_t fGroupId
Definition: TProofServ.h:117
static void SetLastEntry(Long64_t lastentry)
Set the last entry before exception.
static struct mg_connection * fc(struct mg_context *ctx)
Definition: civetweb.c:839
virtual void HandleTermination()
Definition: TProofServ.h:302
TSocket * fSocket
Definition: TProofServ.h:108
TIdleTOTimer(TProofServ *p, Int_t delay)
Definition: TProofServ.h:460
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void HandleFork(TMessage *mess)
Cloning itself via fork. Not implemented.
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition: THashList.h:36
virtual ~TIdleTOTimerGuard()
Definition: TProofServ.h:472
Float_t GetEffSessions() const
Definition: TProofServ.h:276
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
TIdleTOTimerGuard(TIdleTOTimer *t)
Definition: TProofServ.h:471
virtual void ReleaseWorker(const char *)
Definition: TProofServ.h:317
Int_t GetQuerySeqNum() const
Definition: TProofServ.h:272
TDSetElement * GetNextPacket(Long64_t totalEntries=-1)
Get next range of entries to be processed on this server.
virtual void Start(Long_t milliSec=-1, Bool_t singleShot=kFALSE)
Starts the timer with a milliSec timeout.
Definition: TTimer.cxx:209
Float_t GetRealTime() const
Definition: TProofServ.h:270
Long64_t fLogFileMaxSize
Definition: TProofServ.h:113
virtual void HandleUrgentData()
Handle Out-Of-Band data sent by the master or client.
TFileHandler * fInputHandler
Definition: TProofServ.h:136
TIdleTOTimer * fIdleTOTimer
Definition: TProofServ.h:468
static Int_t RegisterDataSets(TList *in, TList *out, TDataSetManager *dsm, TString &e)
Register TFileCollections in 'out' as datasets according to the rules in 'in'.
TProofQueryResult * NextQuery()
Get the next query from the waiting list.
TString fDataDir
Definition: TProofServ.h:100
void FlushLogFile()
Reposition the read pointer in the log file to the very end.
virtual ~TProofServ()
Cleanup.
Long64_t GetMsgSizeHWM() const
Definition: TProofServ.h:286
Int_t UnloadPackages()
Unloads all enabled packages. Returns -1 in case of error, 0 otherwise.
TProof * fProof
Definition: TProofServ.h:109
static Long_t GetResMemMax()
ResMemMax getter.
TString fConfDir
Definition: TProofServ.h:88
TString flog
Definition: pq2main.cxx:37
virtual Int_t HandleCache(TMessage *mess, TString *slb=0)
Handle here all cache and package requests.
TProofServ * fProofServ
Definition: TProofServ.h:430
virtual void HandleQueryList(TMessage *mess)
Handle request for list of queries.
Bool_t fInterrupt
Definition: TProofServ.h:124
A container class for query results.
Definition: TQueryResult.h:44
TString fOrdinal
Definition: TProofServ.h:116
const char * GetWorkDir() const
Definition: TProofServ.h:255
char * out
Definition: TBase64.cxx:29
virtual Int_t SendAsynMessage(const char *msg, Bool_t lf=kTRUE)
Send an asychronous message to the master / client .
Bool_t ReadNotify()
Notify when something can be read from the descriptor associated with this handler.
Definition: TProofServ.h:405
TString fAdminPath
Definition: TProofServ.h:102
virtual ~TProofServLogHandler()
Handle available message in the open file.
Definition: TProofServ.cxx:287
A doubly linked list.
Definition: TList.h:47
Int_t fGroupPriority
Definition: TProofServ.h:121
virtual ~TReaperTimer()
Destructor.
Definition: TProofServ.cxx:450
Float_t fCpuTime
Definition: TProofServ.h:126
virtual Int_t Fork()
Fork a child.
Bool_t Notify()
Check if any of the registered children has changed its state.
Definition: TProofServ.cxx:478
TShutdownTimer(TProofServ *p, Int_t delay)
Construtor.
Definition: TProofServ.cxx:405
static TProofServ * This()
Static function returning pointer to global object gProofServ.
static Float_t GetMemStop()
MemStop getter.
virtual void DisableTimeout()
Definition: TProofServ.h:328
Int_t GetPriority()
Get the processing priority for the group the user belongs too.
TSocket * GetSocket() const
Definition: TProofServ.h:269
Int_t fProtocol
Definition: TProofServ.h:115
static Int_t fgLogToSysLog
Definition: TProofServ.h:184
Int_t ReceiveFile(const char *file, Bool_t bin, Long64_t size)
Receive a file, either sent by a client or a master server.
const char * GetPrefix() const
Definition: TProofServ.h:288
TProofLockPath * fPackageLock
Definition: TProofServ.h:104
Int_t fCompressMsg
Definition: TProofServ.h:154
TString fSessionDir
Definition: TProofServ.h:94
static void GetLocalServer(TString &dsrv)
Extract LOCALDATASERVER info in 'dsrv'.
TProof * GetProof() const
Definition: TProofServ.h:249
TProofLockPath(const char *path)
Definition: TProofServ.h:366
Bool_t Notify()
Handle expiration of the idle timer. The session will just be terminated.
Definition: TProofServ.cxx:516
TList * fEnabledPackages
Definition: TProofServ.h:114
Int_t QueueQuery(TProofQueryResult *pq)
Add a query to the waiting list Returns the number of queries in the list.
static Float_t fgMemHWM
Definition: TProofServ.h:174
const char * GetConfDir() const
Definition: TProofServ.h:251
TIdleTOTimer * fIdleTOTimer
Definition: TProofServ.h:152
TString fDataDirOpts
Definition: TProofServ.h:101
TProofLockPathGuard(TProofLockPath *l)
Definition: TProofServ.h:380
TLine * l
Definition: textangle.C:4
virtual void HandleSigPipe()
Called when the client is not alive anymore (i.e.
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:57
Bool_t IsEndMaster() const
Definition: TProofServ.h:304
TServerSocket * fMergingSocket
Definition: TProofServ.h:161
Int_t GetProtocol() const
Definition: TProofServ.h:264
static Bool_t IsActive()
Static function that returns kTRUE in case we are a PROOF server.
void Interrupt()
Definition: TProofServ.h:303
const char * GetCacheDir() const
Definition: TProofServ.h:261
TString fUser
Definition: TProofServ.h:86
Bool_t fIdle
Definition: TProofServ.h:141
virtual void ProcessNext(TString *slb=0)
process the next query from the queue of submitted jobs.
TString fDataSetDir
Definition: TProofServ.h:99
TShutdownTimer * fShutdownTimer
Definition: TProofServ.h:150
const char * GetUser() const
Definition: TProofServ.h:253
Int_t SendResults(TSocket *sock, TList *outlist=0, TQueryResult *pq=0)
Sends all objects from the given list to the specified socket.
const char * GetImage() const
Definition: TProofServ.h:256
void AddPid(Int_t pid)
Add an entry for 'pid' in the internal list.
Definition: TProofServ.cxx:462
virtual void HandleSubmerger(TMessage *mess)
Handle a message of type kPROOF_SUBMERGER.
virtual void HandleRetrieve(TMessage *mess, TString *slb=0)
Handle retrieve request.
TMutex * fQMtx
Definition: TProofServ.h:142
virtual Int_t HandleWorkerLists(TMessage *mess)
Handle here all requests to modify worker lists.
long Long_t
Definition: RtypesCore.h:50
TObject * Get(const char *namecycle)
Get object with name "name;cycle" (e.g.
Int_t OldAuthSetup(TString &wconf)
Setup authentication related stuff for old versions.
const char * GetConfFile() const
Definition: TProofServ.h:252
Bool_t Notify()
Handle available message in the open file.
Definition: TProofServ.cxx:304
virtual void SendLogFile(Int_t status=0, Int_t start=-1, Int_t end=-1)
Send log file to master.
double f(double x)
static Int_t fgCmdRtn
Definition: TProofServ.h:394
TString fTopSessionTag
Definition: TProofServ.h:93
void Reset(const char *dir)
Reset PROOF environment to be ready for execution of next command.
static Float_t fgMemStop
Definition: TProofServ.h:175
Int_t(* OldProofServAuthSetup_t)(TSocket *, Bool_t, Int_t, TString &, TString &, TString &)
Definition: TProofServ.h:71
Int_t Lock()
Locks the directory.
Bool_t IsMaster() const
Definition: TProofServ.h:305
void Run(Bool_t retrn=kFALSE)
Main server eventloop.
EStatusBits
Definition: TObject.h:76
Int_t fLogLevel
Definition: TProofServ.h:119
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:44
Int_t fMergedWorkers
Definition: TProofServ.h:163
const char * GetOrdinal() const
Definition: TProofServ.h:265
Definition: TProof.h:339
int nentries
Definition: THbookFile.cxx:89
Int_t GetGroupSize() const
Definition: TProofServ.h:267
Float_t fRealTime
Definition: TProofServ.h:125
TList * GetEnabledPackages() const
Definition: TProofServ.h:279
TStopwatch fSaveOutput
Definition: TProofServ.h:129
Int_t Unlock()
Unlock the directory.
void SetIdle(Bool_t st=kTRUE)
Change the idle status.
Bool_t Notify()
Handle expiration of the shutdown timer.
Definition: TProofServ.cxx:417
Bool_t fEndMaster
Definition: TProofServ.h:122
static TMap * GetDataSetNodeMap(TFileCollection *fc, TString &emsg)
Get a map {server-name, list-of-files} for collection 'fc' to be used in TPacketizerFile.
void Print(Option_t *option="") const
Print status of slave server.
static TString fgSysLogEntity
Definition: TProofServ.h:186
Bool_t IsLocked() const
Definition: TProofServ.h:372
Mother of all ROOT objects.
Definition: TObject.h:58
const char * GetPackageDir() const
Definition: TProofServ.h:260
THashList * fGlobalPackageDirList
Definition: TProofServ.h:96
void TruncateLogFile()
Truncate the log file to the 80% of the required max size if this is set.
#define R__EXTERN
Definition: DllImport.h:27
Int_t GetLogLevel() const
Definition: TProofServ.h:268
Int_t GetGroupId() const
Definition: TProofServ.h:266
R__EXTERN TProofServ * gProofServ
Definition: TProofServ.h:359
virtual Int_t CreateServer()
Finalize the server setup.
Definition: TProofServ.cxx:796
Int_t UnloadPackage(const char *package)
Removes link to package in working directory, removes entry from include path, removes entry from ena...
Int_t GetSessionStatus()
Return the status of this session: 0 idle 1 running 2 being terminated (currently unused) 3 queued 4 ...
Class that contains a list of TFileInfo's and accumulated meta data information about its entries...
TProofQueryResult * MakeQueryResult(Long64_t nentries, const char *opt, TList *inl, Long64_t first, TDSet *dset, const char *selec, TObject *elist)
Create a TProofQueryResult instance for this query.
static TString fgLastMsg
Definition: TProofServ.h:240
virtual Int_t Setup()
Print the ProofServ logo on standard output.
TProofServLogHandler(const char *cmd, TSocket *s, const char *pfx="")
Execute 'cmd' in a pipe and handle output messages from the related file.
Definition: TProofServ.cxx:241
TString fWorkDir
Definition: TProofServ.h:90
Bool_t IsTopMaster() const
Definition: TProofServ.h:307
TProofServ * fProofServ
Definition: TProofServ.h:457
virtual void DeletePlayer()
Delete player instance.
Int_t GetTotSessions() const
Definition: TProofServ.h:274
void RedirectOutput(const char *dir=0, const char *mode="w")
Redirect stdout to a log file.
virtual void Stop()
Definition: TTimer.h:99
static void SetLastMsg(const char *lastmsg)
Set the message to be sent back in case of exceptions.
static void SetDefaultPrefix(const char *pfx)
Static method to set the default prefix.
Definition: TProofServ.cxx:337
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
Definition: TApplication.h:45
TReaperTimer(Long_t frequency=1000)
Definition: TProofServ.h:446
void RestartComputeTime()
Reset the compute time.
Long64_t fMsgSizeHWM
Definition: TProofServ.h:178
TString fPackageDir
Definition: TProofServ.h:95
virtual void Terminate(Int_t status)
Terminate the proof server.
TList * fWaitingQueries
Definition: TProofServ.h:140
TString fCacheDir
Definition: TProofServ.h:97
TString fQueryDir
Definition: TProofServ.h:98
Int_t fTotSessions
Definition: TProofServ.h:132
virtual ~TProofServLogHandlerGuard()
Close a guard for executing a command in a pipe.
Definition: TProofServ.cxx:393
Bool_t IsParallel() const
True if in parallel mode.
void SendStatistics()
Send statistics of slave server to master or client.
static void ErrorHandler(Int_t level, Bool_t abort, const char *location, const char *msg)
The PROOF error handler function.
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void EnableTimeout()
Definition: TProofServ.h:329
Int_t CleanupWaitingQueries(Bool_t del=kTRUE, TList *qls=0)
Cleanup the waiting queries list.
Int_t fQuerySeqNum
Definition: TProofServ.h:130
static TString fgSysLogService
Definition: TProofServ.h:185
Int_t fLogFileDes
Definition: TProofServ.h:112
TProofServ(Int_t *argc, char **argv, FILE *flog=0)
Main constructor.
Definition: TProofServ.cxx:561
TProofServLogHandler * fExecHandler
Definition: TProofServ.h:416
TProofLockPath * fCacheLock
Definition: TProofServ.h:105
TQueryResultManager * fQMgr
Definition: TProofServ.h:138
Bool_t fSendLogToMaster
Definition: TProofServ.h:159
TProofLockPath * fQueryLock
Definition: TProofServ.h:106
static Long64_t fgLastEntry
Definition: TProofServ.h:241
const char * GetDataDirOpts() const
Definition: TProofServ.h:263
Stopwatch class.
Definition: TStopwatch.h:30