64 :
TNamed(
"",
""), fRemoteProtocol(-1), fServType(kXProofd),
65 fSessions(0), fIntHandler(0)
70 fUrl = (!url || strlen(url) <= 0) ?
TUrl(
"proof://localhost") :
TUrl(url);
84 Info(
"TProofMgr",
"service 'proofd' not found by GetServiceByName"
85 ": using default IANA assigned tcp port 1093");
89 Info(
"TProofMgr",
"port from GetServiceByName: %d", port);
116 gROOT->GetListOfProofs()->Remove(
this);
130 Info(
"AttachSession",
"invalid proofserv id (%d)",
id);
142 Warning(
"AttachSession",
"invalid description object - do nothing");
148 return d->GetProof();
150 Warning(
"AttachSession",
"session not available - do nothing");
163 Warning(
"DetachSession",
"invalid TProofMgr - do nothing");
172 d->GetProof()->Detach(opt);
179 }
else if (
id == 0) {
207 Warning(
"DetachSession",
"invalid TProofMgr - do nothing");
217 d->GetProof()->Detach(opt);
231 if (opt && !strncasecmp(opt,
"L",1))
242 if (
gROOT->GetListOfProofs()) {
248 while ((o = nxp())) {
258 ++ns,
p->GetSessionID(), st,
p);
272 if (!(
gROOT->GetListOfProofs()->FindObject(
d->GetProof()))) {
276 if (opt && !strncasecmp(opt,
"S",1))
297 Warning(
"SendMsgToUsers",
"functionality not supported");
309 Warning(
"Reset",
"functionality not supported");
355 if (
p ==
d->GetProof())
374 if (
p ==
d->GetProof()) {
388 const char *cfgdir,
Int_t loglevel)
397 if (
p &&
p->IsValid()) {
414 ns,
p->GetSessionID(), st,
p);
419 if (
gDebug > 0)
Error(
"CreateSession",
"PROOF session creation failed");
463 if (
gROOT->GetListOfProofs()) {
466 while ((o = nxp())) {
477 while ((o = nxp())) {
478 if (!(
gROOT->GetListOfProofs()->FindObject(o))) {
488 Printf(
"No managers found");
500 const char *alias,
Bool_t xpd)
509 if (
proto.IsNull()) {
514 if (
proto ==
"lite" || host ==
"__lite__" ) {
521 ::Info(
"TProofMgr::Create",
"'lite' not yet supported on Windows");
536 const char *url = u.
GetUrl();
544 if (
m->MatchUrl(url))
return m;
565 m = (
TProofMgr *) (*cm)(url, loglevel, alias);
567 trystd = (
m && !(
m->IsValid()) &&
m->IsProofd()) ?
kTRUE :
kFALSE;
580 if (
m->IsValid() && !(
m->IsProofd())) {
582 gROOT->GetListOfProofs()->Add(
m);
583 gROOT->GetListOfSockets()->Add(
m);
600 TString prooflib =
"libProofx";
605 ::Error(
"TProofMgr::GetXProofMgrCtor",
606 "can't load %s", prooflib.
Data());
608 ::Error(
"TProofMgr::GetXProofMgrCtor",
609 "can't locate %s", prooflib.
Data());
633 if (!url || (url && strlen(url) <= 0)) {
634 ::Error(
"TProofMgr::Ping",
"empty url - fail");
661 memset(&initHS, 0,
sizeof(initHS));
662 int len =
sizeof(initHS);
668 ::Info(
"TProofMgr::Ping",
"1st: wrong number of bytes sent: %d (expected: %d)",
677 ::Info(
"TProofMgr::Ping",
"1st: wrong number of bytes sent: %d (expected: %d)",
686 if ((writeCount = s.
SendRaw(&dum[0],
sizeof(dum))) !=
sizeof(dum)) {
688 ::Info(
"TProofMgr::Ping",
"2nd: wrong number of bytes sent: %d (expected: %d)",
689 writeCount, (
int)
sizeof(dum));
698 if (readCount !=
len) {
700 ::Info(
"TProofMgr::Ping",
"1st: wrong number of bytes read: %d (expected: %d)",
712 if (readCount !=
len) {
714 ::Info(
"TProofMgr::Ping",
"2nd: wrong number of bytes read: %d (expected: %d)",
723 }
else if (
type == 8) {
725 if (
gDebug > 0)
::Info(
"TProofMgr::Ping",
"server is old %s", (checkxrd ?
"ROOTD" :
"PROOFD"));
747 if (!fn || (fn && strlen(fn) <= 0))
return;
748 if (dirph.
GetSize() <= 0)
return;
754 while (dd.Tokenize(
d, from,
"/")) {
757 if (dirs.
GetSize() <= 0)
return;
768 "requested directory level '%s' is not available in the file path",
806 const char *mss,
const char *
dest)
811 if (!
src || (
src &&
src->GetSize() <= 0)) {
812 ::Warning(
"TProofMgr::UploadFiles",
"list is empty!");
815 if (!mss || (mss && strlen(mss) <= 0)) {
816 ::Warning(
"TProofMgr::UploadFiles",
"MSS is undefined!");
827 while (dst.Tokenize(dt, from,
"/")) {
853 while ((o = nxf())) {
855 if (!strcmp(o->
ClassName(),
"TFileInfo")) {
856 if (!(fi =
dynamic_cast<TFileInfo *
>(o))) {
858 "object of class name '%s' does not cast to %s - ignore",
863 }
else if (!strcmp(o->
ClassName(),
"TObjString")) {
866 "object of class name '%s' does not cast to %s - ignore",
873 "object of unsupported class '%s' found in list - ignore", o->
ClassName());
902 if (idx !=
kNPOS)
ex.Remove(0, idx+1);
951 ::Info(
"TProofMgr::UploadFiles",
"uploading '%s' to '%s'", furl->
GetUrl(), fdst.
Data());
956 ::Error(
"TProofMgr::UploadFiles",
"file %s was not copied", furl->
GetUrl());
994 const char *mss,
const char *
dest)
999 if (!srcfiles || (srcfiles && strlen(srcfiles) <= 0)) {
1000 ::Error(
"TProofMgr::UploadFiles",
"input text file or directory undefined!");
1003 if (!mss || (mss && strlen(mss) <= 0)) {
1004 ::Error(
"TProofMgr::UploadFiles",
"MSS is undefined!");
1013 ::Error(
"TProofMgr::UploadFiles",
1014 "could not get information about the input path '%s':"
1015 " make sure that it exists and is readable", srcfiles);
1027 f.open(inpath.
Data(), std::ifstream::out);
1030 line.ReadToDelim(
f);
1033 if (
line.BeginsWith(
"#"))
continue;
1039 ::Error(
"TProofMgr::UploadFiles",
"unable to open file '%s'", srcfiles);
1045 const char *ent = 0;
1047 if (!strcmp(ent,
".") || !strcmp(ent,
".."))
continue;
1048 line.Form(
"%s/%s", inpath.
Data(), ent);
1054 ::Error(
"TProofMgr::UploadFiles",
"unable to open directory '%s'", inpath.
Data());
1057 ::Error(
"TProofMgr::UploadFiles",
1058 "input path '%s' is neither a regular file nor a directory!", inpath.
Data());
1062 ::Warning(
"TProofMgr::UploadFiles",
"no files found in file or directory '%s'", inpath.
Data());
1078 Error(
"Rm",
"invalid TProofMgr - do nothing");
1083 Error(
"Rm",
"path undefined!");
1094 return (rc == 0) ? 0 : -1;
1108 const char *st[] = {
"unknown",
"idle",
"processing",
"shutting down"};
UShort_t host2net(UShort_t x)
UShort_t net2host(UShort_t x)
Int_t gErrorIgnoreLevel
Error handling routines.
constexpr Int_t kSysError
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
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 UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
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
TProofMgr *(* TProofMgr_t)(const char *, Int_t, const char *)
R__EXTERN TProof * gProof
R__EXTERN TVirtualMutex * gROOTMutex
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
Bool_t R_ISREG(Int_t mode)
Bool_t R_ISDIR(Int_t mode)
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD(mutex)
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Class that contains a list of TFileInfo's and accumulated meta data information about its entries.
Int_t Add(TFileInfo *info)
Add TFileInfo to the collection.
Class describing a generic file including meta information.
TUrl * GetFirstUrl() const
virtual Bool_t Cp(const char *dst, Bool_t progressbar=kTRUE, UInt_t buffersize=1000000)
Allows to copy this file to the dst URL.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
TObject * Remove(TObject *obj) override
Remove object from the list.
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
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.
virtual void SetName(const char *name)
Set the name of the TNamed.
Collectable string class.
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't want to leave purely abstract.
virtual const char * GetName() const
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * GetTitle() const
Returns title of object.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Named parameter, streamable and storable.
const char * GetName() const override
Returns name of object.
void SetVal(const AParamType &val)
const AParamType & GetVal() const
TProof * GetProof() const
void Print(Option_t *opt="") const override
Dump the content to the screen.
const char * GetUrl() const
Basic TProofMgr functionality implementation in the case of Lite session.
The PROOF manager interacts with the PROOF server coordinator to create or destroy a PROOF session,...
static TProofMgr_t GetXProofMgrHook()
Get the constructor hook fro TXProofMgr.
virtual void ShowWorkers()
Show available workers.
static void ReplaceSubdirs(const char *fn, TString &fdst, TList &dirph)
Parse file name extracting the directory subcomponents in dirs, stored as TObjStrings.
virtual Int_t Reset(Bool_t hard=kFALSE, const char *usr=0)
Send a cleanup request for the sessions associated with the current user.
virtual TList * QuerySessions(Option_t *opt="S")
Get list of sessions accessible to this manager.
static TProofMgr * Create(const char *url, Int_t loglevel=-1, const char *alias=0, Bool_t xpd=kTRUE)
Static method returning the appropriate TProofMgr object using the plugin manager.
static TList * GetListOfManagers()
Extract pointers to PROOF managers from TROOT::fProofs.
virtual Int_t SendMsgToUsers(const char *, const char *=0)
Send a message to connected users.
virtual Int_t Rm(const char *, const char *=0, const char *=0)
Run 'rm' on 'what'. Locally it is just a call to TSystem::Unlink .
TSignalHandler * fIntHandler
virtual TProof * CreateSession(const char *=0, const char *=0, Int_t=-1)
Create a new remote session (master and associated workers).
static Int_t Ping(const char *url, Bool_t checkxrd=kFALSE)
Non-blocking check for a PROOF (or Xrootd, if checkxrd) service at 'url' Return 0 if a XProofd (or Xr...
virtual Bool_t IsValid() const
static TList fgListOfManagers
static void SetTXProofMgrHook(TProofMgr_t pmh)
Set hook to TXProofMgr ctor.
~TProofMgr() override
Destroy a TProofMgr instance.
virtual void DetachSession(Int_t, Option_t *="")
Detach session with 'id' from its proofserv.
virtual void SetAlias(const char *alias="")
virtual TProof * AttachSession(Int_t, Bool_t=kFALSE)
Dummy version provided for completeness.
virtual Bool_t IsProofd() const
virtual TProofDesc * GetProofDesc(Int_t id)
Get TProofDesc instance corresponding to 'id'.
static TProofMgr_t fgTXProofMgrHook
virtual Bool_t MatchUrl(const char *url)
Checks if 'url' refers to the same user@host:port entity as the URL in memory.
virtual void DiscardSession(TProof *p)
Discard TProofDesc of session 'p' from the internal list.
static TFileCollection * UploadFiles(TList *src, const char *mss, const char *dest=0)
Upload files provided via the list 'src' (as TFileInfo or TObjString) to 'mss'.
This class controls a Parallel ROOT Facility, PROOF, cluster.
void Detach(Option_t *opt="")
Detach this instance to its proofserv.
const char * GetGroup() const
Regular expression class.
virtual Int_t RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Receive a raw buffer of specified length bytes.
virtual Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Send a raw buffer of specified length.
virtual Bool_t IsValid() const
Int_t Atoi() const
Return integer value of string.
const char * Data() const
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
TString & ReplaceAll(const TString &s1, const TString &s2)
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual int GetServiceByName(const char *service)
Get port # of internet service.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
virtual int Unlink(const char *name)
Unlink, i.e.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
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.
const char * GetFile() const
void SetUrl(const char *url, Bool_t defaultIsFile=kFALSE)
Parse url character string and split in its different subcomponents.
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
const char * GetUser() const
const char * GetHost() const
void SetOptions(const char *opt)
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
void SetHost(const char *host)
const char * GetProtocol() const
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.