25 #include "RConfigure.h" 50 const
char *workdir, const
char *msd,
Int_t)
51 : fImage(image), fProofWorkDir(workdir),
52 fWorkDir(workdir), fPort(-1),
53 fOrdinal(ord), fPerfIdx(perf),
54 fProtocol(0), fSocket(0), fProof(proof),
55 fInput(0), fBytesRead(0), fRealTime(0),
57 fParallel(0), fMsd(msd)
111 iam =
"Local Client";
114 Error(
"Init",
"Impossible PROOF <-> SlaveType Configuration Requested");
151 for (
TObject *o = next(); o != 0; o = next()) {
155 const char *p = def.
Data();
162 Info(
"Init",
"** NOT ** Sending kPROOF_SETENV RemoteProtocol : %d",
168 if (strcmp(buf,
"Okay")) {
188 Error(
"SetupServ",
"failed to receive slave startup message");
201 Error(
"SetupServ",
"failed to send local PROOF protocol");
207 Error(
"SetupServ",
"failed to receive remote PROOF protocol");
214 Error(
"SetupServ",
"incompatible PROOF versions (remote version" 228 Error(
"SetupServ",
"OldAuthSetup: failed to setup authentication");
242 Error(
"SetupServ",
"failed to send ordinal and config info");
297 nscc->GetProtocol() < 9) {
317 Error(
"Compare",
"input is not a TSlave object");
325 while (myord && otherord) {
326 Int_t myval = atoi(myord);
327 Int_t otherval = atoi(otherord);
328 if (myval < otherval)
return 1;
329 if (myval > otherval)
return -1;
330 myord = strchr(myord,
'.');
332 otherord = strchr(otherord,
'.');
333 if (otherord) otherord++;
335 if (myord)
return -1;
336 if (otherord)
return 1;
347 const char *sst[] = {
"invalid" ,
"valid",
"inactive" };
379 Printf(
" Security context:");
380 Printf(
" Proofd protocol version:");
386 Printf(
" MB's received:");
410 if (!oldAuthSetupHook) {
412 TString authlib =
"libRootAuth";
418 Error(
"OldAuthSetup",
"can't load %s",authlib.
Data());
422 Error(
"OldAuthSetup",
"can't locate %s",authlib.
Data());
431 Error(
"OldAuthSetup",
"can't find OldSlaveAuthSetup");
437 if (oldAuthSetupHook) {
440 Error(
"OldAuthSetup",
"hook to method OldSlaveAuthSetup is undefined");
451 const char *workdir,
const char *msd,
Int_t nwk)
456 if (!strcmp(url,
"lite")) {
457 return new TSlaveLite(ord, perf, image, proof, stype, workdir, msd);
477 TString proofxlib =
"libProofx";
482 ::
Error(
"TSlave::Create",
"can't load %s", proofxlib.
Data());
484 ::Error(
"TSlave::Create",
"can't locate %s", proofxlib.
Data());
489 s = (*fgTXSlaveHook)(url, ord, perf, image, proof, stype, workdir, msd, nwk);
491 s =
new TSlave(url, ord, perf, image, proof, stype, workdir, msd);
522 char oobc = (char) type;
523 const int kBufSize = 1024;
524 char waste[kBufSize];
534 int n, nch, nbytes = 0, nloop = 0;
555 if (nch > kBufSize) nch = kBufSize;
558 Error(
"Interrupt",
"error receiving waste from slave %s",
563 }
else if (n == -3) {
573 Error(
"Interrupt",
"error receiving OOB from server %s",
598 if (nch > kBufSize) nch = kBufSize;
601 Error(
"Interrupt",
"error receiving waste (2) from slave %s",
609 Info(
"Interrupt",
"slave %s:%s synchronized: %d bytes discarded",
612 Info(
"Interrupt",
"PROOF synchronized: %d bytes discarded", nbytes);
654 Info(
"SendCoordinator",
"method not implemented for this communication layer");
666 Info(
"SetAlias",
"method not implemented for this communication layer");
virtual const char * GetName() const
Returns name of object.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
UInt_t GetBytesRecv() const
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
Collectable string class.
const char * GetHostName() const
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
virtual Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
This class represents a WWW compatible URL.
virtual TObjString * SendCoordinator(Int_t kind, const char *msg=0, Int_t int2=0)
Send message to intermediate coordinator.
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
const char * GetProtocol() const
Float_t GetCpuTime() const
const char * GetROOTVersion() const
static const TList * GetEnvVars()
Get environemnt variables.
virtual void StopProcess(Bool_t abort, Int_t timeout)
Sent stop/abort request to PROOF server.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
const char * GetOrdinal() const
virtual void Add()
Add file event handler to system file handler list.
virtual void Print(Option_t *option="") const
Printf info about slave.
R__EXTERN TVirtualMutex * gROOTMutex
Option_t * GetOption() const
const char * GetName() const
Returns name of object.
R__EXTERN TApplication * gApplication
TString & Insert(Ssiz_t pos, const char *s)
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
static TSlave_t fgTXSlaveHook
const char * GetImage() const
virtual ~TSlave()
Destroy slave.
virtual Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Send a raw buffer of specified length.
Bool_t IsActive() const
Check remote OffSet and expiring Date.
virtual Bool_t IsValid() const
TList * GetSecContextCleanup() const
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
Int_t(* OldSlaveAuthSetup_t)(TSocket *, Bool_t, TString, TString)
The TNamed class is the base class for all named ROOT classes.
void Init(TClassEdit::TInterpreterLookupHelper *helper)
static void SetTXSlaveHook(TSlave_t xslavehook)
Set hook to TXSlave ctor.
Int_t Collect(const TSlave *sl, Long_t timeout=-1, Int_t endtype=-1, Bool_t deactonfail=kFALSE)
Collect responses from slave sl.
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 void Interrupt(Int_t type)
Send interrupt OOB byte to master or slave servers.
Int_t GetRemoteProtocol() const
virtual void Close(Option_t *opt="")
Close slave socket.
void Error(const char *location, const char *msgfmt,...)
const char * GetUser() const
const char * GetSessionTag() const
TSlave()
Default constructor used by derived classes.
R__EXTERN TSystem * gSystem
UInt_t GetBytesSent() const
virtual Int_t Ping()
Ping the remote master or slave servers.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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
const Int_t kPROOF_Protocol
virtual const char * AsString(TString &out)
Returns short string with relevant information about this security context.
Float_t GetRealTime() const
#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.
virtual void SetAlias(const char *alias)
Set an alias for this session.
virtual Func_t DynFindSymbol(const char *module, const char *entry)
Find specific entry point in specified library.
char * DynamicPathName(const char *lib, Bool_t quiet=kFALSE)
Find a dynamic library called lib using the system search paths.
void Init(const char *host, Int_t port, Int_t stype)
Init a PROOF slave object.
const char * GetWorkDir() const
virtual Bool_t IsAuthenticated() const
Mother of all ROOT objects.
const char * GetArchCompiler() const
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)
TSecContext * GetSecContext() const
void SetOptions(const char *opt)
const char * GetUser() const
Int_t OldAuthSetup(Bool_t master, TString wconf)
Setup authentication related stuff for old versions.
TInetAddress GetInetAddress() const
const Bool_t kIterBackward
virtual Int_t RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Receive a raw buffer of specified length bytes.
Long64_t GetBytesRead() const
virtual Int_t SetupServ(Int_t stype, const char *conffile)
Init a PROOF slave object.
Int_t Compare(const TObject *obj) const
Used to sort slaves by performance index.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual const char * GetTitle() const
Returns title of object.
const char * Data() const
void SetInputHandler(TFileHandler *ih)
Adopt and register input handler for this slave.