Logo ROOT   6.08/07
Reference Guide
TXSlave.h
Go to the documentation of this file.
1 // @(#)root/proofx:$Id$
2 // Author: G. Ganis Oct 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 #ifndef ROOT_TXSlave
13 #define ROOT_TXSlave
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TXSlave //
19 // //
20 // This is the version of TSlave for slave servers based on XRD. //
21 // See TSlave for details. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #ifndef ROOT_TSlave
26 #include "TSlave.h"
27 #endif
28 #ifndef ROOT_TXHandler
29 #include "TXHandler.h"
30 #endif
31 
32 class TObjString;
33 class TSocket;
34 class TSignalHandler;
35 
36 class TXSlave : public TSlave, public TXHandler {
37 
38 friend class TProof;
39 friend class TXProofMgr;
40 
41 private:
43  Int_t fNWrks; // Number of workers when submaster in remote plite
44  TSignalHandler *fIntHandler; //interrupt signal handler (ctrl-c)
45 
46  void Init(const char *host, Int_t stype);
47  void ParseBuffer();
48 
49  // Static methods
50  static Int_t GetProofdProtocol(TSocket *s);
51 
52 protected:
53  void FlushSocket();
54  void Interrupt(Int_t type);
55  Int_t Ping();
56  TObjString *SendCoordinator(Int_t kind, const char *msg = 0, Int_t int2 = 0);
57  Int_t SendGroupPriority(const char *grp, Int_t priority);
58  void SetAlias(const char *alias);
59  void StopProcess(Bool_t abort, Int_t timeout);
60 
61 public:
62  TXSlave(const char *url, const char *ord, Int_t perf,
63  const char *image, TProof *proof, Int_t stype,
64  const char *workdir, const char *msd, Int_t nwk = 1);
65  virtual ~TXSlave();
66 
67  void Close(Option_t *opt = "");
68  void DoError(int level, const char *location, const char *fmt,
69  va_list va) const;
70 
71  Bool_t HandleError(const void *in = 0); // Error Handler
72  Bool_t HandleInput(const void *in = 0); // Input handler
73 
74  void SetInterruptHandler(Bool_t on = kTRUE);
75 
76  Int_t SetupServ(Int_t stype, const char *conffile);
77 
78  void Touch();
79 
80  ClassDef(TXSlave,0) //Xrd PROOF slave server
81 };
82 
83 #endif
void StopProcess(Bool_t abort, Int_t timeout)
Sent stop/abort request to PROOF server.
Definition: TXSlave.cxx:455
static Int_t GetProofdProtocol(TSocket *s)
Find out the remote proofd protocol version.
Definition: TXSlave.cxx:468
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:549
Collectable string class.
Definition: TObjString.h:32
const char Option_t
Definition: RtypesCore.h:62
void ParseBuffer()
Parse fBuffer after a connection attempt.
Definition: TXSlave.cxx:303
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Int_t Ping()
Ping the remote master or slave servers.
Definition: TXSlave.cxx:397
Bool_t HandleError(const void *in=0)
Handle error on the input socket.
Definition: TXSlave.cxx:562
Int_t fNWrks
Definition: TXSlave.h:43
This is the version of TSlave for workers servers based on XProofD.
Definition: TXSlave.h:36
void Init(const char *host, Int_t stype)
Init a PROOF slave object.
Definition: TXSlave.cxx:133
virtual ~TXSlave()
Destroy slave.
Definition: TXSlave.cxx:375
#define ClassDef(name, id)
Definition: Rtypes.h:254
Int_t SetupServ(Int_t stype, const char *conffile)
Init a PROOF slave object.
Definition: TXSlave.cxx:334
TSignalHandler * fIntHandler
Definition: TXSlave.h:44
void SetInterruptHandler(Bool_t on=kTRUE)
Set/Unset the interrupt handler.
Definition: TXSlave.cxx:679
Handler of asynchronous events for XProofD sockets.
Definition: TXHandler.h:30
Bool_t HandleInput(const void *in=0)
Handle asynchronous input on the socket.
Definition: TXSlave.cxx:635
Implementation of the functionality provided by TProofMgr in the case of a xproofd-based session...
Definition: TXProofMgr.h:46
TObjString * SendCoordinator(Int_t kind, const char *msg=0, Int_t int2=0)
Send message to intermediate coordinator.
Definition: TXSlave.cxx:524
void Close(Option_t *opt="")
Close slave socket.
Definition: TXSlave.cxx:383
void FlushSocket()
Clean any input on the socket.
Definition: TXSlave.cxx:697
TXSlave(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)
Create a PROOF slave object. Called via the TProof ctor.
Definition: TXSlave.cxx:103
int type
Definition: TGX11.cxx:120
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition: TProof.h:346
Bool_t fValid
Definition: TXSlave.h:42
void Interrupt(Int_t type)
Send interrupt to master or slave servers.
Definition: TXSlave.cxx:419
void SetAlias(const char *alias)
Set an alias for this session.
Definition: TXSlave.cxx:534
Class describing a PROOF worker server.
Definition: TSlave.h:50
const Bool_t kTRUE
Definition: Rtypes.h:91
void DoError(int level, const char *location, const char *fmt, va_list va) const
Interface to ErrorHandler (protected).
Definition: TXSlave.cxx:69
void Touch()
Touch the client admin file to proof we are alive.
Definition: TXSlave.cxx:407