ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 #include <mutex>
47 
48 class TDataSetManager;
50 class TDSet;
51 class TDSetElement;
52 class TFileCollection;
53 class TFileHandler;
54 class THashList;
55 class TIdleTOTimer;
56 class TList;
57 class TMap;
58 class TMessage;
59 class TMonitor;
60 class TProof;
61 class TProofLockPath;
63 class TReaperTimer;
64 class TServerSocket;
65 class TShutdownTimer;
66 class TSocket;
68 
69 // Hook to external function setting up authentication related stuff
70 // for old versions.
71 // For backward compatibility
73  TString &, TString &, TString &);
74 
75 
76 class TProofServ : public TApplication {
77 
78 friend class TProofServLite;
79 friend class TXProofServ;
80 
81 public:
82  enum EStatusBits { kHighMemory = BIT(16) };
84 
85 private:
86  TString fService; //service we are running, either "proofserv" or "proofslave"
87  TString fUser; //user as which we run
88  TString fGroup; //group the user belongs to
89  TString fConfDir; //directory containing cluster config information
90  TString fConfFile; //file containing config information
91  TString fWorkDir; //directory containing all proof related info
92  TString fImage; //image name of the session
93  TString fSessionTag; //tag for the server session
94  TString fTopSessionTag; //tag for the global session
95  TString fSessionDir; //directory containing session dependent files
96  TString fPackageDir; //directory containing packages and user libs
97  THashList *fGlobalPackageDirList; //list of directories containing global packages libs
98  TString fCacheDir; //directory containing cache of user files
99  TString fQueryDir; //directory containing query results and status
100  TString fDataSetDir; //directory containing info about known data sets
101  TString fDataDir; //directory containing data files produced during queries
102  TString fDataDirOpts; //Url type options for fDataDir
103  TString fAdminPath; //admin path for this session
104  TString fOutputFile; //path with the temporary results of the current or last query
105  TProofLockPath *fPackageLock; //package dir locker
106  TProofLockPath *fCacheLock; //cache dir locker
107  TProofLockPath *fQueryLock; //query dir locker
108  TString fArchivePath; //default archive path
109  TSocket *fSocket; //socket connection to client
110  TProof *fProof; //PROOF talking to slave servers
111  TVirtualProofPlayer *fPlayer; //actual player
112  FILE *fLogFile; //log file
113  Int_t fLogFileDes; //log file descriptor
114  Long64_t fLogFileMaxSize; //max size for log files (enabled if > 0)
115  TList *fEnabledPackages; //list of enabled packages
116  Int_t fProtocol; //protocol version number
117  TString fOrdinal; //slave ordinal number
118  Int_t fGroupId; //slave unique id in the active slave group
119  Int_t fGroupSize; //size of the active slave group
120  Int_t fLogLevel; //debug logging level
121  Int_t fNcmd; //command history number
122  Int_t fGroupPriority; //priority of group the user belongs to (0 - 100)
123  Bool_t fEndMaster; //true for a master in direct contact only with workers
124  Bool_t fMasterServ; //true if we are a master server
125  Bool_t fInterrupt; //if true macro execution will be stopped
126  Float_t fRealTime; //real time spent executing commands
127  Float_t fCpuTime; //CPU time spent executing commands
128  TStopwatch fLatency; //measures latency of packet requests
129  TStopwatch fCompute; //measures time spent processing a packet
130  TStopwatch fSaveOutput; //measures time spent saving the partial result
131  Int_t fQuerySeqNum; //sequential number of the current or last query
132 
133  Int_t fTotSessions; //Total number of PROOF sessions on the cluster
134  Int_t fActSessions; //Total number of active PROOF sessions on the cluster
135  Float_t fEffSessions; //Effective Number of PROOF sessions on the assigned machines
136 
137  TFileHandler *fInputHandler; //Input socket handler
138 
139  TQueryResultManager *fQMgr; //Query-result manager
140 
141  TList *fWaitingQueries; //list of TProofQueryResult waiting to be processed
142  Bool_t fIdle; //TRUE if idle
143  std::recursive_mutex fQMtx; // To protect async msg queue
144 
145  TList *fQueuedMsg; //list of messages waiting to be processed
146 
147  TString fPrefix; //Prefix identifying the node
148 
149  Bool_t fRealTimeLog; //TRUE if log messages should be send back in real-time
150 
151  TShutdownTimer *fShutdownTimer; // Timer used to shutdown out-of-control sessions
152  TReaperTimer *fReaperTimer; // Timer used to control children state
153  TIdleTOTimer *fIdleTOTimer; // Timer used to control children state
154 
155  Int_t fCompressMsg; // Compression level for messages
156 
157  TDataSetManager* fDataSetManager; // dataset manager
158  TDataSetManagerFile *fDataSetStgRepo; // repository for staging requests
159 
160  Bool_t fSendLogToMaster; // On workers, controls logs sending to master
161 
162  TServerSocket *fMergingSocket; // Socket used for merging outputs if submerger
163  TMonitor *fMergingMonitor; // Monitor for merging sockets
164  Int_t fMergedWorkers; // Number of workers merged
165 
166  // Quotas (-1 to disable)
167  Int_t fMaxQueries; //Max number of queries fully kept
168  Long64_t fMaxBoxSize; //Max size of the sandbox
169  Long64_t fHWMBoxSize; //High-Water-Mark on the sandbox size
170 
171  // Memory limits (-1 to disable) set by envs ROOTPROFOASHARD, PROOF_VIRTMEMMAX, PROOF_RESMEMMAX
172  static Long_t fgVirtMemMax; //Hard limit enforced by the system (in kB)
173  static Long_t fgResMemMax; //Hard limit on the resident memory checked
174  //in TProofPlayer::Process (in kB)
175  static Float_t fgMemHWM; // Threshold fraction of max for warning and finer monitoring
176  static Float_t fgMemStop; // Fraction of max for stop processing
177 
178  // In bytes; default is 1MB
179  Long64_t fMsgSizeHWM; //High-Water-Mark on the size of messages with results
180 
181  static FILE *fgErrorHandlerFile; // File where to log
182  static Int_t fgRecursive; // Keep track of recursive inputs during processing
183 
184  // Control sending information to syslog
185  static Int_t fgLogToSysLog; // >0 sent to syslog too
186  static TString fgSysLogService; // name of the syslog service (eg: proofm-0, proofw-0.67)
187  static TString fgSysLogEntity; // logging entity (<user>:<group>)
188 
189  Int_t GetCompressionLevel() const;
190 
191  void RedirectOutput(const char *dir = 0, const char *mode = "w");
192  Int_t CatMotd();
193  Int_t UnloadPackage(const char *package);
195  Int_t OldAuthSetup(TString &wconf);
196  Int_t GetPriority();
197 
198  // Query handlers
200  TList *inl, Long64_t first, TDSet *dset,
201  const char *selec, TObject *elist);
203 
204  // Results handling
205  Int_t SendResults(TSocket *sock, TList *outlist = 0, TQueryResult *pq = 0);
206  Bool_t AcceptResults(Int_t connections, TVirtualProofPlayer *mergerPlayer);
207 
208  // Waiting queries handlers
209  void SetIdle(Bool_t st = kTRUE);
210  Bool_t IsWaiting();
214  Int_t CleanupWaitingQueries(Bool_t del = kTRUE, TList *qls = 0);
215 
216 protected:
217  virtual void HandleArchive(TMessage *mess, TString *slb = 0);
218  virtual Int_t HandleCache(TMessage *mess, TString *slb = 0);
219  virtual void HandleCheckFile(TMessage *mess, TString *slb = 0);
220  virtual Int_t HandleDataSets(TMessage *mess, TString *slb = 0);
221  virtual void HandleSubmerger(TMessage *mess);
222  virtual void HandleFork(TMessage *mess);
223  virtual Int_t HandleLibIncPath(TMessage *mess);
224  virtual void HandleProcess(TMessage *mess, TString *slb = 0);
225  virtual void HandleQueryList(TMessage *mess);
226  virtual void HandleRemove(TMessage *mess, TString *slb = 0);
227  virtual void HandleRetrieve(TMessage *mess, TString *slb = 0);
228  virtual Int_t HandleWorkerLists(TMessage *mess);
229 
230  virtual void ProcessNext(TString *slb = 0);
231  virtual Int_t Setup();
232  Int_t SetupCommon();
233  virtual void MakePlayer();
234  virtual void DeletePlayer();
235 
236  virtual Int_t Fork();
238  Bool_t IsIdle();
239  Bool_t UnlinkDataDir(const char *path);
240 
241  static TString fgLastMsg; // Message about status before exception
242  static Long64_t fgLastEntry; // Last entry before exception
243 
244 public:
245  TProofServ(Int_t *argc, char **argv, FILE *flog = 0);
246  virtual ~TProofServ();
247 
248  virtual Int_t CreateServer();
249 
250  TProof *GetProof() const { return fProof; }
251  const char *GetService() const { return fService; }
252  const char *GetConfDir() const { return fConfDir; }
253  const char *GetConfFile() const { return fConfFile; }
254  const char *GetUser() const { return fUser; }
255  const char *GetGroup() const { return fGroup; }
256  const char *GetWorkDir() const { return fWorkDir; }
257  const char *GetImage() const { return fImage; }
258  const char *GetSessionTag() const { return fSessionTag; }
259  const char *GetTopSessionTag() const { return fTopSessionTag; }
260  const char *GetSessionDir() const { return fSessionDir; }
261  const char *GetPackageDir() const { return fPackageDir; }
262  const char *GetCacheDir() const { return fCacheDir; }
263  const char *GetDataDir() const { return fDataDir; }
264  const char *GetDataDirOpts() const { return fDataDirOpts; }
265  Int_t GetProtocol() const { return fProtocol; }
266  const char *GetOrdinal() const { return fOrdinal; }
267  Int_t GetGroupId() const { return fGroupId; }
268  Int_t GetGroupSize() const { return fGroupSize; }
269  Int_t GetLogLevel() const { return fLogLevel; }
270  TSocket *GetSocket() const { return fSocket; }
271  Float_t GetRealTime() const { return fRealTime; }
272  Float_t GetCpuTime() const { return fCpuTime; }
273  Int_t GetQuerySeqNum() const { return fQuerySeqNum; }
274 
275  Int_t GetTotSessions() const { return fTotSessions; }
276  Int_t GetActSessions() const { return fActSessions; }
277  Float_t GetEffSessions() const { return fEffSessions; }
278 
279  void GetOptions(Int_t *argc, char **argv);
281 
282  static Long_t GetVirtMemMax();
283  static Long_t GetResMemMax();
284  static Float_t GetMemHWM();
285  static Float_t GetMemStop();
286 
287  Long64_t GetMsgSizeHWM() const { return fMsgSizeHWM; }
288 
289  const char *GetPrefix() const { return fPrefix; }
290 
291  void FlushLogFile();
292  void TruncateLogFile(); // Called also by TDSetProxy::Next()
293 
294  TProofLockPath *GetCacheLock() { return fCacheLock; } //cache dir locker; used by TProofPlayer
295 
296  virtual EQueryAction GetWorkers(TList *workers, Int_t &prioritychange,
297  Bool_t resume = kFALSE);
298  virtual void HandleException(Int_t sig);
299  virtual Int_t HandleSocketInput(TMessage *mess, Bool_t all);
300  virtual void HandleSocketInput();
301  virtual void HandleUrgentData();
302  virtual void HandleSigPipe();
303  virtual void HandleTermination() { Terminate(0); }
304  void Interrupt() { fInterrupt = kTRUE; }
305  Bool_t IsEndMaster() const { return fEndMaster; }
306  Bool_t IsMaster() const { return fMasterServ; }
307  Bool_t IsParallel() const;
308  Bool_t IsTopMaster() const { return fOrdinal == "0"; }
309 
310  void Run(Bool_t retrn = kFALSE);
311 
312  void Print(Option_t *option="") const;
313 
314  void RestartComputeTime();
315 
316  TObject *Get(const char *namecycle);
317  TDSetElement *GetNextPacket(Long64_t totalEntries = -1);
318  virtual void ReleaseWorker(const char *) { }
319  void Reset(const char *dir);
320  Int_t ReceiveFile(const char *file, Bool_t bin, Long64_t size);
321  virtual Int_t SendAsynMessage(const char *msg, Bool_t lf = kTRUE);
322  virtual void SendLogFile(Int_t status = 0, Int_t start = -1, Int_t end = -1);
323  void SendStatistics();
324  void SendParallel(Bool_t async = kFALSE);
325 
326  Int_t UpdateSessionStatus(Int_t xst = -1);
327 
328  // Disable / Enable read timeout
329  virtual void DisableTimeout() { }
330  virtual void EnableTimeout() { }
331 
332  virtual void Terminate(Int_t status);
333 
334  // Log control
336 
337  static FILE *SetErrorHandlerFile(FILE *ferr);
338  static void ErrorHandler(Int_t level, Bool_t abort, const char *location,
339  const char *msg);
340 
341  static void ResolveKeywords(TString &fname, const char *path = 0);
342 
343  static void SetLastMsg(const char *lastmsg);
344  static void SetLastEntry(Long64_t lastentry);
345 
346  // To handle local data server related paths
347  static void FilterLocalroot(TString &path, const char *url = "root://dum/");
348  static void GetLocalServer(TString &dsrv);
349 
350  // To prepara ethe map of files to process
352  static Int_t RegisterDataSets(TList *in, TList *out, TDataSetManager *dsm, TString &e);
353 
354  static Bool_t IsActive();
355  static TProofServ *This();
356 
357  ClassDef(TProofServ,0) //PROOF Server Application Interface
358 };
359 
361 
362 class TProofLockPath : public TNamed {
363 private:
364  Int_t fLockId; //file id of dir lock
365 
366 public:
367  TProofLockPath(const char *path) : TNamed(path,path), fLockId(-1) { }
369 
370  Int_t Lock();
371  Int_t Unlock();
372 
373  Bool_t IsLocked() const { return (fLockId > -1); }
374 };
375 
377 private:
378  TProofLockPath *fLocker; //locker instance
379 
380 public:
383 };
384 
385 //----- Handles output from commands executed externally via a pipe. ---------//
386 //----- The output is redirected one level up (i.e., to master or client). ---//
387 //______________________________________________________________________________
389 private:
390  TSocket *fSocket; // Socket where to redirect the message
391  FILE *fFile; // File connected with the open pipe
392  TString fPfx; // Prefix to be prepended to messages
393 
394  static TString fgPfx; // Default prefix to be prepended to messages
395  static Int_t fgCmdRtn; // Return code of the command execution (available only
396  // after closing the pipe)
397 public:
398  enum EStatusBits { kFileIsPipe = BIT(23) };
399  TProofServLogHandler(const char *cmd, TSocket *s, const char *pfx = "");
400  TProofServLogHandler(FILE *f, TSocket *s, const char *pfx = "");
401  virtual ~TProofServLogHandler();
402 
403  Bool_t IsValid() { return ((fFile && fSocket) ? kTRUE : kFALSE); }
404 
405  Bool_t Notify();
406  Bool_t ReadNotify() { return Notify(); }
407 
408  static void SetDefaultPrefix(const char *pfx);
409  static Int_t GetCmdRtn();
410 };
411 
412 //--- Guard class: close pipe, deactivatethe related descriptor --------------//
413 //______________________________________________________________________________
415 
416 private:
418 
419 public:
420  TProofServLogHandlerGuard(const char *cmd, TSocket *s,
421  const char *pfx = "", Bool_t on = kTRUE);
423  const char *pfx = "", Bool_t on = kTRUE);
424  virtual ~TProofServLogHandlerGuard();
425 };
426 
427 //--- Special timer to control delayed shutdowns
428 //______________________________________________________________________________
429 class TShutdownTimer : public TTimer {
430 private:
433 
434 public:
435  TShutdownTimer(TProofServ *p, Int_t delay);
436 
437  Bool_t Notify();
438 };
439 
440 //--- Synchronous timer used to reap children processes change of state
441 //______________________________________________________________________________
442 class TReaperTimer : public TTimer {
443 private:
444  TList *fChildren; // List of children (forked) processes
445 
446 public:
447  TReaperTimer(Long_t frequency = 1000) : TTimer(frequency, kTRUE), fChildren(0) { }
448  virtual ~TReaperTimer();
449 
450  void AddPid(Int_t pid);
451  Bool_t Notify();
452 };
453 
454 //--- Special timer to terminate idle sessions
455 //______________________________________________________________________________
456 class TIdleTOTimer : public TTimer {
457 private:
459 
460 public:
461  TIdleTOTimer(TProofServ *p, Int_t delay) : TTimer(delay, kTRUE), fProofServ(p) { }
462 
463  Bool_t Notify();
464 };
465 //______________________________________________________________________________
467 
468 private:
470 
471 public:
474 };
475 
476 //______________________________________________________________________________
478 {
479  return (fCompressMsg < 0) ? -1 : fCompressMsg % 100;
480 }
481 
482 #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:260
Bool_t fMasterServ
Definition: TProofServ.h:124
Int_t fNcmd
Definition: TProofServ.h:121
Float_t fEffSessions
Definition: TProofServ.h:135
FILE * fLogFile
Definition: TProofServ.h:112
Bool_t fRealTimeLog
Definition: TProofServ.h:149
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:343
static FILE * SetErrorHandlerFile(FILE *ferr)
Set the file stream where to log (default stderr).
static FILE * fgErrorHandlerFile
Definition: TProofServ.h:181
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:134
TList * fChildren
Definition: TProofServ.h:444
void GetOptions(Int_t *argc, char **argv)
Get and handle command line options.
TString fConfFile
Definition: TProofServ.h:90
Version of the PROOF worker server for local running.
TStopwatch fCompute
Definition: TProofServ.h:129
void LogToMaster(Bool_t on=kTRUE)
Definition: TProofServ.h:335
long long Long64_t
Definition: RtypesCore.h:69
Int_t fGroupSize
Definition: TProofServ.h:119
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:173
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:294
const char Option_t
Definition: RtypesCore.h:62
Long64_t fHWMBoxSize
Definition: TProofServ.h:169
const char * GetDataDir() const
Definition: TProofServ.h:263
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:93
This class implements a data set to be used for PROOF processing.
Definition: TDSet.h:153
TStopwatch fLatency
Definition: TProofServ.h:128
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:111
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:258
TString fGroup
Definition: TProofServ.h:88
static Long_t GetVirtMemMax()
VirtMemMax getter.
TDataSetManager * fDataSetManager
Definition: TProofServ.h:157
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:378
Float_t GetCpuTime() const
Definition: TProofServ.h:272
TString ferr
Definition: pq2main.cxx:38
virtual Int_t HandleLibIncPath(TMessage *mess)
Handle lib, inc search paths modification request.
TList * fQueuedMsg
Definition: TProofServ.h:145
Basic string class.
Definition: TString.h:137
TDataSetManagerFile * fDataSetStgRepo
Definition: TProofServ.h:158
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:152
TString fImage
Definition: TProofServ.h:92
Int_t GetCompressionLevel() const
Definition: TProofServ.h:477
TString fService
Definition: TProofServ.h:86
TString fOutputFile
Definition: TProofServ.h:104
Long64_t fMaxBoxSize
Definition: TProofServ.h:168
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:351
const char * GetGroup() const
Definition: TProofServ.h:255
const char * GetTopSessionTag() const
Definition: TProofServ.h:259
TMonitor * fMergingMonitor
Definition: TProofServ.h:163
Int_t GetActSessions() const
Definition: TProofServ.h:276
static void ResolveKeywords(TString &fname, const char *path=0)
Replace <ord>, <user>, <u>, <group>, <stag>, <qnum>, <file>, <rver> and <build> placeholders in fname...
static Float_t GetMemHWM()
MemHWM getter.
TString fPrefix
Definition: TProofServ.h:147
static Int_t fgRecursive
Definition: TProofServ.h:182
TFile * f
static Long_t fgVirtMemMax
Definition: TProofServ.h:172
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:167
const char * GetService() const
Definition: TProofServ.h:251
static TString fgPfx
Definition: TProofServ.h:394
virtual void HandleSocketInput()
Handle input coming from the client or from the master server.
std::recursive_mutex fQMtx
Definition: TProofServ.h:143
virtual void HandleArchive(TMessage *mess, TString *slb=0)
Handle archive request.
TString fArchivePath
Definition: TProofServ.h:108
Manages an element of a TDSet.
Definition: TDSet.h:68
Int_t fGroupId
Definition: TProofServ.h:118
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:303
TSocket * fSocket
Definition: TProofServ.h:109
TIdleTOTimer(TProofServ *p, Int_t delay)
Definition: TProofServ.h:461
#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:473
Float_t GetEffSessions() const
Definition: TProofServ.h:277
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
TIdleTOTimerGuard(TIdleTOTimer *t)
Definition: TProofServ.h:472
virtual void ReleaseWorker(const char *)
Definition: TProofServ.h:318
Int_t GetQuerySeqNum() const
Definition: TProofServ.h:273
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:271
Long64_t fLogFileMaxSize
Definition: TProofServ.h:114
virtual void HandleUrgentData()
Handle Out-Of-Band data sent by the master or client.
TFileHandler * fInputHandler
Definition: TProofServ.h:137
TIdleTOTimer * fIdleTOTimer
Definition: TProofServ.h:469
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:101
void FlushLogFile()
Reposition the read pointer in the log file to the very end.
virtual ~TProofServ()
Cleanup.
Long64_t GetMsgSizeHWM() const
Definition: TProofServ.h:287
Int_t UnloadPackages()
Unloads all enabled packages. Returns -1 in case of error, 0 otherwise.
TProof * fProof
Definition: TProofServ.h:110
static Long_t GetResMemMax()
ResMemMax getter.
TString fConfDir
Definition: TProofServ.h:89
TString flog
Definition: pq2main.cxx:37
virtual Int_t HandleCache(TMessage *mess, TString *slb=0)
Handle here all cache and package requests.
Int_t(* OldProofServAuthSetup_t)(TSocket *, Bool_t, Int_t, TString &, TString &, TString &)
Definition: TProofServ.h:72
TProofServ * fProofServ
Definition: TProofServ.h:431
virtual void HandleQueryList(TMessage *mess)
Handle request for list of queries.
Bool_t fInterrupt
Definition: TProofServ.h:125
A container class for query results.
Definition: TQueryResult.h:44
TString fOrdinal
Definition: TProofServ.h:117
const char * GetWorkDir() const
Definition: TProofServ.h:256
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:406
TString fAdminPath
Definition: TProofServ.h:103
virtual ~TProofServLogHandler()
Handle available message in the open file.
Definition: TProofServ.cxx:285
A doubly linked list.
Definition: TList.h:47
Int_t fGroupPriority
Definition: TProofServ.h:122
virtual ~TReaperTimer()
Destructor.
Definition: TProofServ.cxx:448
This class implements the XProofD version of TProofServ, with respect to which it differs only for th...
Definition: TXProofServ.h:34
Float_t fCpuTime
Definition: TProofServ.h:127
virtual Int_t Fork()
Fork a child.
Bool_t Notify()
Check if any of the registered children has changed its state.
Definition: TProofServ.cxx:476
TShutdownTimer(TProofServ *p, Int_t delay)
Construtor.
Definition: TProofServ.cxx:403
static TProofServ * This()
Static function returning pointer to global object gProofServ.
static Float_t GetMemStop()
MemStop getter.
virtual void DisableTimeout()
Definition: TProofServ.h:329
Int_t GetPriority()
Get the processing priority for the group the user belongs too.
TSocket * GetSocket() const
Definition: TProofServ.h:270
Int_t fProtocol
Definition: TProofServ.h:116
TThread * t[5]
Definition: threadsh1.C:13
static Int_t fgLogToSysLog
Definition: TProofServ.h:185
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:289
Class managing the query-result area.
Class providing the PROOF server.
Definition: TProofServ.h:76
TProofLockPath * fPackageLock
Definition: TProofServ.h:105
Int_t fCompressMsg
Definition: TProofServ.h:155
TString fSessionDir
Definition: TProofServ.h:95
static void GetLocalServer(TString &dsrv)
Extract LOCALDATASERVER info in 'dsrv'.
TProof * GetProof() const
Definition: TProofServ.h:250
TProofLockPath(const char *path)
Definition: TProofServ.h:367
Bool_t Notify()
Handle expiration of the idle timer. The session will just be terminated.
Definition: TProofServ.cxx:514
TList * fEnabledPackages
Definition: TProofServ.h:115
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:175
const char * GetConfDir() const
Definition: TProofServ.h:252
TIdleTOTimer * fIdleTOTimer
Definition: TProofServ.h:153
bool first
Definition: line3Dfit.C:48
TString fDataDirOpts
Definition: TProofServ.h:102
TProofLockPathGuard(TProofLockPath *l)
Definition: TProofServ.h:381
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:305
TServerSocket * fMergingSocket
Definition: TProofServ.h:162
Int_t GetProtocol() const
Definition: TProofServ.h:265
static Bool_t IsActive()
Static function that returns kTRUE in case we are a PROOF server.
void Interrupt()
Definition: TProofServ.h:304
const char * GetCacheDir() const
Definition: TProofServ.h:262
TString fUser
Definition: TProofServ.h:87
Bool_t fIdle
Definition: TProofServ.h:142
virtual void ProcessNext(TString *slb=0)
process the next query from the queue of submitted jobs.
TString fDataSetDir
Definition: TProofServ.h:100
TShutdownTimer * fShutdownTimer
Definition: TProofServ.h:151
const char * GetUser() const
Definition: TProofServ.h:254
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:257
void AddPid(Int_t pid)
Add an entry for 'pid' in the internal list.
Definition: TProofServ.cxx:460
virtual void HandleSubmerger(TMessage *mess)
Handle a message of type kPROOF_SUBMERGER.
virtual void HandleRetrieve(TMessage *mess, TString *slb=0)
Handle retrieve request.
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:253
Bool_t Notify()
Handle available message in the open file.
Definition: TProofServ.cxx:302
virtual void SendLogFile(Int_t status=0, Int_t start=-1, Int_t end=-1)
Send log file to master.
static Int_t fgCmdRtn
Definition: TProofServ.h:395
TString fTopSessionTag
Definition: TProofServ.h:94
tuple file
Definition: fildir.py:20
void Reset(const char *dir)
Reset PROOF environment to be ready for execution of next command.
static Float_t fgMemStop
Definition: TProofServ.h:176
Int_t Lock()
Locks the directory.
Bool_t IsMaster() const
Definition: TProofServ.h:306
void Run(Bool_t retrn=kFALSE)
Main server eventloop.
EStatusBits
Definition: TObject.h:76
Int_t fLogLevel
Definition: TProofServ.h:120
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:164
void dir(char *path=0)
Definition: rootalias.C:30
const char * GetOrdinal() const
Definition: TProofServ.h:266
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition: TProof.h:342
int nentries
Definition: THbookFile.cxx:89
Int_t GetGroupSize() const
Definition: TProofServ.h:268
Float_t fRealTime
Definition: TProofServ.h:126
TList * GetEnabledPackages() const
Definition: TProofServ.h:280
TStopwatch fSaveOutput
Definition: TProofServ.h:130
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:415
Bool_t fEndMaster
Definition: TProofServ.h:123
TQueryResult version adapted to PROOF neeeds.
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:187
Bool_t IsLocked() const
Definition: TProofServ.h:373
Mother of all ROOT objects.
Definition: TObject.h:58
const char * GetPackageDir() const
Definition: TProofServ.h:261
THashList * fGlobalPackageDirList
Definition: TProofServ.h:97
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:269
Int_t GetGroupId() const
Definition: TProofServ.h:267
R__EXTERN TProofServ * gProofServ
Definition: TProofServ.h:360
virtual Int_t CreateServer()
Finalize the server setup.
Definition: TProofServ.cxx:793
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:241
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:239
TString fWorkDir
Definition: TProofServ.h:91
Bool_t IsTopMaster() const
Definition: TProofServ.h:308
TProofServ * fProofServ
Definition: TProofServ.h:458
virtual void DeletePlayer()
Delete player instance.
Int_t GetTotSessions() const
Definition: TProofServ.h:275
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:335
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:447
void RestartComputeTime()
Reset the compute time.
Abstract interface for the PROOF player.
Long64_t fMsgSizeHWM
Definition: TProofServ.h:179
TString fPackageDir
Definition: TProofServ.h:96
virtual void Terminate(Int_t status)
Terminate the proof server.
TList * fWaitingQueries
Definition: TProofServ.h:141
TString fCacheDir
Definition: TProofServ.h:98
TString fQueryDir
Definition: TProofServ.h:99
Int_t fTotSessions
Definition: TProofServ.h:133
virtual ~TProofServLogHandlerGuard()
Close a guard for executing a command in a pipe.
Definition: TProofServ.cxx:391
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:330
Int_t CleanupWaitingQueries(Bool_t del=kTRUE, TList *qls=0)
Cleanup the waiting queries list.
Int_t fQuerySeqNum
Definition: TProofServ.h:131
static TString fgSysLogService
Definition: TProofServ.h:186
tuple all
Definition: na49view.py:13
Int_t fLogFileDes
Definition: TProofServ.h:113
TProofServ(Int_t *argc, char **argv, FILE *flog=0)
Main constructor.
Definition: TProofServ.cxx:559
TProofServLogHandler * fExecHandler
Definition: TProofServ.h:417
TProofLockPath * fCacheLock
Definition: TProofServ.h:106
TQueryResultManager * fQMgr
Definition: TProofServ.h:139
Bool_t fSendLogToMaster
Definition: TProofServ.h:160
TProofLockPath * fQueryLock
Definition: TProofServ.h:107
static Long64_t fgLastEntry
Definition: TProofServ.h:242
const char * GetDataDirOpts() const
Definition: TProofServ.h:264
Stopwatch class.
Definition: TStopwatch.h:30