23#include "RConfigure.h"
47 const char *workdir,
const char *msd,
Int_t)
48 : fImage(image), fProofWorkDir(workdir),
49 fWorkDir(workdir), fPort(-1),
50 fOrdinal(ord), fPerfIdx(perf),
51 fProtocol(0), fSocket(0), fProof(proof),
52 fInput(0), fBytesRead(0), fRealTime(0),
54 fParallel(0), fMsd(msd)
108 iam =
"Local Client";
111 Error(
"Init",
"Impossible PROOF <-> SlaveType Configuration Requested");
148 for (
TObject *o = next(); o != 0; o = next()) {
152 const char *p = def.
Data();
159 Info(
"Init",
"** NOT ** Sending kPROOF_SETENV RemoteProtocol : %d",
165 if (strcmp(buf,
"Okay")) {
185 Error(
"SetupServ",
"failed to receive slave startup message");
198 Error(
"SetupServ",
"failed to send local PROOF protocol");
204 Error(
"SetupServ",
"failed to receive remote PROOF protocol");
211 Error(
"SetupServ",
"incompatible PROOF versions (remote version"
225 Error(
"SetupServ",
"OldAuthSetup: failed to setup authentication");
239 Error(
"SetupServ",
"failed to send ordinal and config info");
314 Error(
"Compare",
"input is not a TSlave object");
322 while (myord && otherord) {
323 Int_t myval = atoi(myord);
324 Int_t otherval = atoi(otherord);
325 if (myval < otherval)
return 1;
326 if (myval > otherval)
return -1;
327 myord = strchr(myord,
'.');
329 otherord = strchr(otherord,
'.');
330 if (otherord) otherord++;
332 if (myord)
return -1;
333 if (otherord)
return 1;
344 const char *sst[] = {
"invalid" ,
"valid",
"inactive" };
376 Printf(
" Security context:");
377 Printf(
" Proofd protocol version:");
383 Printf(
" MB's received:");
407 if (!oldAuthSetupHook) {
409 TString authlib =
"libRootAuth";
415 Error(
"OldAuthSetup",
"can't load %s",authlib.
Data());
419 Error(
"OldAuthSetup",
"can't locate %s",authlib.
Data());
428 Error(
"OldAuthSetup",
"can't find OldSlaveAuthSetup");
443 const char *workdir,
const char *msd,
Int_t nwk)
448 if (!strcmp(url,
"lite")) {
449 return new TSlaveLite(ord, perf, image, proof, stype, workdir, msd);
469 TString proofxlib =
"libProofx";
474 ::Error(
"TSlave::Create",
"can't load %s", proofxlib.
Data());
476 ::Error(
"TSlave::Create",
"can't locate %s", proofxlib.
Data());
481 s = (*fgTXSlaveHook)(url, ord, perf, image, proof, stype, workdir, msd, nwk);
483 s =
new TSlave(url, ord, perf, image, proof, stype, workdir, msd);
514 char oobc = (char)
type;
515 const int kBufSize = 1024;
516 char waste[kBufSize];
526 int n, nch, nbytes = 0, nloop = 0;
547 if (nch > kBufSize) nch = kBufSize;
550 Error(
"Interrupt",
"error receiving waste from slave %s",
555 }
else if (
n == -3) {
565 Error(
"Interrupt",
"error receiving OOB from server %s",
590 if (nch > kBufSize) nch = kBufSize;
593 Error(
"Interrupt",
"error receiving waste (2) from slave %s",
601 Info(
"Interrupt",
"slave %s:%s synchronized: %d bytes discarded",
604 Info(
"Interrupt",
"PROOF synchronized: %d bytes discarded", nbytes);
646 Info(
"SendCoordinator",
"method not implemented for this communication layer");
658 Info(
"SetAlias",
"method not implemented for this communication layer");
R__EXTERN TApplication * gApplication
const Bool_t kIterBackward
const Int_t kPROOF_Protocol
R__EXTERN TVirtualMutex * gROOTMutex
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)
Int_t(* OldSlaveAuthSetup_t)(TSocket *, Bool_t, TString, TString)
char * Form(const char *fmt,...)
void Printf(const char *fmt,...)
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD(mutex)
virtual void Add()
Add file event handler to system file handler list.
const char * GetHostName() const
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Collectable string class.
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
This class controls a Parallel ROOT Facility, PROOF, cluster.
Int_t Collect(const TSlave *sl, Long_t timeout=-1, Int_t endtype=-1, Bool_t deactonfail=kFALSE)
Collect responses from slave sl.
static const TList * GetEnvVars()
Get environemnt variables.
Int_t GetProtocol() const
Bool_t IsActive() const
Check remote OffSet and expiring Date.
const char * GetUser() const
virtual void DeActivate(Option_t *opt="CR")
Set OffSet to -1 and expiring Date to default Remove from the list If Opt contains "C" or "c",...
virtual const char * AsString(TString &out)
Returns short string with relevant information about this security context.
TList * GetSecContextCleanup() const
Class describing a PROOF worker server.
virtual void SetAlias(const char *alias)
Set an alias for this session.
virtual ~TSlave()
Destroy slave.
const char * GetWorkDir() const
Float_t GetRealTime() const
static TSlave_t fgTXSlaveHook
const char * GetImage() const
TSlave()
Default constructor used by derived classes.
Long64_t GetBytesRead() const
const char * GetGroup() const
virtual void StopProcess(Bool_t abort, Int_t timeout)
Sent stop/abort request to PROOF server.
const char * GetUser() const
void Init(const char *host, Int_t port, Int_t stype)
Init a PROOF slave object.
static void SetTXSlaveHook(TSlave_t xslavehook)
Set hook to TXSlave ctor.
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.
const char * GetSessionTag() const
void SetInputHandler(TFileHandler *ih)
Adopt and register input handler for this slave.
virtual void Interrupt(Int_t type)
Send interrupt OOB byte to master or slave servers.
Int_t Compare(const TObject *obj) const
Used to sort slaves by performance index.
const char * GetArchCompiler() const
virtual Int_t SetupServ(Int_t stype, const char *conffile)
Init a PROOF slave object.
virtual Int_t Ping()
Ping the remote master or slave servers.
virtual TObjString * SendCoordinator(Int_t kind, const char *msg=0, Int_t int2=0)
Send message to intermediate coordinator.
const char * GetName() const
Returns name of object.
const char * GetROOTVersion() const
Float_t GetCpuTime() const
virtual Bool_t IsValid() const
Int_t OldAuthSetup(Bool_t master, TString wconf)
Setup authentication related stuff for old versions.
const char * GetOrdinal() const
virtual void Print(Option_t *option="") const
Printf info about slave.
virtual void Close(Option_t *opt="")
Close slave socket.
Option_t * GetOption() const
virtual Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
UInt_t GetBytesRecv() const
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
Int_t GetRemoteProtocol() const
UInt_t GetBytesSent() const
TInetAddress GetInetAddress() const
virtual Int_t RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Receive a raw buffer of specified length bytes.
TSecContext * GetSecContext() const
virtual Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Send a raw buffer of specified length.
static TSocket * CreateAuthSocket(const char *user, const char *host, Int_t port, Int_t size=0, Int_t tcpwindowsize=-1, TSocket *s=0, Int_t *err=0)
Creates a socket or a parallel socket and authenticates to the remote server specified in 'url' on re...
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
virtual Bool_t IsAuthenticated() const
const char * Data() const
virtual Func_t DynFindSymbol(const char *module, const char *entry)
Find specific entry point in specified library.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
char * DynamicPathName(const char *lib, Bool_t quiet=kFALSE)
Find a dynamic library called lib using the system search paths.
This class represents a WWW compatible URL.
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
void SetOptions(const char *opt)
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
const char * GetProtocol() const