23 #include "RConfigure.h" 48 const char *workdir,
const char *msd,
Int_t)
49 : fImage(image), fProofWorkDir(workdir),
50 fWorkDir(workdir), fPort(-1),
51 fOrdinal(ord), fPerfIdx(perf),
52 fProtocol(0), fSocket(0), fProof(proof),
53 fInput(0), fBytesRead(0), fRealTime(0),
55 fParallel(0), fMsd(msd)
109 iam =
"Local Client";
112 Error(
"Init",
"Impossible PROOF <-> SlaveType Configuration Requested");
149 for (
TObject *o = next(); o != 0; o = next()) {
153 const char *p = def.
Data();
160 Info(
"Init",
"** NOT ** Sending kPROOF_SETENV RemoteProtocol : %d",
166 if (strcmp(buf,
"Okay")) {
186 Error(
"SetupServ",
"failed to receive slave startup message");
199 Error(
"SetupServ",
"failed to send local PROOF protocol");
205 Error(
"SetupServ",
"failed to receive remote PROOF protocol");
212 Error(
"SetupServ",
"incompatible PROOF versions (remote version" 226 Error(
"SetupServ",
"OldAuthSetup: failed to setup authentication");
240 Error(
"SetupServ",
"failed to send ordinal and config info");
295 nscc->GetProtocol() < 9) {
315 Error(
"Compare",
"input is not a TSlave object");
323 while (myord && otherord) {
324 Int_t myval = atoi(myord);
325 Int_t otherval = atoi(otherord);
326 if (myval < otherval)
return 1;
327 if (myval > otherval)
return -1;
328 myord = strchr(myord,
'.');
330 otherord = strchr(otherord,
'.');
331 if (otherord) otherord++;
333 if (myord)
return -1;
334 if (otherord)
return 1;
345 const char *sst[] = {
"invalid" ,
"valid",
"inactive" };
377 Printf(
" Security context:");
378 Printf(
" Proofd protocol version:");
384 Printf(
" MB's received:");
408 if (!oldAuthSetupHook) {
410 TString authlib =
"libRootAuth";
416 Error(
"OldAuthSetup",
"can't load %s",authlib.
Data());
420 Error(
"OldAuthSetup",
"can't locate %s",authlib.
Data());
429 Error(
"OldAuthSetup",
"can't find OldSlaveAuthSetup");
435 if (oldAuthSetupHook) {
438 Error(
"OldAuthSetup",
"hook to method OldSlaveAuthSetup is undefined");
449 const char *workdir,
const char *msd,
Int_t nwk)
454 if (!strcmp(url,
"lite")) {
455 return new TSlaveLite(ord, perf, image, proof, stype, workdir, msd);
475 TString proofxlib =
"libProofx";
480 ::
Error(
"TSlave::Create",
"can't load %s", proofxlib.
Data());
482 ::Error(
"TSlave::Create",
"can't locate %s", proofxlib.
Data());
487 s = (*fgTXSlaveHook)(url, ord, perf, image, proof, stype, workdir, msd, nwk);
489 s =
new TSlave(url, ord, perf, image, proof, stype, workdir, msd);
520 char oobc = (char) type;
521 const int kBufSize = 1024;
522 char waste[kBufSize];
532 int n, nch, nbytes = 0, nloop = 0;
553 if (nch > kBufSize) nch = kBufSize;
556 Error(
"Interrupt",
"error receiving waste from slave %s",
561 }
else if (n == -3) {
571 Error(
"Interrupt",
"error receiving OOB from server %s",
596 if (nch > kBufSize) nch = kBufSize;
599 Error(
"Interrupt",
"error receiving waste (2) from slave %s",
607 Info(
"Interrupt",
"slave %s:%s synchronized: %d bytes discarded",
610 Info(
"Interrupt",
"PROOF synchronized: %d bytes discarded", nbytes);
652 Info(
"SendCoordinator",
"method not implemented for this communication layer");
664 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.
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.
This class controls a Parallel ROOT Facility, PROOF, cluster.
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
Class describing a PROOF worker server.
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.