Logo ROOT  
Reference Guide
TXSlave.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 TXSlave
13 \ingroup proofx
14 
15 This is the version of TSlave for workers servers based on XProofD.
16 See TSlave and TXSocket for details.
17 
18 */
19 
20 #include "TXSlave.h"
21 #include "TProof.h"
22 #include "TProofServ.h"
23 #include "TSystem.h"
24 #include "TROOT.h"
25 #include "TUrl.h"
26 #include "TMessage.h"
27 #include "TMonitor.h"
28 #include "TError.h"
29 #include "TSysEvtHandler.h"
30 #include "TVirtualMutex.h"
31 #include "TXSocket.h"
32 #include "TXSocketHandler.h"
33 #include "Varargs.h"
34 #include "XProofProtocol.h"
35 
36 #include <mutex>
37 
39 
40 //______________________________________________________________________________
41 
42 //---- Hook to the constructor -------------------------------------------------
43 //---- This is needed to avoid using the plugin manager which may create -------
44 //---- problems in multi-threaded environments. --------------------------------
45 TSlave *GetTXSlave(const char *url, const char *ord, Int_t perf,
46  const char *image, TProof *proof, Int_t stype,
47  const char *workdir, const char *msd, Int_t nwk)
48 {
49  return ((TSlave *)(new TXSlave(url, ord, perf, image,
50  proof, stype, workdir, msd, nwk)));
51 }
52 
53 class XSlaveInit {
54  public:
55  XSlaveInit() {
57 }};
58 static XSlaveInit xslave_init;
59 
60 //______________________________________________________________________________
61 
62 //---- error handling ----------------------------------------------------------
63 //---- Needed to avoid blocking on the CINT mutex in printouts -----------------
64 
65 ////////////////////////////////////////////////////////////////////////////////
66 /// Interface to ErrorHandler (protected).
67 
68 void TXSlave::DoError(int level, const char *location, const char *fmt, va_list va) const
69 {
70  ::ErrorHandler(level, Form("TXSlave::%s", location), fmt, va);
71 }
72 
73 //
74 // Specific Interrupt signal handler
75 //
76 class TXSlaveInterruptHandler : public TSignalHandler {
77 private:
78  TXSocket *fSocket;
79 public:
80  TXSlaveInterruptHandler(TXSocket *s = 0)
81  : TSignalHandler(kSigInterrupt, kFALSE), fSocket(s) { }
82  Bool_t Notify();
83 };
84 
85 ////////////////////////////////////////////////////////////////////////////////
86 /// TXSlave interrupt handler.
87 
88 Bool_t TXSlaveInterruptHandler::Notify()
89 {
90  Info("Notify","Processing interrupt signal ...");
91 
92  // Handle also interrupt condition on socket(s)
93  if (fSocket)
94  fSocket->SetInterrupt();
95 
96  return kTRUE;
97 }
98 
99 ////////////////////////////////////////////////////////////////////////////////
100 /// Create a PROOF slave object. Called via the TProof ctor.
101 
102 TXSlave::TXSlave(const char *url, const char *ord, Int_t perf,
103  const char *image, TProof *proof, Int_t stype,
104  const char *workdir, const char *msd, Int_t nwk) : TSlave()
105 {
106  fImage = image;
107  fProofWorkDir = workdir;
108  fWorkDir = workdir;
109  fOrdinal = ord;
110  fPerfIdx = perf;
111  fProof = proof;
112  fSlaveType = (ESlaveType)stype;
113  fMsd = msd;
114  fNWrks = nwk;
115  fIntHandler = 0;
116  fValid = kFALSE;
117 
118  // Instance of the socket input handler to monitor all the XPD sockets
120  gSystem->AddFileHandler(sh);
121 
122  TXSocket::SetLocation((fProof->IsMaster()) ? "master" : "client");
123 
124  Init(url, stype);
125 }
126 
127 ////////////////////////////////////////////////////////////////////////////////
128 /// Init a PROOF slave object. Called via the TXSlave ctor.
129 /// The Init method is technology specific and is overwritten by derived
130 /// classes.
131 
132 void TXSlave::Init(const char *host, Int_t stype)
133 {
134  // Url string with host, port information; 'host' may contain 'user' information
135  // in the usual form 'user@host'
136 
137  // Auxilliary url
138  TUrl url(host);
140  // Check port
141  if (url.GetPort() == TUrl("a").GetPort()) {
142  // We use 'rootd' service as default.
143  Int_t port = gSystem->GetServiceByName("proofd");
144  if (port < 0) {
145  if (gDebug > 0)
146  Info("Init","service 'proofd' not found by GetServiceByName"
147  ": using default IANA assigned tcp port 1093");
148  port = 1093;
149  } else {
150  if (gDebug > 1)
151  Info("Init","port from GetServiceByName: %d", port);
152  }
153  url.SetPort(port);
154  }
155 
156  // Fill members
157  fName = url.GetHostFQDN();
158  fPort = url.GetPort(); // We get the right default if the port is not specified
159  // Group specification , if any, uses the password field, i.e. user[:group]
160  fGroup = url.GetPasswd();
161 
162  // The field 'psid' is interpreted as session ID when we are attaching
163  // to an existing session (ID passed in the options field of the url) or
164  // to our PROOF protocl version when we are creating a new session
165  TString opts(url.GetOptions());
166  Bool_t attach = (opts.Length() > 0 && opts.IsDigit()) ? kTRUE : kFALSE;
167  Int_t psid = (attach) ? opts.Atoi() : kPROOF_Protocol;
168 
169  // Add information about our status (Client or Master)
170  TString iam;
171  Char_t mode = 's';
172  TString alias = fProof->GetTitle();
173  if (fProof->IsMaster() && stype == kSlave) {
174  iam = "Master";
175  mode = 's';
176  // Send session tag of the closest master to the slaves
177  alias.Form("session-%s|ord:%s", fProof->GetName(), fOrdinal.Data());
178  } else if (fProof->IsMaster() && stype == kMaster) {
179  iam = "Master";
180  mode = 'm';
181  // Send session tag of the closest master to the slaves
182  if (fNWrks > 1) {
183  alias.Form("session-%s|ord:%s|plite:%d", fProof->GetName(), fOrdinal.Data(), fNWrks);
184  mode = 'L';
185  } else {
186  alias.Form("session-%s|ord:%s", fProof->GetName(), fOrdinal.Data());
187  }
188  } else if (!fProof->IsMaster() && stype == kMaster) {
189  iam = "Local Client";
190  mode = (attach) ? 'A' : 'M';
191  } else {
192  Error("Init","Impossible PROOF <-> SlaveType Configuration Requested");
193  R__ASSERT(0);
194  }
195 
196  // Add conf file, if required
197  if (fProof->fConfFile.Length() > 0 && fNWrks <= 1)
198  alias += Form("|cf:%s",fProof->fConfFile.Data());
199 
200  // Send over env variables (may not be supported remotely)
201  TString envlist;
202  if (!fProof->GetManager() ||
203  fProof->GetManager()->GetRemoteProtocol() > 1001) {
204  // Check if the user forced locally a given authentication protocol:
205  // we need to do the same remotely to get the right credentials
206  if (gSystem->Getenv("XrdSecPROTOCOL")) {
207  TProof::DelEnvVar("XrdSecPROTOCOL");
208  TProof::AddEnvVar("XrdSecPROTOCOL", gSystem->Getenv("XrdSecPROTOCOL"));
209  }
210  const TList *envs = TProof::GetEnvVars();
211  if (envs != 0 ) {
212  TIter next(envs);
213  for (TObject *o = next(); o != 0; o = next()) {
214  TNamed *env = dynamic_cast<TNamed*>(o);
215  if (env != 0) {
216  if (!envlist.IsNull())
217  envlist += ",";
218  envlist += Form("%s=%s", env->GetName(), env->GetTitle());
219  }
220  }
221  }
222  } else {
224  Info("Init", "** NOT ** sending user envs - RemoteProtocol : %d",
226  }
227 
228  // Add to the buffer
229  if (!envlist.IsNull())
230  alias += Form("|envs:%s", envlist.Data());
231 
232  // Open connection to a remote XrdPROOF slave server.
233  // Login and authentication are dealt with at this level, if required.
234  if (!(fSocket = new TXSocket(url.GetUrl(kTRUE), mode, psid,
235  -1, alias, fProof->GetLogLevel(), this))) {
236  ParseBuffer(); // For the log path
237  Error("Init", "while opening the connection to %s - exit", url.GetUrl(kTRUE));
238  return;
239  }
240 
241  // The socket may not be valid
242  if (!(fSocket->IsValid())) {
243  // Notify only if verbosity is on: most likely the failure has already been notified
244  PDB(kGlobal,1)
245  Error("Init", "some severe error occurred while opening "
246  "the connection at %s - exit", url.GetUrl(kTRUE));
247  ParseBuffer(); // For the log path
248  // Fill some useful info
249  fUser = ((TXSocket *)fSocket)->fUser;
250  PDB(kGlobal,3) Info("Init","%s: fUser is .... %s", iam.Data(), fUser.Data());
252  return;
253  }
254 
255  // Set the ordinal in the title for debugging
257 
258  // Check if the remote server supports user envs setting
259  if (!fProof->GetManager() && !envlist.IsNull() &&
260  ((TXSocket *)fSocket)->GetXrdProofdVersion() <= 1001) {
261  Info("Init","user envs setting sent but unsupported remotely - RemoteProtocol : %d",
262  ((TXSocket *)fSocket)->GetXrdProofdVersion());
263  }
264 
265  // Set the reference to TProof
266  ((TXSocket *)fSocket)->fReference = fProof;
267 
268  // Protocol run by remote PROOF server
270 
271  // Set server type
273 
274  // Set remote session ID
275  fProof->fSessionID = ((TXSocket *)fSocket)->GetSessionID();
276 
277  // Extract the log file path and, if any, set URL entry point for the default data pool
278  ParseBuffer();
279 
280  // Remove socket from global TROOT socket list. Only the TProof object,
281  // representing all slave sockets, will be added to this list. This will
282  // ensure the correct termination of all proof servers in case the
283  // root session terminates.
284  {
286  gROOT->GetListOfSockets()->Remove(fSocket);
287  }
288 
289  // Fill some useful info
290  fUser = ((TXSocket *)fSocket)->fUser;
291  PDB(kGlobal,3) {
292  Info("Init","%s: fUser is .... %s", iam.Data(), fUser.Data());
293  }
294 
295  // Set valid
296  fValid = kTRUE;
297 }
298 
299 ////////////////////////////////////////////////////////////////////////////////
300 /// Parse fBuffer after a connection attempt
301 
303 {
304  // Set URL entry point for the default data pool
305  TString buffer(((TXSocket *)fSocket)->fBuffer);
306  if (!buffer.IsNull()) {
307  Ssiz_t ilog = buffer.Index("|log:");
308  if (ilog != 0) {
309  // Extract the pool URL (on master)
310  TString dpu = (ilog != kNPOS) ? buffer(0, ilog) : buffer;
311  if (dpu.Length() > 0) fProof->SetDataPoolUrl(dpu);
312  }
313  if (ilog != kNPOS) {
314  // The rest, if any, if the log file path from which we extract the working dir
315  buffer.Remove(0, ilog + sizeof("|log:") - 1);
316  fWorkDir = buffer;
317  if ((ilog = fWorkDir.Last('.')) != kNPOS) fWorkDir.Remove(ilog);
318  if (gDebug > 2)
319  Info("ParseBuffer", "workdir is: %s", fWorkDir.Data());
320  } else if (fProtocol > 31) {
321  Warning("ParseBuffer", "expected log path not found in received startup buffer!");
322  }
323  }
324  // Done
325  return;
326 }
327 
328 ////////////////////////////////////////////////////////////////////////////////
329 /// Init a PROOF slave object. Called via the TXSlave ctor.
330 /// The Init method is technology specific and is overwritten by derived
331 /// classes.
332 
334 {
335  // Get back startup message of proofserv (we are now talking with
336  // the real proofserver and not anymore with the proofd front-end)
337  Int_t what;
338  char buf[512];
339  if (fSocket->Recv(buf, sizeof(buf), what) <= 0) {
340  Error("SetupServ", "failed to receive slave startup message");
341  Close("S");
343  fValid = kFALSE;
344  return -1;
345  }
346 
347  if (what == kMESS_NOTOK) {
349  fValid = kFALSE;
350  return -1;
351  }
352 
353  // protocols less than 4 are incompatible
354  if (fProtocol < 4) {
355  Error("SetupServ", "incompatible PROOF versions (remote version "
356  "must be >= 4, is %d)", fProtocol);
358  fValid = kFALSE;
359  return -1;
360  }
361 
362  fProof->fProtocol = fProtocol; // protocol of last slave on master
363 
364  // set some socket options
366 
367  // We are done
368  return 0;
369 }
370 
371 ////////////////////////////////////////////////////////////////////////////////
372 /// Destroy slave.
373 
375 {
376  Close();
377 }
378 
379 ////////////////////////////////////////////////////////////////////////////////
380 /// Close slave socket.
381 
383 {
384  if (fSocket)
385  // Closing socket ...
386  fSocket->Close(opt);
387 
390 }
391 
392 ////////////////////////////////////////////////////////////////////////////////
393 /// Ping the remote master or slave servers.
394 /// Returns 0 if ok, -1 if it did not ping or in case of error
395 
397 {
398  if (!IsValid()) return -1;
399 
400  return (((TXSocket *)fSocket)->Ping(GetOrdinal()) ? 0 : -1);
401 }
402 
403 ////////////////////////////////////////////////////////////////////////////////
404 /// Touch the client admin file to proof we are alive.
405 
407 {
408  if (!IsValid()) return;
409 
410  ((TXSocket *)fSocket)->RemoteTouch();
411  return;
412 }
413 
414 ////////////////////////////////////////////////////////////////////////////////
415 /// Send interrupt to master or slave servers.
416 /// Returns 0 if ok, -1 in case of error
417 
419 {
420  if (!IsValid()) return;
421 
422  if (type == TProof::kLocalInterrupt) {
423 
424  // Deactivate and flush the local socket (we are not - yet - closing
425  // the session, so we do less things that in case of an error ...)
426  if (fProof) {
427 
428  // Attach to the monitor instance, if any
430  TList *al = mon ? mon->GetListOfActives() : nullptr;
431  if (mon && fSocket && al && al->FindObject(fSocket)) {
432  // Synchronous collection in TProof
433  if (gDebug > 2)
434  Info("Interrupt", "%p: deactivating from monitor %p", this, mon);
435  mon->DeActivate(fSocket);
436  }
437  delete al;
438  } else {
439  Warning("Interrupt", "%p: reference to PROOF missing", this);
440  }
441 
442  // Post semaphore to wake up anybody waiting
443  if (fSocket) ((TXSocket *)fSocket)->PostSemAll();
444 
445  return;
446  }
447 
448  if (fSocket) ((TXSocket *)fSocket)->SendInterrupt(type);
449  Info("Interrupt","Interrupt of type %d sent", type);
450 }
451 
452 ////////////////////////////////////////////////////////////////////////////////
453 /// Sent stop/abort request to PROOF server. It will be
454 /// processed asynchronously by a separate thread.
455 
456 void TXSlave::StopProcess(Bool_t abort, Int_t timeout)
457 {
458  if (!IsValid()) return;
459 
460  ((TXSocket *)fSocket)->SendUrgent(TXSocket::kStopProcess, (Int_t)abort, timeout);
461  if (gDebug > 0)
462  Info("StopProcess", "Request of type %d sent over", abort);
463 }
464 
465 ////////////////////////////////////////////////////////////////////////////////
466 /// Find out the remote proofd protocol version.
467 /// Returns -1 in case of error.
468 
470 {
471  Int_t rproto = -1;
472 
473  UInt_t cproto = 0;
474  Int_t len = sizeof(cproto);
475  memcpy((char *)&cproto,
476  Form(" %d", TSocket::GetClientProtocol()),len);
477  Int_t ns = s->SendRaw(&cproto, len);
478  if (ns != len) {
479  ::Error("TXSlave::GetProofdProtocol",
480  "sending %d bytes to proofd server [%s:%d]",
481  len, (s->GetInetAddress()).GetHostName(), s->GetPort());
482  return -1;
483  }
484 
485  // Get the remote protocol
486  Int_t ibuf[2] = {0};
487  len = sizeof(ibuf);
488  Int_t nr = s->RecvRaw(ibuf, len);
489  if (nr != len) {
490  ::Error("TXSlave::GetProofdProtocol",
491  "reading %d bytes from proofd server [%s:%d]",
492  len, (s->GetInetAddress()).GetHostName(), s->GetPort());
493  return -1;
494  }
495  Int_t kind = net2host(ibuf[0]);
496  if (kind == kROOTD_PROTOCOL) {
497  rproto = net2host(ibuf[1]);
498  } else {
499  kind = net2host(ibuf[1]);
500  if (kind == kROOTD_PROTOCOL) {
501  len = sizeof(rproto);
502  nr = s->RecvRaw(&rproto, len);
503  if (nr != len) {
504  ::Error("TXSlave::GetProofdProtocol",
505  "reading %d bytes from proofd server [%s:%d]",
506  len, (s->GetInetAddress()).GetHostName(), s->GetPort());
507  return -1;
508  }
509  rproto = net2host(rproto);
510  }
511  }
512  if (gDebug > 2)
513  ::Info("TXSlave::GetProofdProtocol",
514  "remote proofd: buf1: %d, buf2: %d rproto: %d",
515  net2host(ibuf[0]),net2host(ibuf[1]),rproto);
516 
517  // We are done
518  return rproto;
519 }
520 
521 ////////////////////////////////////////////////////////////////////////////////
522 /// Send message to intermediate coordinator.
523 /// If any output is due, this is returned as a generic message
524 
525 TObjString *TXSlave::SendCoordinator(Int_t kind, const char *msg, Int_t int2)
526 {
527  return ((TXSocket *)fSocket)->SendCoordinator(kind, msg, int2);
528 }
529 
530 ////////////////////////////////////////////////////////////////////////////////
531 /// Set an alias for this session. If reconnection is supported, the alias
532 /// will be communicated to the remote coordinator so that it can be recovered
533 /// when reconnecting
534 
535 void TXSlave::SetAlias(const char *alias)
536 {
537  // Nothing to do if not in contact with coordinator
538  if (!IsValid()) return;
539 
540  ((TXSocket *)fSocket)->SendCoordinator(kSessionAlias, alias);
541 
542  return;
543 }
544 
545 ////////////////////////////////////////////////////////////////////////////////
546 /// Communicate to the coordinator the priprity of the group to which the
547 /// user belongs
548 /// Return 0 on success
549 
550 Int_t TXSlave::SendGroupPriority(const char *grp, Int_t priority)
551 {
552  // Nothing to do if not in contact with coordinator
553  if (!IsValid()) return -1;
554 
555  ((TXSocket *)fSocket)->SendCoordinator(kGroupProperties, grp, priority);
556 
557  return 0;
558 }
559 
560 ////////////////////////////////////////////////////////////////////////////////
561 /// Handle error on the input socket
562 
564 {
565  XHandleErr_t *herr = in ? (XHandleErr_t *)in : 0;
566 
567  // Try reconnection
568  if (fSocket && herr && (herr->fOpt == 1)) {
569 
570  ((TXSocket *)fSocket)->Reconnect();
571  if (fSocket && fSocket->IsValid()) {
572  if (gDebug > 0) {
573  if (!strcmp(GetOrdinal(), "0")) {
574  Printf("Proof: connection to master at %s:%d re-established",
575  GetName(), GetPort());
576  } else {
577  Printf("Proof: connection to node '%s' at %s:%d re-established",
578  GetOrdinal(), GetName(), GetPort());
579  }
580  }
581  return kFALSE;
582  }
583  }
584 
585  // This seems a real error: notify the interested parties
586  Info("HandleError", "%p:%s:%s got called ... fProof: %p, fSocket: %p (valid: %d)",
587  this, fName.Data(), fOrdinal.Data(), fProof, fSocket,
588  (fSocket ? (Int_t)fSocket->IsValid() : -1));
589 
590  // Remove interrupt handler (avoid affecting other clients of the underlying physical
591  // connection)
593 
594  if (fProof) {
595 
596  // Remove PROOF signal handler
597  if (fProof->fIntHandler)
599 
600  Info("HandleError", "%p: proof: %p", this, fProof);
601 
602  if (fSocket) {
603  // This is need to skip contacting the remote server upon close
604  ((TXSocket *)fSocket)->SetSessionID(-1);
605  // This is need to interrupt possible pickup waiting status
606  ((TXSocket *)fSocket)->SetInterrupt();
607  // Synchronous collection in TProof: post fatal message; this will
608  // mark the worker as bad and update the internal lists accordingly
609  ((TXSocket *)fSocket)->PostMsg(kPROOF_FATAL);
610  }
611 
612  // On masters we notify clients of the problem occured
613  if (fProof->IsMaster()) {
614  TString msg(Form("Worker '%s-%s' has been removed from the active list",
615  fName.Data(), fOrdinal.Data()));
617  m << msg;
618  if (gProofServ)
619  gProofServ->GetSocket()->Send(m);
620  else
621  Warning("HandleError", "%p: global reference to TProofServ missing", this);
622  }
623  } else {
624  Warning("HandleError", "%p: reference to PROOF missing", this);
625  }
626 
627  Printf("TXSlave::HandleError: %p: DONE ... ", this);
628 
629  // We are done
630  return kTRUE;
631 }
632 
633 ////////////////////////////////////////////////////////////////////////////////
634 /// Handle asynchronous input on the socket
635 
637 {
638  if (fProof) {
639 
640  // Attach to the monitor instance, if any
642 
643  if (gDebug > 2)
644  Info("HandleInput", "%p: %s: proof: %p, mon: %p",
645  this, GetOrdinal(), fProof, mon);
646 
647  if (mon && mon->IsActive(fSocket)) {
648  // Synchronous collection in TProof
649  if (gDebug > 2)
650  Info("HandleInput","%p: %s: posting monitor %p", this, GetOrdinal(), mon);
651  mon->SetReady(fSocket);
652  } else {
653  // Asynchronous collection in TProof
654  if (gDebug > 2) {
655  if (mon) {
656  Info("HandleInput", "%p: %s: not active in current monitor"
657  " - calling TProof::CollectInputFrom",
658  this, GetOrdinal());
659  } else {
660  Info("HandleInput", "%p: %s: calling TProof::CollectInputFrom",
661  this, GetOrdinal());
662  }
663  }
664  if (fProof->CollectInputFrom(fSocket) < 0)
665  // Something wrong on the line: flush it
666  FlushSocket();
667  }
668  } else {
669  Warning("HandleInput", "%p: %s: reference to PROOF missing", this, GetOrdinal());
670  return kFALSE;
671  }
672 
673  // We are done
674  return kTRUE;
675 }
676 
677 ////////////////////////////////////////////////////////////////////////////////
678 /// Set/Unset the interrupt handler
679 
681 {
682  if (gDebug > 1)
683  Info("SetInterruptHandler", "enter: %d", on);
684 
685  if (on) {
686  if (!fIntHandler)
687  fIntHandler = new TXSlaveInterruptHandler((TXSocket *)fSocket);
688  fIntHandler->Add();
689  } else {
690  if (fIntHandler)
691  fIntHandler->Remove();
692  }
693 }
694 
695 ////////////////////////////////////////////////////////////////////////////////
696 /// Clean any input on the socket
697 
699 {
700  if (gDebug > 1)
701  Info("FlushSocket", "enter: %p", fSocket);
702 
703  if (fSocket)
705 }
TProof::fSessionID
Int_t fSessionID
Definition: TProof.h:528
TXSlave::FlushSocket
void FlushSocket()
Clean any input on the socket.
Definition: TXSlave.cxx:698
m
auto * m
Definition: textangle.C:8
TXSocket
Definition: TXSocket.h:59
kNoDelay
@ kNoDelay
Definition: TSystem.h:221
TSlave
Definition: TSlave.h:46
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
PDB
#define PDB(mask, level)
Definition: TProofDebug.h:56
kPROOF_MESSAGE
@ kPROOF_MESSAGE
Definition: MessageTypes.h:91
TSlave::fSocket
TSocket * fSocket
Definition: TSlave.h:89
TSocket::GetClientProtocol
static Int_t GetClientProtocol()
Static method returning supported client protocol.
Definition: TSocket.cxx:1468
TProof::DelEnvVar
static void DelEnvVar(const char *name)
Remove an variable from the list of environment variables passed to proofserv on the master and slave...
Definition: TProof.cxx:11772
TString::Atoi
Int_t Atoi() const
Return integer value of string.
Definition: TString.cxx:1921
TXSocket::SetLocation
static void SetLocation(const char *loc="")
Set location string.
Definition: TXSocket.cxx:242
TXSlave::Interrupt
void Interrupt(Int_t type)
Send interrupt to master or slave servers.
Definition: TXSlave.cxx:418
kNPOS
const Ssiz_t kNPOS
Definition: RtypesCore.h:115
TProof::fIntHandler
TSignalHandler * fIntHandler
Definition: TProof.h:491
TSlave::fGroup
TString fGroup
Definition: TSlave.h:84
TXSocketHandler::GetSocketHandler
static TXSocketHandler * GetSocketHandler(TFileHandler *h=0, TSocket *s=0)
Get an instance of the input socket handler with 'h' as handler, connected to socket 's'.
Definition: TXSocketHandler.cxx:66
TXSlave::SetupServ
Int_t SetupServ(Int_t stype, const char *conffile)
Init a PROOF slave object.
Definition: TXSlave.cxx:333
TSlave::ESlaveType
ESlaveType
Definition: TSlave.h:55
TList::FindObject
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:577
kSigInterrupt
@ kSigInterrupt
Definition: TSysEvtHandler.h:115
TString::Data
const char * Data() const
Definition: TString.h:369
TSlave::fProtocol
Int_t fProtocol
Definition: TSlave.h:88
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:54
TSignalHandler
Definition: TSysEvtHandler.h:127
TProof::GetLogLevel
Int_t GetLogLevel() const
Definition: TProof.h:916
TProofMgr::kXProofd
@ kXProofd
Definition: TProofMgr.h:46
TObject::Info
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:864
TXSlave::SendGroupPriority
Int_t SendGroupPriority(const char *grp, Int_t priority)
Communicate to the coordinator the priprity of the group to which the user belongs Return 0 on succes...
Definition: TXSlave.cxx:550
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
fBuffer
std::string fBuffer
Definition: DeclareConverters.h:140
TSlave::IsValid
virtual Bool_t IsValid() const
Definition: TSlave.h:150
TXSlave::~TXSlave
virtual ~TXSlave()
Destroy slave.
Definition: TXSlave.cxx:374
XHandleErr_t::fOpt
Int_t fOpt
Definition: TXSocket.h:55
TUrl::GetPort
Int_t GetPort() const
Definition: TUrl.h:78
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
TMonitor.h
TXSlave.h
Int_t
int Int_t
Definition: RtypesCore.h:45
TSlave::kSlave
@ kSlave
Definition: TSlave.h:55
TSlave::fMsd
TString fMsd
Definition: TSlave.h:98
TProofMgr::GetRemoteProtocol
virtual Int_t GetRemoteProtocol() const
Definition: TProofMgr.h:90
TMonitor
Definition: TMonitor.h:36
SafeDelete
#define SafeDelete(p)
Definition: RConfig.hxx:543
TXSockPipe::Flush
Int_t Flush(TSocket *s)
Remove any reference to socket 's' from the global pipe and ready-socket queue.
Definition: TXSocket.cxx:2344
kPROOF_Protocol
const Int_t kPROOF_Protocol
Definition: TProof.h:120
TSlave::fImage
TString fImage
Definition: TSlave.h:80
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TSocket::IsValid
virtual Bool_t IsValid() const
Definition: TSocket.h:132
kGroupProperties
@ kGroupProperties
Definition: XProofProtocol.h:100
TMessage.h
XProofProtocol.h
TXSocket::fgPipe
static TXSockPipe fgPipe
Definition: TXSocket.h:111
TProof::GetEnvVars
static const TList * GetEnvVars()
Get environemnt variables.
Definition: TProof.cxx:11741
TProof::SetDataPoolUrl
void SetDataPoolUrl(const char *url)
Definition: TProof.h:1044
Varargs.h
TString
Definition: TString.h:136
TSlave::GetPort
Int_t GetPort() const
Definition: TSlave.h:130
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TSlave::fWorkDir
TString fWorkDir
Definition: TSlave.h:82
TXSlave::StopProcess
void StopProcess(Bool_t abort, Int_t timeout)
Sent stop/abort request to PROOF server.
Definition: TXSlave.cxx:456
TSocket::Send
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
Definition: TSocket.cxx:522
TProof::GetManager
TProofMgr * GetManager()
Definition: TProof.h:1037
bool
TXSlave
Definition: TXSlave.h:32
TProof::kLocalInterrupt
@ kLocalInterrupt
Definition: TProof.h:394
TString::Last
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition: TString.cxx:892
TROOT.h
TMonitor::DeActivate
virtual void DeActivate(TSocket *sock)
De-activate a socket.
Definition: TMonitor.cxx:284
TProof::AddEnvVar
static void AddEnvVar(const char *name, const char *value)
Add an variable to the list of environment variables passed to proofserv on the master and slaves.
Definition: TProof.cxx:11750
TSlave::GetName
const char * GetName() const
Returns name of object.
Definition: TSlave.h:124
TObjString
Definition: TObjString.h:28
TProof::fProtocol
Int_t fProtocol
Definition: TProof.h:571
TProof::IsMaster
Bool_t IsMaster() const
Definition: TProof.h:936
TSocket
Definition: TSocket.h:41
TString::Form
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
TXSlave::fValid
Bool_t fValid
Definition: TXSlave.h:38
TSlave::fInput
TFileHandler * fInput
Definition: TSlave.h:91
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TSlave::fProofWorkDir
TString fProofWorkDir
Definition: TSlave.h:81
TSlave::fName
TString fName
Definition: TSlave.h:79
TSlave::fUser
TString fUser
Definition: TSlave.h:83
TSocket::GetRemoteProtocol
Int_t GetRemoteProtocol() const
Definition: TSocket.h:126
TSystem.h
gROOTMutex
R__EXTERN TVirtualMutex * gROOTMutex
Definition: TROOT.h:61
TXSlave::ParseBuffer
void ParseBuffer()
Parse fBuffer after a connection attempt.
Definition: TXSlave.cxx:302
GetTXSlave
TSlave * GetTXSlave(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: TXSlave.cxx:45
TXSocketHandler
Definition: TXSocketHandler.h:28
TMonitor::GetListOfActives
TList * GetListOfActives() const
Returns a list with all active sockets.
Definition: TMonitor.cxx:498
TXSlave::SendCoordinator
TObjString * SendCoordinator(Int_t kind, const char *msg=0, Int_t int2=0)
Send message to intermediate coordinator.
Definition: TXSlave.cxx:525
TString::Remove
TString & Remove(Ssiz_t pos)
Definition: TString.h:673
TNamed
Definition: TNamed.h:29
TXSlave::GetProofdProtocol
static Int_t GetProofdProtocol(TSocket *s)
Find out the remote proofd protocol version.
Definition: TXSlave.cxx:469
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TSlave::fPerfIdx
Int_t fPerfIdx
Definition: TSlave.h:87
TProof.h
TSlave::fProof
TProof * fProof
Definition: TSlave.h:90
TXSocketHandler.h
gDebug
R__EXTERN Int_t gDebug
Definition: RtypesCore.h:119
ErrorHandler
void ErrorHandler(int level, const char *location, const char *fmt, std::va_list va)
General error handler function. It calls the user set error handler.
Definition: TError.cxx:111
TSignalHandler::Notify
virtual Bool_t Notify()
Notify when signal occurs.
Definition: TSysEvtHandler.cxx:159
TGeant4Unit::ns
static constexpr double ns
Definition: TGeant4SystemOfUnits.h:167
TProofServ.h
TSlave::SetTXSlaveHook
static void SetTXSlaveHook(TSlave_t xslavehook)
Set hook to TXSlave ctor.
Definition: TSlave.cxx:665
net2host
UShort_t net2host(UShort_t x)
Definition: Bytes.h:575
what
static const char * what
Definition: stlLoader.cc:6
TXSlave::fIntHandler
TSignalHandler * fIntHandler
Definition: TXSlave.h:40
R__LOCKGUARD
#define R__LOCKGUARD(mutex)
Definition: TVirtualMutex.h:104
TXSlave::DoError
void DoError(int level, const char *location, const char *fmt, va_list va) const
Interface to ErrorHandler (protected).
Definition: TXSlave.cxx:68
TProof::fConfFile
TString fConfFile
Definition: TProof.h:568
TProofServ::GetSocket
TSocket * GetSocket() const
Definition: TProofServ.h:257
XHandleErr_t
Definition: TXSocket.h:54
TUrl::SetProtocol
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
Definition: TUrl.cxx:520
TNamed::SetTitle
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
TVirtualMutex.h
TObject::Warning
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:876
TUrl::GetUrl
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition: TUrl.cxx:387
TUrl
Definition: TUrl.h:33
TString::IsDigit
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
Definition: TString.cxx:1763
TXSlave::SetInterruptHandler
void SetInterruptHandler(Bool_t on=kTRUE)
Set/Unset the interrupt handler.
Definition: TXSlave.cxx:680
unsigned int
TXSlave::Touch
void Touch()
Touch the client admin file to proof we are alive.
Definition: TXSlave.cxx:406
TSlave::fPort
Int_t fPort
Definition: TSlave.h:85
TString::Index
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:639
TXSocket::kStopProcess
@ kStopProcess
Definition: TXSocket.h:139
Printf
void Printf(const char *fmt,...)
TProof::fServType
TProofMgr::EServType fServType
Definition: TProof.h:586
TUrl::GetProtocol
const char * GetProtocol() const
Definition: TUrl.h:64
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TUrl::SetPort
void SetPort(Int_t port)
Definition: TUrl.h:88
TSystem::Getenv
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1661
TProof::fCurrentMonitor
TMonitor * fCurrentMonitor
Definition: TProof.h:487
TXSlave::Ping
Int_t Ping()
Ping the remote master or slave servers.
Definition: TXSlave.cxx:396
TXSlave::HandleError
Bool_t HandleError(const void *in=0)
Handle error on the input socket.
Definition: TXSlave.cxx:563
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
TProof::fUrl
TUrl fUrl
Definition: TProof.h:567
TSlave::fSlaveType
ESlaveType fSlaveType
Definition: TSlave.h:95
TSignalHandler::Add
virtual void Add()
Add signal handler to system signal handler list.
Definition: TSysEvtHandler.cxx:168
R__ASSERT
#define R__ASSERT(e)
Definition: TError.h:120
Info
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Definition: TError.cxx:220
TProof::CollectInputFrom
Int_t CollectInputFrom(TSocket *s, Int_t endtype=-1, Bool_t deactonfail=kFALSE)
Collect and analyze available input from socket s.
Definition: TProof.cxx:3050
TXSlave::SetAlias
void SetAlias(const char *alias)
Set an alias for this session.
Definition: TXSlave.cxx:535
TSystem::AddFileHandler
virtual void AddFileHandler(TFileHandler *fh)
Add a file handler to the list of system file handlers.
Definition: TSystem.cxx:555
kROOTD_PROTOCOL
@ kROOTD_PROTOCOL
Definition: MessageTypes.h:120
TObject
Definition: TObject.h:37
TXSlave::Init
void Init(const char *host, Int_t stype)
Init a PROOF slave object.
Definition: TXSlave.cxx:132
kMESS_NOTOK
@ kMESS_NOTOK
Definition: MessageTypes.h:39
TSocket::Recv
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
Definition: TSocket.cxx:817
TMonitor::IsActive
Bool_t IsActive(TSocket *s) const
Check if socket 's' is in the active list.
Definition: TMonitor.cxx:482
TSignalHandler::Remove
virtual void Remove()
Remove signal handler from system signal handler list.
Definition: TSysEvtHandler.cxx:179
TUrl::GetPasswd
const char * GetPasswd() const
Definition: TUrl.h:66
TIter
Definition: TCollection.h:233
TProof
Definition: TProof.h:316
TSlave::TXSlave
friend class TXSlave
Definition: TSlave.h:51
TUrl::GetOptions
const char * GetOptions() const
Definition: TUrl.h:71
kSessionAlias
@ kSessionAlias
Definition: XProofProtocol.h:92
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
type
int type
Definition: TGX11.cxx:121
TMessage
Definition: TMessage.h:33
TSocket::SetOption
virtual Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
Definition: TSocket.cxx:1012
xslave_init
static XSlaveInit xslave_init
Definition: TXSlave.cxx:58
TXSlave::fNWrks
Int_t fNWrks
Definition: TXSlave.h:39
Char_t
char Char_t
Definition: RtypesCore.h:33
TSocket::Close
virtual void Close(Option_t *opt="")
Close the socket.
Definition: TSocket.cxx:389
TXSlave::HandleInput
Bool_t HandleInput(const void *in=0)
Handle asynchronous input on the socket.
Definition: TXSlave.cxx:636
TUrl::GetHostFQDN
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
Definition: TUrl.cxx:469
TUrl.h
TSystem::GetServiceByName
virtual int GetServiceByName(const char *service)
Get port # of internet service.
Definition: TSystem.cxx:2356
gProofServ
R__EXTERN TProofServ * gProofServ
Definition: TProofServ.h:347
TSlave::kMaster
@ kMaster
Definition: TSlave.h:55
TMonitor::SetReady
void SetReady(TSocket *sock)
Called by TSocketHandler::Notify() to signal which socket is ready to be read or written.
Definition: TMonitor.cxx:423
kPROOF_FATAL
@ kPROOF_FATAL
Definition: MessageTypes.h:49
TList
Definition: TList.h:44
TXSocket.h
gROOT
#define gROOT
Definition: TROOT.h:406
TSlave::fOrdinal
TString fOrdinal
Definition: TSlave.h:86
int
TError.h
TSlave::GetOrdinal
const char * GetOrdinal() const
Definition: TSlave.h:131
TXSlave::Close
void Close(Option_t *opt="")
Close slave socket.
Definition: TXSlave.cxx:382
TSysEvtHandler.h