23#include "RConfigure.h"
47 const char *workdir,
const char *msd,
Int_t)
108 iam =
"Local Client";
111 Error(
"Init",
"Impossible PROOF <-> SlaveType Configuration Requested");
139 Info(
"Init",
"%s: fUser is .... %s", iam.
Data(),
fUser.Data());
142 if (
fSocket->GetRemoteProtocol() >= 14 ) {
148 for (
TObject *o = next(); o != 0; o = next()) {
152 const char *p = def.
Data();
159 Info(
"Init",
"** NOT ** Sending kPROOF_SETENV RemoteProtocol : %d",
164 fSocket->Recv(buf,
sizeof(buf));
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");
281 if (!(
fProof->IsMaster()) && !strncasecmp(opt,
"S",1)) {
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" };
360 Printf(
" Security context: %s",
fSocket->GetSecContext()->AsString(sc));
361 Printf(
" Proofd protocol version: %d",
fSocket->GetRemoteProtocol());
366 Printf(
" MB's sent: %.2f",
float(
fSocket->GetBytesRecv())/(1024*1024));
367 Printf(
" MB's received: %.2f",
float(
fSocket->GetBytesSent())/(1024*1024));
376 Printf(
" Security context:");
377 Printf(
" Proofd protocol version:");
383 Printf(
" MB's received:");
407 if (!oldAuthSetupHook) {
409 TString authlib =
"libRootAuth";
414 if (
gSystem->Load(authlib) == -1) {
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";
473 if (
gSystem->Load(proofxlib) == -1)
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);
499 if (
fSocket->Send(mess) == -1) {
514 char oobc = (char)
type;
515 const int kBufSize = 1024;
516 char waste[kBufSize];
526 int n, nch, nbytes = 0, nloop = 0;
529 while ((
n =
fSocket->RecvRaw(&oob_byte, 1,
kOob)) < 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);
634 if (
fProof->fProtocol > 9)
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
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
const Int_t kPROOF_Protocol
externTVirtualMutex * 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,...)
Formats a string in a circular formatting buffer.
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD(mutex)
const char * GetHostName() const
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Collectable string class.
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.
TObject()
TObject constructor.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
static const TList * GetEnvVars()
Get environemnt variables.
Int_t GetProtocol() const
Bool_t IsActive() const
Check remote OffSet and expiring Date.
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",...
TList * GetSecContextCleanup() const
Class describing a PROOF worker server.
const char * GetName() const override
Returns name of object.
virtual void SetAlias(const char *alias)
Set an alias for this session.
const char * GetWorkDir() const
Float_t GetRealTime() const
static TSlave_t fgTXSlaveHook
const char * GetImage() const
Int_t Compare(const TObject *obj) const override
Used to sort slaves by performance index.
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.
void Print(Option_t *option="") const override
Printf info about slave.
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.
~TSlave() override
Destroy slave.
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 Close(Option_t *opt="")
Close slave socket.
This class implements client sockets.
TInetAddress GetInetAddress() const
static TSocket * CreateAuthSocket(const char *user, const char *host, Int_t port, Int_t size=0, Int_t tcpwindowsize=-1, TSocket *s=nullptr, Int_t *err=nullptr)
Creates a socket or a parallel socket and authenticates to the remote server specified in 'url' on re...
const char * Data() const
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.