ROOT  6.06/09
Reference Guide
TSlave.cxx
Go to the documentation of this file.
1 // @(#)root/proof:$Id$
2 // Author: Fons Rademakers 14/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 // //
14 // TSlave //
15 // //
16 // This class describes a PROOF slave server. //
17 // It contains information like the slaves host name, ordinal number, //
18 // performance index, socket, etc. Objects of this class can only be //
19 // created via TProof member functions. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #include <stdlib.h>
24 
25 #include "RConfigure.h"
26 #include "TApplication.h"
27 #include "TSlave.h"
28 #include "TSlaveLite.h"
29 #include "TProof.h"
30 #include "TSystem.h"
31 #include "TEnv.h"
32 #include "TROOT.h"
33 #include "TUrl.h"
34 #include "TMessage.h"
35 #include "TError.h"
36 #include "TVirtualMutex.h"
37 #include "TSocket.h"
38 #include "TObjString.h"
39 
41 
42 // Hook for the TXSlave constructor
43 TSlave_t TSlave::fgTXSlaveHook = 0;
44 
45 ////////////////////////////////////////////////////////////////////////////////
46 /// Create a PROOF slave object. Called via the TProof ctor.
47 
48 TSlave::TSlave(const char *url, const char *ord, Int_t perf,
49  const char *image, TProof *proof, Int_t stype,
50  const char *workdir, const char *msd, Int_t)
51  : fImage(image), fProofWorkDir(workdir),
52  fWorkDir(workdir), fPort(-1),
53  fOrdinal(ord), fPerfIdx(perf),
54  fProtocol(0), fSocket(0), fProof(proof),
55  fInput(0), fBytesRead(0), fRealTime(0),
56  fCpuTime(0), fSlaveType((ESlaveType)stype), fStatus(TSlave::kInvalid),
57  fParallel(0), fMsd(msd)
58 {
59  fName = TUrl(url).GetHostFQDN();
60  fPort = TUrl(url).GetPort();
61 
62  Init(url, -1, stype);
63 }
64 
65 ////////////////////////////////////////////////////////////////////////////////
66 /// Default constructor used by derived classes
67 
69 {
70  fPort = -1;
71  fOrdinal = "-1";
72  fPerfIdx = -1;
73  fProof = 0;
75  fProtocol = 0;
76  fSocket = 0;
77  fInput = 0;
78  fBytesRead = 0;
79  fRealTime = 0;
80  fCpuTime = 0;
81  fStatus = kInvalid;
82  fParallel = 0;
83 }
84 
85 ////////////////////////////////////////////////////////////////////////////////
86 /// Init a PROOF slave object. Called via the TSlave ctor.
87 /// The Init method is technology specific and is overwritten by derived
88 /// classes.
89 
90 void TSlave::Init(const char *host, Int_t port, Int_t stype)
91 {
92  // The url contains information about the server type: make sure
93  // it is 'proofd' or alike
94  TString proto = fProof->fUrl.GetProtocol();
95  proto.Insert(5, 'd');
96 
97  TUrl hurl(host);
98  hurl.SetProtocol(proto);
99  if (port > 0)
100  hurl.SetPort(port);
101 
102  // Add information about our status (Client or Master)
103  TString iam;
104  if (fProof->IsMaster() && stype == kSlave) {
105  iam = "Master";
106  hurl.SetOptions("SM");
107  } else if (fProof->IsMaster() && stype == kMaster) {
108  iam = "Master";
109  hurl.SetOptions("MM");
110  } else if (!fProof->IsMaster() && stype == kMaster) {
111  iam = "Local Client";
112  hurl.SetOptions("MC");
113  } else {
114  Error("Init","Impossible PROOF <-> SlaveType Configuration Requested");
115  R__ASSERT(0);
116  }
117 
118  // Open authenticated connection to remote PROOF slave server.
119  // If a connection was already open (fSocket != 0), re-use it
120  // to perform authentication (optimization needed to avoid a double
121  // opening in case this is called by TXSlave).
122  Int_t wsize = 65536;
123  fSocket = TSocket::CreateAuthSocket(hurl.GetUrl(), 0, wsize, fSocket);
124 
125  if (!fSocket || !fSocket->IsAuthenticated()) {
126  SafeDelete(fSocket);
127  return;
128  }
129 
130  // Remove socket from global TROOT socket list. Only the TProof object,
131  // representing all slave sockets, will be added to this list. This will
132  // ensure the correct termination of all proof servers in case the
133  // root session terminates.
134  {
136  gROOT->GetListOfSockets()->Remove(fSocket);
137  }
138 
139  // Fill some useful info
140  fUser = fSocket->GetSecContext()->GetUser();
141  PDB(kGlobal,3) {
142  Info("Init","%s: fUser is .... %s", iam.Data(), fUser.Data());
143  }
144 
145  if (fSocket->GetRemoteProtocol() >= 14 ) {
147 
148  const TList *envs = TProof::GetEnvVars();
149  if (envs != 0 ) {
150  TIter next(envs);
151  for (TObject *o = next(); o != 0; o = next()) {
152  TNamed *env = dynamic_cast<TNamed*>(o);
153  if (env != 0) {
154  TString def = Form("%s=%s", env->GetName(), env->GetTitle());
155  const char *p = def.Data();
156  m << p;
157  }
158  }
159  }
160  fSocket->Send(m);
161  } else {
162  Info("Init","** NOT ** Sending kPROOF_SETENV RemoteProtocol : %d",
163  fSocket->GetRemoteProtocol());
164  }
165 
166  char buf[512];
167  fSocket->Recv(buf, sizeof(buf));
168  if (strcmp(buf, "Okay")) {
169  Printf("%s", buf);
170  SafeDelete(fSocket);
171  return;
172  }
173 
174 }
175 
176 ////////////////////////////////////////////////////////////////////////////////
177 /// Init a PROOF slave object. Called via the TSlave ctor.
178 /// The Init method is technology specific and is overwritten by derived
179 /// classes.
180 
181 Int_t TSlave::SetupServ(Int_t stype, const char *conffile)
182 {
183  // get back startup message of proofserv (we are now talking with
184  // the real proofserver and not anymore with the proofd front-end)
185  Int_t what;
186  char buf[512];
187  if (fSocket->Recv(buf, sizeof(buf), what) <= 0) {
188  Error("SetupServ", "failed to receive slave startup message");
189  SafeDelete(fSocket);
190  return -1;
191  }
192 
193  if (what == kMESS_NOTOK) {
194  SafeDelete(fSocket);
195  return -1;
196  }
197 
198  // exchange protocol level between client and master and between
199  // master and slave
200  if (fSocket->Send(kPROOF_Protocol, kROOTD_PROTOCOL) != 2*sizeof(Int_t)) {
201  Error("SetupServ", "failed to send local PROOF protocol");
202  SafeDelete(fSocket);
203  return -1;
204  }
205 
206  if (fSocket->Recv(fProtocol, what) != 2*sizeof(Int_t)) {
207  Error("SetupServ", "failed to receive remote PROOF protocol");
208  SafeDelete(fSocket);
209  return -1;
210  }
211 
212  // protocols less than 4 are incompatible
213  if (fProtocol < 4) {
214  Error("SetupServ", "incompatible PROOF versions (remote version"
215  " must be >= 4, is %d)", fProtocol);
216  SafeDelete(fSocket);
217  return -1;
218  }
219 
220  fProof->fProtocol = fProtocol; // protocol of last slave on master
221 
222  if (fProtocol < 5) {
223  //
224  // Setup authentication related stuff for ald versions
225  Bool_t isMaster = (stype == kMaster);
226  TString wconf = isMaster ? TString(conffile) : fProofWorkDir;
227  if (OldAuthSetup(isMaster, wconf) != 0) {
228  Error("SetupServ", "OldAuthSetup: failed to setup authentication");
229  SafeDelete(fSocket);
230  return -1;
231  }
232  } else {
233  //
234  // Send ordinal (and config) info to slave (or master)
235  TMessage mess;
236  if (stype == kMaster)
237  mess << fUser << fOrdinal << TString(conffile);
238  else
239  mess << fUser << fOrdinal << fProofWorkDir;
240 
241  if (fSocket->Send(mess) < 0) {
242  Error("SetupServ", "failed to send ordinal and config info");
243  SafeDelete(fSocket);
244  return -1;
245  }
246  }
247 
248  // set some socket options
249  fSocket->SetOption(kNoDelay, 1);
250 
251  // Set active state
252  fStatus = kActive;
253 
254  // We are done
255  return 0;
256 }
257 
258 ////////////////////////////////////////////////////////////////////////////////
259 /// Init a PROOF slave object using the connection opened via s. Used to
260 /// avoid double opening when an attempt via TXSlave found a remote proofd.
261 
262 void TSlave::Init(TSocket *s, Int_t stype)
263 {
264  fSocket = s;
266 }
267 
268 ////////////////////////////////////////////////////////////////////////////////
269 /// Destroy slave.
270 
272 {
273  Close();
274 }
275 
276 ////////////////////////////////////////////////////////////////////////////////
277 /// Close slave socket.
278 
280 {
281  if (fSocket) {
282 
283  // If local client ...
284  if (!(fProof->IsMaster()) && !strncasecmp(opt,"S",1)) {
285  // ... tell master and slaves to stop
287  }
288 
289  // deactivate used sec context if talking to proofd daemon running
290  // an old protocol (sec context disactivated remotely)
291  TSecContext *sc = fSocket->GetSecContext();
292  if (sc && sc->IsActive()) {
294  TSecContextCleanup *nscc = 0;
295  while ((nscc = (TSecContextCleanup *)last())) {
296  if (nscc->GetType() == TSocket::kPROOFD &&
297  nscc->GetProtocol() < 9) {
298  sc->DeActivate("");
299  break;
300  }
301  }
302  }
303  }
304 
305  SafeDelete(fInput);
306  SafeDelete(fSocket);
307 }
308 
309 ////////////////////////////////////////////////////////////////////////////////
310 /// Used to sort slaves by performance index.
311 
313 {
314  const TSlave *sl = dynamic_cast<const TSlave*>(obj);
315 
316  if (!sl) {
317  Error("Compare", "input is not a TSlave object");
318  return 0;
319  }
320 
321  if (fPerfIdx > sl->GetPerfIdx()) return 1;
322  if (fPerfIdx < sl->GetPerfIdx()) return -1;
323  const char *myord = GetOrdinal();
324  const char *otherord = sl->GetOrdinal();
325  while (myord && otherord) {
326  Int_t myval = atoi(myord);
327  Int_t otherval = atoi(otherord);
328  if (myval < otherval) return 1;
329  if (myval > otherval) return -1;
330  myord = strchr(myord, '.');
331  if (myord) myord++;
332  otherord = strchr(otherord, '.');
333  if (otherord) otherord++;
334  }
335  if (myord) return -1;
336  if (otherord) return 1;
337  return 0;
338 }
339 
340 ////////////////////////////////////////////////////////////////////////////////
341 /// Printf info about slave.
342 
343 void TSlave::Print(Option_t *) const
344 {
345  TString sc;
346 
347  const char *sst[] = { "invalid" , "valid", "inactive" };
348  Int_t st = fSocket ? ((fStatus == kInactive) ? 2 : 1) : 0;
349 
350  Printf("*** Worker %s (%s)", fOrdinal.Data(), sst[st]);
351  Printf(" Host name: %s", GetName());
352  Printf(" Port number: %d", GetPort());
353  Printf(" Worker session tag: %s", GetSessionTag());
354  Printf(" ROOT version|rev|tag: %s", GetROOTVersion());
355  Printf(" Architecture-Compiler: %s", GetArchCompiler());
356  if (fSocket) {
357  if (strlen(GetGroup()) > 0) {
358  Printf(" User/Group: %s/%s", GetUser(), GetGroup());
359  } else {
360  Printf(" User: %s", GetUser());
361  }
362  if (fSocket->GetSecContext())
363  Printf(" Security context: %s", fSocket->GetSecContext()->AsString(sc));
364  Printf(" Proofd protocol version: %d", fSocket->GetRemoteProtocol());
365  Printf(" Image name: %s", GetImage());
366  Printf(" Working directory: %s", GetWorkDir());
367  Printf(" Performance index: %d", GetPerfIdx());
368  Printf(" MB's processed: %.2f", float(GetBytesRead())/(1024*1024));
369  Printf(" MB's sent: %.2f", float(fSocket->GetBytesRecv())/(1024*1024));
370  Printf(" MB's received: %.2f", float(fSocket->GetBytesSent())/(1024*1024));
371  Printf(" Real time used (s): %.3f", GetRealTime());
372  Printf(" CPU time used (s): %.3f", GetCpuTime());
373  } else {
374  if (strlen(GetGroup()) > 0) {
375  Printf(" User/Group: %s/%s", GetUser(), GetGroup());
376  } else {
377  Printf(" User: %s", GetUser());
378  }
379  Printf(" Security context:");
380  Printf(" Proofd protocol version:");
381  Printf(" Image name: %s", GetImage());
382  Printf(" Working directory: %s", GetWorkDir());
383  Printf(" Performance index: %d", GetPerfIdx());
384  Printf(" MB's processed: %.2f", float(GetBytesRead())/(1024*1024));
385  Printf(" MB's sent:");
386  Printf(" MB's received:");
387  Printf(" Real time used (s): %.3f", GetRealTime());
388  Printf(" CPU time used (s): %.3f", GetCpuTime());
389  }
390 }
391 
392 ////////////////////////////////////////////////////////////////////////////////
393 /// Adopt and register input handler for this slave. Handler will be deleted
394 /// by the slave.
395 
397 {
398  fInput = ih;
399  fInput->Add();
400 }
401 
402 ////////////////////////////////////////////////////////////////////////////////
403 /// Setup authentication related stuff for old versions.
404 /// Provided for backward compatibility.
405 
407 {
408  static OldSlaveAuthSetup_t oldAuthSetupHook = 0;
409 
410  if (!oldAuthSetupHook) {
411  // Load libraries needed for (server) authentication ...
412  TString authlib = "libRootAuth";
413  char *p = 0;
414  // The generic one
415  if ((p = gSystem->DynamicPathName(authlib, kTRUE))) {
416  delete[] p;
417  if (gSystem->Load(authlib) == -1) {
418  Error("OldAuthSetup", "can't load %s",authlib.Data());
419  return kFALSE;
420  }
421  } else {
422  Error("OldAuthSetup", "can't locate %s",authlib.Data());
423  return -1;
424  }
425  //
426  // Locate OldSlaveAuthSetup
427  Func_t f = gSystem->DynFindSymbol(authlib,"OldSlaveAuthSetup");
428  if (f)
429  oldAuthSetupHook = (OldSlaveAuthSetup_t)(f);
430  else {
431  Error("OldAuthSetup", "can't find OldSlaveAuthSetup");
432  return -1;
433  }
434  }
435  //
436  // Setup
437  if (oldAuthSetupHook) {
438  return (*oldAuthSetupHook)(fSocket, master, fOrdinal, wconf);
439  } else {
440  Error("OldAuthSetup", "hook to method OldSlaveAuthSetup is undefined");
441  return -1;
442  }
443 }
444 
445 ////////////////////////////////////////////////////////////////////////////////
446 /// Static method returning the appropriate TSlave object for the remote
447 /// server.
448 
449 TSlave *TSlave::Create(const char *url, const char *ord, Int_t perf,
450  const char *image, TProof *proof, Int_t stype,
451  const char *workdir, const char *msd, Int_t nwk)
452 {
453  TSlave *s = 0;
454 
455  // Check if we are setting up a lite version
456  if (!strcmp(url, "lite")) {
457  return new TSlaveLite(ord, perf, image, proof, stype, workdir, msd);
458  }
459 
460  // No need to try a XPD connection in some well defined cases
461  Bool_t tryxpd = kTRUE;
462  if (!(proof->IsMaster())) {
463  if (proof->IsProofd())
464  tryxpd = kFALSE;
465  } else {
466  if (gApplication && (gApplication->Argc() < 3 ||
467  (gApplication->Argc() > 2 && gApplication->Argv(2) &&
468  strncmp(gApplication->Argv(2),"xpd",3))))
469  tryxpd = kFALSE;
470  }
471 
472  // We do this without the plugin manager because it blocks the CINT mutex
473  // breaking the parallel startup
474  if (!fgTXSlaveHook) {
475 
476  // Load the library containing TXSlave ...
477  TString proofxlib = "libProofx";
478  char *p = 0;
479  if ((p = gSystem->DynamicPathName(proofxlib, kTRUE))) {
480  delete[] p;
481  if (gSystem->Load(proofxlib) == -1)
482  ::Error("TSlave::Create", "can't load %s", proofxlib.Data());
483  } else
484  ::Error("TSlave::Create", "can't locate %s", proofxlib.Data());
485  }
486 
487  // Load the right class
488  if (fgTXSlaveHook && tryxpd) {
489  s = (*fgTXSlaveHook)(url, ord, perf, image, proof, stype, workdir, msd, nwk);
490  } else {
491  s = new TSlave(url, ord, perf, image, proof, stype, workdir, msd);
492  }
493 
494  return s;
495 }
496 
497 ////////////////////////////////////////////////////////////////////////////////
498 /// Ping the remote master or slave servers.
499 /// Returns 0 if ok, -1 in case of error
500 
502 {
503  if (!IsValid()) return -1;
504 
506  fSocket->Send(mess);
507  if (fSocket->Send(mess) == -1) {
508  Warning("Ping","%s: acknowledgement not received", GetOrdinal());
509  return -1;
510  }
511  return 0;
512 }
513 
514 ////////////////////////////////////////////////////////////////////////////////
515 /// Send interrupt OOB byte to master or slave servers.
516 /// Returns 0 if ok, -1 in case of error
517 
519 {
520  if (!IsValid()) return;
521 
522  char oobc = (char) type;
523  const int kBufSize = 1024;
524  char waste[kBufSize];
525 
526  // Send one byte out-of-band message to server
527  if (fSocket->SendRaw(&oobc, 1, kOob) <= 0) {
528  Error("Interrupt", "error sending oobc to slave %s", GetOrdinal());
529  return;
530  }
531 
532  if (type == TProof::kHardInterrupt) {
533  char oob_byte;
534  int n, nch, nbytes = 0, nloop = 0;
535 
536  // Receive the OOB byte
537  while ((n = fSocket->RecvRaw(&oob_byte, 1, kOob)) < 0) {
538  if (n == -2) { // EWOULDBLOCK
539  //
540  // The OOB data has not yet arrived: flush the input stream
541  //
542  // In some systems (Solaris) regular recv() does not return upon
543  // receipt of the oob byte, which makes the below call to recv()
544  // block indefinitely if there are no other data in the queue.
545  // FIONREAD ioctl can be used to check if there are actually any
546  // data to be flushed. If not, wait for a while for the oob byte
547  // to arrive and try to read it again.
548  //
549  fSocket->GetOption(kBytesToRead, nch);
550  if (nch == 0) {
551  gSystem->Sleep(1000);
552  continue;
553  }
554 
555  if (nch > kBufSize) nch = kBufSize;
556  n = fSocket->RecvRaw(waste, nch);
557  if (n <= 0) {
558  Error("Interrupt", "error receiving waste from slave %s",
559  GetOrdinal());
560  break;
561  }
562  nbytes += n;
563  } else if (n == -3) { // EINVAL
564  //
565  // The OOB data has not arrived yet
566  //
567  gSystem->Sleep(100);
568  if (++nloop > 100) { // 10 seconds time-out
569  Error("Interrupt", "server %s does not respond", GetOrdinal());
570  break;
571  }
572  } else {
573  Error("Interrupt", "error receiving OOB from server %s",
574  GetOrdinal());
575  break;
576  }
577  }
578 
579  //
580  // Continue flushing the input socket stream until the OOB
581  // mark is reached
582  //
583  while (1) {
584  int atmark;
585 
586  fSocket->GetOption(kAtMark, atmark);
587 
588  if (atmark)
589  break;
590 
591  // find out number of bytes to read before atmark
592  fSocket->GetOption(kBytesToRead, nch);
593  if (nch == 0) {
594  gSystem->Sleep(1000);
595  continue;
596  }
597 
598  if (nch > kBufSize) nch = kBufSize;
599  n = fSocket->RecvRaw(waste, nch);
600  if (n <= 0) {
601  Error("Interrupt", "error receiving waste (2) from slave %s",
602  GetOrdinal());
603  break;
604  }
605  nbytes += n;
606  }
607  if (nbytes > 0) {
608  if (fProof->IsMaster())
609  Info("Interrupt", "slave %s:%s synchronized: %d bytes discarded",
610  GetName(), GetOrdinal(), nbytes);
611  else
612  Info("Interrupt", "PROOF synchronized: %d bytes discarded", nbytes);
613  }
614 
615  // Get log file from master or slave after a hard interrupt
616  fProof->Collect(this);
617 
618  } else if (type == TProof::kSoftInterrupt) {
619 
620  // Get log file from master or slave after a soft interrupt
621  fProof->Collect(this);
622 
623  } else if (type == TProof::kShutdownInterrupt) {
624 
625  ; // nothing expected to be returned
626 
627  } else {
628 
629  // Unexpected message, just receive log file
630  fProof->Collect(this);
631  }
632 }
633 
634 ////////////////////////////////////////////////////////////////////////////////
635 /// Sent stop/abort request to PROOF server.
636 
637 void TSlave::StopProcess(Bool_t abort, Int_t timeout)
638 {
639  // Notify the remote counterpart
641  msg << abort;
642  if (fProof->fProtocol > 9)
643  msg << timeout;
644  fSocket->Send(msg);
645 }
646 
647 ////////////////////////////////////////////////////////////////////////////////
648 /// Send message to intermediate coordinator. Only meaningful when there is one,
649 /// i.e. in XPD framework
650 
652 {
653  if (gDebug > 0)
654  Info("SendCoordinator","method not implemented for this communication layer");
655  return 0;
656 }
657 
658 ////////////////////////////////////////////////////////////////////////////////
659 /// Set an alias for this session. If reconnection is supported, the alias
660 /// will be communicated to the remote coordinator so that it can be recovered
661 /// when reconnecting
662 
663 void TSlave::SetAlias(const char *)
664 {
665  if (gDebug > 0)
666  Info("SetAlias","method not implemented for this communication layer");
667  return;
668 }
669 
670 ////////////////////////////////////////////////////////////////////////////////
671 /// Set hook to TXSlave ctor
672 
674 {
675  fgTXSlaveHook = xslavehook;
676 }
TString fUser
Definition: TSlave.h:87
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:52
const char * GetOrdinal() const
Definition: TSlave.h:135
const char * GetHostName() const
Definition: TInetAddress.h:75
void SetPort(Int_t port)
Definition: TUrl.h:97
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
Definition: TUrl.cxx:518
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
const char Int_t const char TProof Int_t const char const char * msd
Definition: TXSlave.cxx:46
Float_t GetCpuTime() const
Definition: TSlave.h:142
Collectable string class.
Definition: TObjString.h:32
const char * GetSessionTag() const
Definition: TSlave.h:147
const char Option_t
Definition: RtypesCore.h:62
const char * GetUser() const
Definition: TSlave.h:132
This class represents a WWW compatible URL.
Definition: TUrl.h:41
Int_t Argc() const
Definition: TApplication.h:141
virtual TObjString * SendCoordinator(Int_t kind, const char *msg=0, Int_t int2=0)
Send message to intermediate coordinator.
Definition: TSlave.cxx:651
const char Int_t perf
Definition: TXSlave.cxx:46
const char * GetProtocol() const
Definition: TUrl.h:73
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:892
static const TList * GetEnvVars()
Get environemnt variables.
Definition: TProof.cxx:12318
#define R__ASSERT(e)
Definition: TError.h:98
#define gROOT
Definition: TROOT.h:340
virtual void StopProcess(Bool_t abort, Int_t timeout)
Sent stop/abort request to PROOF server.
Definition: TSlave.cxx:637
Int_t GetPort() const
Definition: TSocket.h:145
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
Definition: TSystem.cxx:1818
const char * GetGroup() const
Definition: TSlave.h:133
Basic string class.
Definition: TString.h:137
virtual void Add()
Add file event handler to system file handler list.
Bool_t IsActive() const
Check remote OffSet and expiring Date.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
R__EXTERN TVirtualMutex * gROOTMutex
Definition: TROOT.h:63
const Bool_t kFALSE
Definition: Rtypes.h:92
Bool_t IsProofd() const
Definition: TProof.h:967
R__EXTERN TApplication * gApplication
Definition: TApplication.h:171
TString & Insert(Ssiz_t pos, const char *s)
Definition: TString.h:592
const char * Data() const
Definition: TString.h:349
virtual ~TSlave()
Destroy slave.
Definition: TSlave.cxx:271
#define SafeDelete(p)
Definition: RConfig.h:436
const char * GetROOTVersion() const
Definition: TSlave.h:152
#define PDB(mask, level)
Definition: TProofDebug.h:58
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
Definition: TSystem.cxx:441
Int_t(* OldSlaveAuthSetup_t)(TSocket *, Bool_t, TString, TString)
Definition: TSlave.h:42
const char Int_t const char TProof Int_t stype
Definition: TXSlave.cxx:46
const char * ord
Definition: TXSlave.cxx:46
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
UChar_t mod R__LOCKGUARD2(gSrvAuthenticateMutex)
void Init(TClassEdit::TInterpreterLookupHelper *helper)
Definition: TClassEdit.cxx:118
static void SetTXSlaveHook(TSlave_t xslavehook)
Set hook to TXSlave ctor.
Definition: TSlave.cxx:673
Int_t Collect(const TSlave *sl, Long_t timeout=-1, Int_t endtype=-1, Bool_t deactonfail=kFALSE)
Collect responses from slave sl.
Definition: TProof.cxx:2664
static TSocket * CreateAuthSocket(const char *user, const char *host, Int_t port, Int_t size=0, Int_t tcpwindowsize=-1, TSocket *s=0, Int_t *err=0)
Creates a socket or a parallel socket and authenticates to the remote server specified in 'url' on re...
Definition: TSocket.cxx:1457
TString fOrdinal
Definition: TSlave.h:90
virtual void Interrupt(Int_t type)
Send interrupt OOB byte to master or slave servers.
Definition: TSlave.cxx:518
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
const char * GetWorkDir() const
Definition: TSlave.h:131
virtual void Close(Option_t *opt="")
Close slave socket.
Definition: TSlave.cxx:279
void Error(const char *location, const char *msgfmt,...)
const char * otherord
Definition: TProof.cxx:172
A doubly linked list.
Definition: TList.h:47
static const char * what
Definition: stlLoader.cc:6
char ** Argv() const
Definition: TApplication.h:142
Int_t GetPort() const
Definition: TUrl.h:87
const char Int_t const char TProof Int_t const char * workdir
Definition: TXSlave.cxx:46
const char * GetName() const
Returns name of object.
Definition: TSlave.h:128
TSlave()
Default constructor used by derived classes.
Definition: TSlave.cxx:68
R__EXTERN TSystem * gSystem
Definition: TSystem.h:549
virtual Int_t Ping()
Ping the remote master or slave servers.
Definition: TSlave.cxx:501
TList * GetSecContextCleanup() const
Definition: TSecContext.h:86
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
Definition: TUrl.cxx:467
const char * myord
Definition: TProof.cxx:171
TMarker * m
Definition: textangle.C:8
char * Form(const char *fmt,...)
virtual void DeActivate(Option_t *opt="CR")
Set OffSet to -1 and expiring Date to default Remove from the list If Opt contains "C" or "c"...
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
TSocket * fSocket
Definition: TSlave.h:93
const Int_t kPROOF_Protocol
Definition: TProof.h:143
Int_t fProtocol
Definition: TProof.h:602
#define Printf
Definition: TGeoToOCC.h:18
Int_t fProtocol
Definition: TSlave.h:92
virtual void Print(Option_t *option="") const
Printf info about slave.
Definition: TSlave.cxx:343
const char * GetImage() const
Definition: TSlave.h:129
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition: TUrl.cxx:385
static TSlave * Create(const char *url, const char *ord, Int_t perf, const char *image, TProof *proof, Int_t stype, const char *workdir, const char *msd, Int_t nwk=1)
Static method returning the appropriate TSlave object for the remote server.
Definition: TSlave.cxx:449
virtual void SetAlias(const char *alias)
Set an alias for this session.
Definition: TSlave.cxx:663
Int_t Compare(const TObject *obj) const
Used to sort slaves by performance index.
Definition: TSlave.cxx:312
Int_t GetPerfIdx() const
Definition: TSlave.h:136
#define ClassImp(name)
Definition: Rtypes.h:279
double f(double x)
virtual Func_t DynFindSymbol(const char *module, const char *entry)
Find specific entry point in specified library.
Definition: TSystem.cxx:1982
TProof * fProof
Definition: TSlave.h:94
char * DynamicPathName(const char *lib, Bool_t quiet=kFALSE)
Find a dynamic library called lib using the system search paths.
Definition: TSystem.cxx:1958
int type
Definition: TGX11.cxx:120
Definition: TProof.h:339
void Init(const char *host, Int_t port, Int_t stype)
Init a PROOF slave object.
Definition: TSlave.cxx:90
Bool_t IsMaster() const
Definition: TProof.h:969
Definition: TSocket.h:67
Mother of all ROOT objects.
Definition: TObject.h:58
Int_t fStatus
Definition: TSlave.h:100
const char Int_t const char TProof * proof
Definition: TXSlave.cxx:46
TSlave *(* TSlave_t)(const char *url, const char *ord, Int_t perf, const char *image, TProof *proof, Int_t stype, const char *workdir, const char *msd, Int_t nwk)
Definition: TSlave.h:46
void SetOptions(const char *opt)
Definition: TUrl.h:96
friend class TSlaveLite
Definition: TSlave.h:54
const char * GetArchCompiler() const
Definition: TSlave.h:151
R__EXTERN Int_t gDebug
Definition: Rtypes.h:128
Int_t OldAuthSetup(Bool_t master, TString wconf)
Setup authentication related stuff for old versions.
Definition: TSlave.cxx:406
Int_t GetPort() const
Definition: TSlave.h:134
virtual Bool_t IsValid() const
Definition: TSlave.h:154
const Bool_t kIterBackward
Definition: TCollection.h:44
Definition: TSlave.h:50
TInetAddress GetInetAddress() const
Definition: TSocket.h:143
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
TUrl fUrl
Definition: TProof.h:598
ESlaveType fSlaveType
Definition: TSlave.h:99
const Int_t n
Definition: legend1.C:16
virtual Int_t SetupServ(Int_t stype, const char *conffile)
Init a PROOF slave object.
Definition: TSlave.cxx:181
TString fProofWorkDir
Definition: TSlave.h:85
Float_t GetRealTime() const
Definition: TSlave.h:141
Int_t fPerfIdx
Definition: TSlave.h:91
Long64_t GetBytesRead() const
Definition: TSlave.h:140
const char Int_t const char * image
Definition: TXSlave.cxx:46
void SetInputHandler(TFileHandler *ih)
Adopt and register input handler for this slave.
Definition: TSlave.cxx:396
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:904