Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
15This is the version of TSlave for workers servers based on XProofD.
16See 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. --------------------------------
45TSlave *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
54 public:
57}};
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
68void 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//
77private:
79public:
82 Bool_t Notify();
83};
84
85////////////////////////////////////////////////////////////////////////////////
86/// TXSlave interrupt handler.
87
89{
90 Info("Notify","Processing interrupt signal ...");
91
92 // Handle also interrupt condition on socket(s)
93 if (fSocket)
95
96 return kTRUE;
97}
98
99////////////////////////////////////////////////////////////////////////////////
100/// Create a PROOF slave object. Called via the TProof ctor.
101
102TXSlave::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
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
132void 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
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
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,
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
525TObjString *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
535void 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
550Int_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)
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 }
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)
688 fIntHandler->Add();
689 } else {
690 if (fIntHandler)
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}
UShort_t net2host(UShort_t x)
Definition Bytes.h:575
std::string fBuffer
@ kMESS_NOTOK
@ kPROOF_FATAL
@ kROOTD_PROTOCOL
@ kPROOF_MESSAGE
#define SafeDelete(p)
Definition RConfig.hxx:525
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
char Char_t
Definition RtypesCore.h:37
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Ssiz_t kNPOS
Definition RtypesCore.h:124
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
#define R__ASSERT(e)
Definition TError.h:118
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:109
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
#define PDB(mask, level)
Definition TProofDebug.h:56
R__EXTERN TProofServ * gProofServ
Definition TProofServ.h:347
const Int_t kPROOF_Protocol
Definition TProof.h:120
Int_t gDebug
Definition TROOT.cxx:597
R__EXTERN TVirtualMutex * gROOTMutex
Definition TROOT.h:63
#define gROOT
Definition TROOT.h:407
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2467
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
Definition TString.cxx:2481
@ kSigInterrupt
@ kNoDelay
Definition TSystem.h:221
R__EXTERN TSystem * gSystem
Definition TSystem.h:560
#define R__LOCKGUARD(mutex)
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
static XSlaveInit xslave_init
Definition TXSlave.cxx:58
@ kGroupProperties
@ kSessionAlias
A doubly linked list.
Definition TList.h:38
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
Definition TList.cxx:578
void SetReady(TSocket *sock)
Called by TSocketHandler::Notify() to signal which socket is ready to be read or written.
Definition TMonitor.cxx:423
virtual void DeActivate(TSocket *sock)
De-activate a socket.
Definition TMonitor.cxx:284
TList * GetListOfActives() const
Returns a list with all active sockets.
Definition TMonitor.cxx:498
Bool_t IsActive(TSocket *s) const
Check if socket 's' is in the active list.
Definition TMonitor.cxx:482
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:164
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
Collectable string class.
Definition TObjString.h:28
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:973
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:987
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition TObject.cxx:961
virtual Int_t GetRemoteProtocol() const
Definition TProofMgr.h:90
TSocket * GetSocket() const
Definition TProofServ.h:257
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition TProof.h:316
@ kLocalInterrupt
Definition TProof.h:394
TMonitor * fCurrentMonitor
Definition TProof.h:487
Int_t fSessionID
Definition TProof.h:528
TUrl fUrl
Definition TProof.h:567
void SetDataPoolUrl(const char *url)
Definition TProof.h:1044
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:11760
TSignalHandler * fIntHandler
Definition TProof.h:491
Int_t fProtocol
Definition TProof.h:571
TString fConfFile
Definition TProof.h:568
Int_t GetLogLevel() const
Definition TProof.h:916
TProofMgr::EServType fServType
Definition TProof.h:586
static const TList * GetEnvVars()
Get environemnt variables.
Definition TProof.cxx:11751
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:11782
Bool_t IsMaster() const
Definition TProof.h:936
Int_t CollectInputFrom(TSocket *s, Int_t endtype=-1, Bool_t deactonfail=kFALSE)
Collect and analyze available input from socket s.
Definition TProof.cxx:3060
TProofMgr * GetManager()
Definition TProof.h:1037
void Add() override
Add signal handler to system signal handler list.
void Remove() override
Remove signal handler from system signal handler list.
Class describing a PROOF worker server.
Definition TSlave.h:46
const char * GetName() const override
Returns name of object.
Definition TSlave.h:124
TString fImage
Definition TSlave.h:80
TSocket * fSocket
Definition TSlave.h:89
TProof * fProof
Definition TSlave.h:90
ESlaveType fSlaveType
Definition TSlave.h:95
TString fUser
Definition TSlave.h:83
Int_t fPort
Definition TSlave.h:85
friend class TXSlave
Definition TSlave.h:51
Int_t GetPort() const
Definition TSlave.h:130
ESlaveType
Definition TSlave.h:55
@ kSlave
Definition TSlave.h:55
@ kMaster
Definition TSlave.h:55
TString fGroup
Definition TSlave.h:84
TString fWorkDir
Definition TSlave.h:82
TString fOrdinal
Definition TSlave.h:86
TFileHandler * fInput
Definition TSlave.h:91
static void SetTXSlaveHook(TSlave_t xslavehook)
Set hook to TXSlave ctor.
Definition TSlave.cxx:665
TString fProofWorkDir
Definition TSlave.h:81
Int_t fPerfIdx
Definition TSlave.h:87
Int_t fProtocol
Definition TSlave.h:88
TString fName
Definition TSlave.h:79
virtual Bool_t IsValid() const
Definition TSlave.h:150
const char * GetOrdinal() const
Definition TSlave.h:131
TString fMsd
Definition TSlave.h:98
virtual Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
Definition TSocket.cxx:1013
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
Definition TSocket.cxx:818
static Int_t GetClientProtocol()
Static method returning supported client protocol.
Definition TSocket.cxx:1469
Int_t GetRemoteProtocol() const
Definition TSocket.h:126
virtual void Close(Option_t *opt="")
Close the socket.
Definition TSocket.cxx:389
TInetAddress GetInetAddress() const
Definition TSocket.h:113
virtual Int_t RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Receive a raw buffer of specified length bytes.
Definition TSocket.cxx:898
virtual Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Send a raw buffer of specified length.
Definition TSocket.cxx:620
Int_t GetPort() const
Definition TSocket.h:115
virtual Bool_t IsValid() const
Definition TSocket.h:132
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
Definition TSocket.cxx:522
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:421
Int_t Atoi() const
Return integer value of string.
Definition TString.cxx:1966
const char * Data() const
Definition TString.h:380
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
Definition TString.cxx:1808
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition TString.cxx:924
Bool_t IsNull() const
Definition TString.h:418
TString & Remove(Ssiz_t pos)
Definition TString.h:685
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2334
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:651
virtual int GetServiceByName(const char *service)
Get port # of internet service.
Definition TSystem.cxx:2303
virtual void AddFileHandler(TFileHandler *fh)
Add a file handler to the list of system file handlers.
Definition TSystem.cxx:541
virtual const char * Getenv(const char *env)
Get environment variable.
Definition TSystem.cxx:1650
This class represents a WWW compatible URL.
Definition TUrl.h:33
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition TUrl.cxx:390
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
Definition TUrl.cxx:523
const char * GetPasswd() const
Definition TUrl.h:66
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
Definition TUrl.cxx:472
const char * GetOptions() const
Definition TUrl.h:71
const char * GetProtocol() const
Definition TUrl.h:64
void SetPort(Int_t port)
Definition TUrl.h:88
Int_t GetPort() const
Definition TUrl.h:78
TXSlaveInterruptHandler(TXSocket *s=0)
Definition TXSlave.cxx:80
Bool_t Notify()
TXSlave interrupt handler.
Definition TXSlave.cxx:88
This is the version of TSlave for workers servers based on XProofD.
Definition TXSlave.h:32
Int_t SetupServ(Int_t stype, const char *conffile) override
Init a PROOF slave object.
Definition TXSlave.cxx:333
void SetInterruptHandler(Bool_t on=kTRUE) override
Set/Unset the interrupt handler.
Definition TXSlave.cxx:680
Int_t Ping() override
Ping the remote master or slave servers.
Definition TXSlave.cxx:396
Int_t SendGroupPriority(const char *grp, Int_t priority) override
Communicate to the coordinator the priprity of the group to which the user belongs Return 0 on succes...
Definition TXSlave.cxx:550
void Close(Option_t *opt="") override
Close slave socket.
Definition TXSlave.cxx:382
void SetAlias(const char *alias) override
Set an alias for this session.
Definition TXSlave.cxx:535
void FlushSocket() override
Clean any input on the socket.
Definition TXSlave.cxx:698
TObjString * SendCoordinator(Int_t kind, const char *msg=0, Int_t int2=0) override
Send message to intermediate coordinator.
Definition TXSlave.cxx:525
Bool_t HandleError(const void *in=0) override
Handle error on the input socket.
Definition TXSlave.cxx:563
Int_t fNWrks
Definition TXSlave.h:39
static Int_t GetProofdProtocol(TSocket *s)
Find out the remote proofd protocol version.
Definition TXSlave.cxx:469
~TXSlave() override
Destroy slave.
Definition TXSlave.cxx:374
void StopProcess(Bool_t abort, Int_t timeout) override
Sent stop/abort request to PROOF server.
Definition TXSlave.cxx:456
Bool_t fValid
Definition TXSlave.h:38
void Touch() override
Touch the client admin file to proof we are alive.
Definition TXSlave.cxx:406
void Interrupt(Int_t type) override
Send interrupt to master or slave servers.
Definition TXSlave.cxx:418
TSignalHandler * fIntHandler
Definition TXSlave.h:40
Bool_t HandleInput(const void *in=0) override
Handle asynchronous input on the socket.
Definition TXSlave.cxx:636
void ParseBuffer()
Parse fBuffer after a connection attempt.
Definition TXSlave.cxx:302
void Init(const char *host, Int_t stype)
Init a PROOF slave object.
Definition TXSlave.cxx:132
void DoError(int level, const char *location, const char *fmt, va_list va) const override
Interface to ErrorHandler (protected).
Definition TXSlave.cxx:68
Int_t Flush(TSocket *s)
Remove any reference to socket 's' from the global pipe and ready-socket queue.
Input handler for XProofD sockets.
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'.
High level handler of connections to XProofD.
Definition TXSocket.h:59
static void SetLocation(const char *loc="")
Set location string.
Definition TXSocket.cxx:242
@ kStopProcess
Definition TXSocket.h:139
void SetInterrupt(Bool_t i=kTRUE)
static TXSockPipe fgPipe
Definition TXSocket.h:111
static const char * what
Definition stlLoader.cc:6
Int_t fOpt
Definition TXSocket.h:55
TMarker m
Definition textangle.C:8