ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TProofServLite.cxx
Go to the documentation of this file.
1 // @(#)root/proofx:$Id$
2 // Author: Gerardo Ganis 12/12/2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, 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 /** \class TProofServLite
13 \ingroup proofkernel
14 
15 Version of the PROOF worker server for local running. The client starts
16 directly the desired number of these workers; the master and daemons are
17 eliminated, optimizing the number of messages exchanged and created / destroyed.
18 
19 */
20 
21 //////////////////////////////////////////////////////////////////////////
22 // //
23 // TProofServLite //
24 // //
25 // TProofServLite is the version of the PROOF worker server for local //
26 // running. The client starts directly the desired number of these //
27 // workers; the master and daemons are eliminated, optimizing the number//
28 // of messages exchanged and created / destroyed. //
29 // //
30 //////////////////////////////////////////////////////////////////////////
31 
32 #include "RConfigure.h"
33 #include "RConfig.h"
34 #include "Riostream.h"
35 
36 #ifdef WIN32
37  #include <io.h>
38  typedef long off_t;
39  #include <snprintf.h>
40 #else
41 #include <netinet/in.h>
42 #endif
43 #include <sys/types.h>
44 #include <cstdlib>
45 
46 #include "TProofServLite.h"
47 #include "TObjString.h"
48 #include "TEnv.h"
49 #include "TError.h"
50 #include "TException.h"
51 #include "THashList.h"
52 #include "TInterpreter.h"
53 #include "TMessage.h"
54 #include "TProofDebug.h"
55 #include "TProof.h"
56 #include "TProofPlayer.h"
57 #include "TProofQueryResult.h"
58 #include "TRegexp.h"
59 #include "TClass.h"
60 #include "TROOT.h"
61 #include "TSystem.h"
62 #include "TPluginManager.h"
63 #include "TSocket.h"
64 #include "TTimeStamp.h"
65 #include "compiledata.h"
66 
67 using namespace std;
68 
69 // debug hook
70 static volatile Int_t gProofServDebug = 1;
71 
72 //----- Interrupt signal handler -----------------------------------------------
73 ////////////////////////////////////////////////////////////////////////////////
74 
75 class TProofServLiteInterruptHandler : public TSignalHandler {
76  TProofServLite *fServ;
77 public:
78  TProofServLiteInterruptHandler(TProofServLite *s)
79  : TSignalHandler(kSigUrgent, kFALSE) { fServ = s; }
80  Bool_t Notify();
81 };
82 
83 ////////////////////////////////////////////////////////////////////////////////
84 /// Handle urgent data
85 
87 {
88  fServ->HandleUrgentData();
89  if (TROOT::Initialized()) {
90  Throw(GetSignal());
91  }
92  return kTRUE;
93 }
94 
95 //----- SigPipe signal handler -------------------------------------------------
96 ////////////////////////////////////////////////////////////////////////////////
97 
98 class TProofServLiteSigPipeHandler : public TSignalHandler {
99  TProofServLite *fServ;
100 public:
101  TProofServLiteSigPipeHandler(TProofServLite *s) : TSignalHandler(kSigPipe, kFALSE)
102  { fServ = s; }
103  Bool_t Notify();
104 };
105 
106 ////////////////////////////////////////////////////////////////////////////////
107 /// Handle sig pipe
108 
110 {
111  fServ->HandleSigPipe();
112  return kTRUE;
113 }
114 
115 //----- Termination signal handler ---------------------------------------------
116 ////////////////////////////////////////////////////////////////////////////////
117 
118 class TProofServLiteTerminationHandler : public TSignalHandler {
119  TProofServLite *fServ;
120 public:
121  TProofServLiteTerminationHandler(TProofServLite *s)
122  : TSignalHandler(kSigTermination, kFALSE) { fServ = s; }
123  Bool_t Notify();
124 };
125 
126 ////////////////////////////////////////////////////////////////////////////////
127 /// Handle termination
128 
130 {
131  Printf("TProofServLiteTerminationHandler::Notify: wake up!");
132 
133  fServ->HandleTermination();
134  return kTRUE;
135 }
136 
137 //----- Seg violation signal handler ---------------------------------------------
138 ////////////////////////////////////////////////////////////////////////////////
139 
140 class TProofServLiteSegViolationHandler : public TSignalHandler {
141  TProofServLite *fServ;
142 public:
143  TProofServLiteSegViolationHandler(TProofServLite *s)
145  Bool_t Notify();
146 };
147 
148 ////////////////////////////////////////////////////////////////////////////////
149 /// Handle seg violation
150 
152 {
153  Printf("**** ");
154  Printf("**** Segmentation violation: terminating ****");
155  Printf("**** ");
156  fServ->HandleTermination();
157  return kTRUE;
158 }
159 
160 //----- Input handler for messages from parent or master -----------------------
161 ////////////////////////////////////////////////////////////////////////////////
162 
163 class TProofServLiteInputHandler : public TFileHandler {
164  TProofServLite *fServ;
165 public:
166  TProofServLiteInputHandler(TProofServLite *s, Int_t fd) : TFileHandler(fd, 1)
167  { fServ = s; }
168  Bool_t Notify();
169  Bool_t ReadNotify() { return Notify(); }
170 };
171 
172 ////////////////////////////////////////////////////////////////////////////////
173 /// Handle input on the socket
174 
176 {
177  fServ->HandleSocketInput();
178 
179  return kTRUE;
180 }
181 
183 
184 // Hook to the constructor. This is needed to avoid using the plugin manager
185 // which may create problems in multi-threaded environments.
186 extern "C" {
187  TApplication *GetTProofServLite(Int_t *argc, char **argv, FILE *flog)
188  { return new TProofServLite(argc, argv, flog); }
189 }
190 
191 ////////////////////////////////////////////////////////////////////////////////
192 /// Main constructor
193 
194 TProofServLite::TProofServLite(Int_t *argc, char **argv, FILE *flog)
195  : TProofServ(argc, argv, flog)
196 {
197  fInterruptHandler = 0;
199 }
200 
201 ////////////////////////////////////////////////////////////////////////////////
202 /// Finalize the server setup. If master, create the TProof instance to talk
203 /// the worker or submaster nodes.
204 /// Return 0 on success, -1 on error
205 
207 {
208  if (gProofDebugLevel > 0)
209  Info("CreateServer", "starting server creation");
210 
211  // Get file descriptor for log file
212  if (fLogFile) {
213  // Use the file already open by pmain
214  if ((fLogFileDes = fileno(fLogFile)) < 0) {
215  Error("CreateServer", "resolving the log file description number");
216  return -1;
217  }
218  }
219 
220  // Get socket to be used to call back our xpd
221  fSockPath = gEnv->GetValue("ProofServ.OpenSock", "");
222  if (fSockPath.Length() <= 0) {
223  Error("CreateServer", "Socket setup by xpd undefined");
224  return -1;
225  }
226  TString entity = gEnv->GetValue("ProofServ.Entity", "");
227  if (entity.Length() > 0)
228  fSockPath.Insert(0,TString::Format("%s/", entity.Data()));
229 
230  // Call back the client
231  fSocket = new TSocket(fSockPath);
232  if (!fSocket || !(fSocket->IsValid())) {
233  Error("CreateServer", "Failed to open connection to the client");
234  return -1;
235  }
236 
237  // Send our ordinal, to allow the client to identify us
238  TMessage msg;
239  msg << fOrdinal;
240  fSocket->Send(msg);
241 
242  // Get socket descriptor
243  Int_t sock = fSocket->GetDescriptor();
244 
245  // Install interrupt and message input handlers
246  fInterruptHandler = new TProofServLiteInterruptHandler(this);
248  gSystem->AddFileHandler(new TProofServLiteInputHandler(this, sock));
249 
250  // Wait (loop) in worker node to allow debugger to connect
251  if (gEnv->GetValue("Proof.GdbHook",0) == 2) {
252  while (gProofServDebug)
253  ;
254  }
255 
256  if (gProofDebugLevel > 0)
257  Info("CreateServer", "Service: %s, ConfDir: %s, IsMaster: %d",
259 
260  if (Setup() == -1) {
261  // Setup failure
262  Terminate(0);
263  SendLogFile();
264  return -1;
265  }
266 
267  if (!fLogFile) {
268  RedirectOutput();
269  // If for some reason we failed setting a redirection file for the logs
270  // we cannot continue
271  if (!fLogFile || (fLogFileDes = fileno(fLogFile)) < 0) {
272  Terminate(0);
273  SendLogFile(-98);
274  return -1;
275  }
276  }
277 
278  // Everybody expects std::iostream to be available, so load it...
279  ProcessLine("#include <iostream>", kTRUE);
280  ProcessLine("#include <string>",kTRUE); // for std::string std::iostream.
281 
282  // Load user functions
283  const char *logon;
284  logon = gEnv->GetValue("Proof.Load", (char *)0);
285  if (logon) {
286  char *mac = gSystem->Which(TROOT::GetMacroPath(), logon, kReadPermission);
287  if (mac)
288  ProcessLine(TString::Format(".L %s", logon), kTRUE);
289  delete [] mac;
290  }
291 
292  // Execute logon macro
293  logon = gEnv->GetValue("Proof.Logon", (char *)0);
294  if (logon && !NoLogOpt()) {
295  char *mac = gSystem->Which(TROOT::GetMacroPath(), logon, kReadPermission);
296  if (mac)
297  ProcessFile(logon);
298  delete [] mac;
299  }
300 
301  // Save current interpreter context
302  gInterpreter->SaveContext();
303  gInterpreter->SaveGlobalsContext();
304 
305  // Avoid spurious messages at first action
306  FlushLogFile();
307 
308  // Done
309  return 0;
310 }
311 
312 ////////////////////////////////////////////////////////////////////////////////
313 /// Cleanup. Not really necessary since after this dtor there is no
314 /// live anyway.
315 
317 {
318  delete fSocket;
319 }
320 
321 ////////////////////////////////////////////////////////////////////////////////
322 /// Called when the client is not alive anymore; terminate the session.
323 
325 {
326  Terminate(0); // will not return from here....
327 }
328 
329 ////////////////////////////////////////////////////////////////////////////////
330 /// Called when the client is not alive anymore; terminate the session.
331 
333 {
334  Terminate(0); // will not return from here....
335 }
336 
337 ////////////////////////////////////////////////////////////////////////////////
338 /// Print the ProofServ logo on standard output.
339 /// Return 0 on success, -1 on error
340 
342 {
343  char str[512];
344 
345  if (IsMaster()) {
346  snprintf(str, 512, "**** Welcome to the PROOF server @ %s ****", gSystem->HostName());
347  } else {
348  snprintf(str, 512, "**** PROOF worker server @ %s started ****", gSystem->HostName());
349  }
350 
351  if (fSocket->Send(str) != 1+static_cast<Int_t>(strlen(str))) {
352  Error("Setup", "failed to send proof server startup message");
353  return -1;
354  }
355 
356  // Get client protocol
357  if ((fProtocol = gEnv->GetValue("ProofServ.ClientVersion", -1)) < 0) {
358  Error("Setup", "remote proof protocol missing");
359  return -1;
360  }
361 
362  // The local user
364  if (pw) {
365  fUser = pw->fUser;
366  delete pw;
367  }
368 
369  // Work dir and ...
370  fWorkDir = gEnv->GetValue("ProofServ.Sandbox", TString::Format("~/%s", kPROOF_WorkDir));
371  Info("Setup", "fWorkDir: %s", fWorkDir.Data());
372 
373  // Get Session tags
374  fTopSessionTag = gEnv->GetValue("ProofServ.SessionTag", "-1");
375  fSessionTag.Form("%s-%s-%ld-%d", fOrdinal.Data(), gSystem->HostName(),
377  if (gProofDebugLevel > 0)
378  Info("Setup", "session tag is %s", fSessionTag.Data());
379  if (fTopSessionTag.IsNull()) fTopSessionTag = fSessionTag;
380 
381  // Send session tag to client
383  m << fSessionTag;
384  fSocket->Send(m);
385 
386  // Get Session dir (sandbox)
387  if ((fSessionDir = gEnv->GetValue("ProofServ.SessionDir", "-1")) == "-1") {
388  Error("Setup", "Session dir missing");
389  return -1;
390  }
391 
392  // Link the session tag to the log file
393  if (gSystem->Getenv("ROOTPROOFLOGFILE")) {
394  TString logfile = gSystem->Getenv("ROOTPROOFLOGFILE");
395  Int_t iord = logfile.Index(TString::Format("-%s", fOrdinal.Data()));
396  if (iord != kNPOS) logfile.Remove(iord);
397  logfile += TString::Format("-%s.log", fSessionTag.Data());
398  gSystem->Symlink(gSystem->Getenv("ROOTPROOFLOGFILE"), logfile);
399  }
400 
401  // Goto to the main PROOF working directory
403  fWorkDir = workdir;
404  delete [] workdir;
405  if (gProofDebugLevel > 0)
406  Info("Setup", "working directory set to %s", fWorkDir.Data());
407 
408  // Common setup
409  if (SetupCommon() != 0) {
410  Error("Setup", "common setup failed");
411  return -1;
412  }
413 
414  // Check every two hours if client is still alive
416 
417  // Install SigPipe handler to handle kKeepAlive failure
418  gSystem->AddSignalHandler(new TProofServLiteSigPipeHandler(this));
419 
420  // Install Termination handler
421  gSystem->AddSignalHandler(new TProofServLiteTerminationHandler(this));
422 
423  // Install seg violation handler
424  gSystem->AddSignalHandler(new TProofServLiteSegViolationHandler(this));
425 
426  // Done
427  return 0;
428 }
429 
430 ////////////////////////////////////////////////////////////////////////////////
431 /// Terminate the proof server.
432 
434 {
435  if (fTerminated)
436  // Avoid doubling the exit operations
437  exit(1);
438  fTerminated = kTRUE;
439 
440  // Notify
441  Info("Terminate", "starting session termination operations ...");
442 
443  // Cleanup session directory
444  if (status == 0) {
445  // make sure we remain in a "connected" directory
446  gSystem->ChangeDirectory("/");
447  // needed in case fSessionDir is on NFS ?!
448  gSystem->MakeDirectory(fSessionDir+"/.delete");
450  }
451 
452  // Cleanup data directory if empty
454  if (UnlinkDataDir(fDataDir))
455  Info("Terminate", "data directory '%s' has been removed", fDataDir.Data());
456  }
457 
458  // Remove input and signal handlers to avoid spurious "signals"
459  // for closing activities executed upon exit()
461 
462  // Stop processing events (set a flag to exit the event loop)
463  gSystem->ExitLoop();
464 
465  // Notify
466  Printf("Terminate: termination operations ended: quitting!");
467 }
468 
469 ////////////////////////////////////////////////////////////////////////////////
470 /// Cloning itself via fork.
471 
473 {
474  if (!mess) {
475  Error("HandleFork", "empty message!");
476  return;
477  }
478 
479  // Extract the ordinals of the clones
480  TString clones;
481  (*mess) >> clones;
482  PDB(kGlobal, 1)
483  Info("HandleFork", "cloning to %s", clones.Data());
484 
485  TString clone;
486  Int_t from = 0;
487  while (clones.Tokenize(clone, from, " ")) {
488 
489  Int_t rc = 0;
490  // Fork
491  if ((rc = Fork()) < 0) {
492  Error("HandleFork", "failed to fork %s", clone.Data());
493  return;
494  }
495 
496  // If the child, finalize the setup and return
497  if (rc == 0) {
498  SetupOnFork(clone.Data());
499  return;
500  }
501  }
502 
503  // Done
504  return;
505 }
506 
507 ////////////////////////////////////////////////////////////////////////////////
508 /// Finalize the server setup afetr forking.
509 /// Return 0 on success, -1 on error
510 
512 {
513  if (gProofDebugLevel > 0)
514  Info("SetupOnFork", "finalizing setup of %s", ord);
515 
516  // Set the ordinal
517  fOrdinal = ord;
518  TString sord;
519  sord.Form("-%s", fOrdinal.Data());
520 
521  // Close the current log file
522  if (fLogFile) {
523  fclose(fLogFile);
524  fLogFileDes = -1;
525  }
526 
528  RedirectOutput(sdir.Data(), "a");
529  // If for some reason we failed setting a redirection file for the logs
530  // we cannot continue
531  if (!fLogFile || (fLogFileDes = fileno(fLogFile)) < 0) {
532  Terminate(0);
533  return -1;
534  }
535  FlushLogFile();
536 
537  // Eliminate existing symlink
538  void *dirp = gSystem->OpenDirectory(sdir);
539  if (dirp) {
540  TString ent;
541  const char *e = 0;
542  while ((e = gSystem->GetDirEntry(dirp))) {
543  ent.Form("%s/%s", sdir.Data(), e);
544  FileStat_t st;
545  if (gSystem->GetPathInfo(ent.Data(), st) == 0) {
546  if (st.fIsLink && ent.Contains(sord)) {
547  PDB(kGlobal, 1)
548  Info("SetupOnFork","unlinking: %s", ent.Data());
549  gSystem->Unlink(ent);
550  }
551  }
552  }
553  gSystem->FreeDirectory(dirp);
554  }
555 
556  // The session tag
557  fSessionTag.Form("%s-%d-%d", gSystem->HostName(), (int)time(0), gSystem->GetPid());
558 
559  // Create new symlink
560  TString logfile = gSystem->Getenv("ROOTPROOFLOGFILE");
561  logfile.ReplaceAll("-0.0", sord.Data());
562  gSystem->Setenv("ROOTPROOFLOGFILE", logfile);
563  Int_t iord = logfile.Index(sord.Data());
564  if (iord != kNPOS) logfile.Remove(iord + sord.Length());
565  logfile += TString::Format("-%s.log", fSessionTag.Data());
566  gSystem->Symlink(gSystem->Getenv("ROOTPROOFLOGFILE"), logfile);
567 
568  // Get socket to be used to call back our xpd
569  fSockPath = gEnv->GetValue("ProofServ.OpenSock", "");
570  if (fSockPath.Length() <= 0) {
571  Error("CreateServer", "Socket setup by xpd undefined");
572  return -1;
573  }
574  TString entity = gEnv->GetValue("ProofServ.Entity", "");
575  if (entity.Length() > 0)
576  fSockPath.Insert(0, TString::Format("%s/", entity.Data()));
577 
578  // Call back the client
579  fSocket = new TSocket(fSockPath);
580  if (!fSocket || !(fSocket->IsValid())) {
581  Error("CreateServer", "Failed to open connection to the client");
582  return -1;
583  }
584 
585  // Send our ordinal, to allow the client to identify us
586  TMessage msg;
587  msg << fOrdinal;
588  fSocket->Send(msg);
589 
590  // Get socket descriptor
591  Int_t sock = fSocket->GetDescriptor();
592 
593  // Install interrupt and message input handlers
594  fInterruptHandler = new TProofServLiteInterruptHandler(this);
596  gSystem->AddFileHandler(new TProofServLiteInputHandler(this, sock));
597 
598  // Wait (loop) in worker node to allow debugger to connect
599  if (gEnv->GetValue("Proof.GdbHook",0) == 2) {
600  while (gProofServDebug)
601  ;
602  }
603 
604  if (gProofDebugLevel > 0)
605  Info("SetupOnFork", "Service: %s, ConfDir: %s, IsMaster: %d",
607 
608  if (Setup() == -1) {
609  // Setup failure
610  Terminate(0);
611  SendLogFile();
612  return -1;
613  }
614 
615  // Disallow the interpretation of Rtypes.h, TError.h and TGenericClassInfo.h
616  ProcessLine("#define ROOT_Rtypes 0", kTRUE);
617  ProcessLine("#define ROOT_TError 0", kTRUE);
618  ProcessLine("#define ROOT_TGenericClassInfo 0", kTRUE);
619 
620  // Save current interpreter context
621  gInterpreter->SaveContext();
622  gInterpreter->SaveGlobalsContext();
623 
624  // Done
625  return 0;
626 }
Bool_t fMasterServ
Definition: TProofServ.h:124
FILE * fLogFile
Definition: TProofServ.h:112
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1213
virtual Long_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=0)
Process a single command line, either a C++ statement or an interpreter command starting with a "...
virtual int GetPid()
Get process id.
Definition: TSystem.cxx:711
Version of the PROOF worker server for local running.
void HandleSigPipe()
Called when the client is not alive anymore; terminate the session.
Int_t SetupCommon()
Common part (between TProofServ and TXProofServ) of the setup phase.
Ssiz_t Length() const
Definition: TString.h:390
virtual Bool_t IsValid() const
Definition: TSocket.h:162
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
Definition: TSocket.cxx:520
virtual Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
Definition: TSocket.cxx:1017
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:635
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
Definition: TSystem.cxx:1311
TString fSessionTag
Definition: TProofServ.h:93
Int_t Setup()
Print the ProofServ logo on standard output.
Bool_t UnlinkDataDir(const char *path)
Scan recursively the datadir and unlink it if empty Return kTRUE if it can be unlinked, kFALSE otherwise.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:892
const char *const kPROOF_WorkDir
Definition: TProof.h:150
virtual int MakeDirectory(const char *name)
Make a directory.
Definition: TSystem.cxx:821
virtual void AddSignalHandler(TSignalHandler *sh)
Add a signal handler to list of system signal handlers.
Definition: TSystem.cxx:536
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition: TSystem.cxx:856
Bool_t Notify()
Definition: TTimer.cxx:65
Basic string class.
Definition: TString.h:137
TAlienJobStatus * status
Definition: TAlienJob.cxx:51
int Int_t
Definition: RtypesCore.h:41
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:980
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
const char *const kRM
Definition: TProof.h:168
#define gInterpreter
Definition: TInterpreter.h:502
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Definition: TSystem.cxx:1459
TString fService
Definition: TProofServ.h:86
TString & Insert(Ssiz_t pos, const char *s)
Definition: TString.h:592
virtual Int_t GetDescriptor() const
Definition: TSocket.h:142
static const char * GetMacroPath()
Get macro search path. Static utility function.
Definition: TROOT.cxx:2446
const char * Data() const
Definition: TString.h:349
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
Definition: TSystem.cxx:847
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
Definition: TSystem.cxx:1294
Int_t CreateServer()
Finalize the server setup.
TSocket * fSocket
Definition: TProofServ.h:109
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Definition: TString.cxx:2321
#define PDB(mask, level)
Definition: TProofDebug.h:58
const char * ord
Definition: TXSlave.cxx:46
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
Definition: TROOT.cxx:2509
static volatile Int_t gProofServDebug
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1575
virtual void ExitLoop()
Exit from event loop.
Definition: TSystem.cxx:396
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Definition: TSystem.cxx:1511
TString fDataDir
Definition: TProofServ.h:101
void FlushLogFile()
Reposition the read pointer in the log file to the very end.
TString fConfDir
Definition: TProofServ.h:89
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
TString flog
Definition: pq2main.cxx:37
TString fOrdinal
Definition: TProofServ.h:117
Int_t SetupOnFork(const char *ord)
Finalize the server setup afetr forking.
virtual Int_t Fork()
Fork a child.
const char Int_t const char TProof Int_t const char * workdir
Definition: TXSlave.cxx:46
Int_t fProtocol
Definition: TProofServ.h:116
time_t GetSec() const
Definition: TTimeStamp.h:140
TString fUser
Definition: TSystem.h:152
TProofServLite(Int_t *argc, char **argv, FILE *flog=0)
Main constructor.
static double C[]
virtual void Setenv(const char *name, const char *value)
Set environment variable.
Definition: TSystem.cxx:1559
Bool_t fIsLink
Definition: TSystem.h:143
R__EXTERN TSystem * gSystem
Definition: TSystem.h:545
Class providing the PROOF server.
Definition: TProofServ.h:76
TString fSessionDir
Definition: TProofServ.h:95
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
Definition: TEnv.cxx:494
TProofServLiteInterruptHandler * fInterruptHandler
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2308
void HandleFork(TMessage *mess)
Cloning itself via fork.
TMarker * m
Definition: textangle.C:8
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:657
TString fUser
Definition: TProofServ.h:87
Bool_t IsNull() const
Definition: TString.h:387
virtual void FreeDirectory(void *dirp)
Free a directory.
Definition: TSystem.cxx:839
#define Printf
Definition: TGeoToOCC.h:18
TString & Remove(Ssiz_t pos)
Definition: TString.h:616
long Long_t
Definition: RtypesCore.h:50
virtual TSignalHandler * RemoveSignalHandler(TSignalHandler *sh)
Remove a signal handler from list of signal handlers.
Definition: TSystem.cxx:546
virtual ~TProofServLite()
Cleanup.
virtual void SendLogFile(Int_t status=0, Int_t start=-1, Int_t end=-1)
Send log file to master.
TString fTopSessionTag
Definition: TProofServ.h:94
virtual const char * HostName()
Return the system's host name.
Definition: TSystem.cxx:307
virtual int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
Definition: TSystem.cxx:1285
Bool_t IsMaster() const
Definition: TProofServ.h:306
ClassImp(TProofServLite) extern"C"
R__EXTERN TEnv * gEnv
Definition: TEnv.h:174
void Terminate(Int_t status)
Terminate the proof server.
The TTimeStamp encapsulates seconds and ns since EPOCH.
Definition: TTimeStamp.h:76
void HandleTermination()
Called when the client is not alive anymore; terminate the session.
void Throw(int code)
If an exception context has been set (using the TRY and RETRY macros) jump back to where it was set...
Definition: TException.cxx:27
const Ssiz_t kNPOS
Definition: Rtypes.h:115
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:567
R__EXTERN Int_t gProofDebugLevel
Definition: TProofDebug.h:56
TString fWorkDir
Definition: TProofServ.h:91
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Definition: TSystem.cxx:830
void RedirectOutput(const char *dir=0, const char *mode="w")
Redirect stdout to a log file.
virtual void AddFileHandler(TFileHandler *fh)
Add a file handler to the list of system file handlers.
Definition: TSystem.cxx:558
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
Definition: TApplication.h:45
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Definition: TSystem.cxx:1191
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:582
const Bool_t kTRUE
Definition: Rtypes.h:91
Int_t fLogFileDes
Definition: TProofServ.h:113
Bool_t NoLogOpt() const
Definition: TApplication.h:144
virtual Long_t ProcessFile(const char *file, Int_t *error=0, Bool_t keep=kFALSE)
Process a file containing a C++ macro.