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