52 const char *,
Int_t loglevel)
55 if (!
c.Contains(
"workers=") && cfg && strstr(cfg,
"workers="))
c = cfg;
57 if (nwrk == 0)
return (
TProof *)0;
103 Error(
"CreateSession",
"creating PROOF session");
130 const char *pattern,
Bool_t)
135 isess = (isess < 0) ? -isess : isess;
150 if (strlen(
gEnv->
GetValue(
"ProofLite.Sandbox",
"")) > 0) {
152 }
else if (strlen(
gEnv->
GetValue(
"Proof.Sandbox",
"")) > 0) {
163 sessiondir.
Form(
"%s/session-%s", sandbox.
Data(), tag.
Data());
165 Error(
"GetSessionLogs",
"information for session '%s' not available", tag.
Data());
175 if (!strncmp(
e,
"session-", 8)) {
178 if (i !=
kNPOS)
d.Remove(i);
180 if (i !=
kNPOS)
d.Remove(0,i+1);
189 if (isess > olddirs->
GetSize() - 1) {
191 "session index out of range (%d): take oldest available session", isess);
192 isess = olddirs->
GetSize() - 1;
204 Error(
"GetSessionLogs",
"cannot locate session dir for index '%d' under '%s':"
205 " cannot continue!", isess, sandbox.
Data());
208 sessiondir =
n->GetTitle();
216 Info(
"GetSessionLogs",
"analysing session dir %s", sessiondir.
Data());
237 }
else if (ord.
Contains(
".valgrind")) {
247 url =
Form(
"%s/%s", sessiondir.
Data(),
e);
252 Info(
"GetSessionLogs",
"ord: %s, url: %s", ord.
Data(), url.
Data());
260 while ((
n = (
TNamed *) nxl())) {
262 if (ord ==
"0.-1") ord =
"0";
264 pl->
Add(ord,
n->GetTitle());
274 const char *pat = pattern ? pattern :
"-v \"| SvcMsg\"";
275 if (pat && strlen(pat) > 0)
291 if (!fin || strlen(fin) <= 0) {
292 Error(
"ReadBuffer",
"undefined path!");
300 Error(
"ReadBuffer",
"problems opening file %s", fn.
Data());
305 off_t start = 0, end = lseek(fd, (off_t) 0, SEEK_END);
308 if (ofs > 0 && ofs < end) {
309 start = lseek(fd, (off_t) ofs, SEEK_SET);
311 start = lseek(fd, (off_t) 0, SEEK_SET);
313 if (len > (end - start + 1) || len <= 0)
314 len = end - start + 1;
317 const Int_t kMAXBUF = 32768;
320 Int_t wanted = (left > kMAXBUF - 1) ? kMAXBUF - 1 : left;
326 Error(
"ReadBuffer",
"error reading file %s", fn.
Data());
329 }
else if (len > 0) {
338 wanted = (left > kMAXBUF - 1) ? kMAXBUF - 1 : left;
340 }
while (len > 0 && left > 0);
356 if (!pattern || strlen(pattern) <= 0)
359 if (!fin || strlen(fin) <= 0) {
360 Error(
"ReadBuffer",
"undefined path!");
395 (!excl &&
line.Index(re) ==
kNPOS))
continue;
398 if (!
line.EndsWith(
"\n"))
line.Append(
'\n');
static void retrieve(const gsl_integration_workspace *workspace, double *a, double *b, double *r, double *e)
const char *const kPROOF_WorkDir
R__EXTERN TProof * gProof
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
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.
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
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.
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 starts a PROOF session on the local machine: no daemons, client and master merged,...
static Int_t GetNumberOfWorkers(const char *url=0)
Static method to determine the number of workers giving priority to users request.
Implementation of the PROOF session log handler.
TProofLogElem * Add(const char *ord, const char *url)
Add new entry to the list of elements.
Int_t Retrieve(const char *ord="*", TProofLog::ERetrieveOpt opt=TProofLog::kTrailing, const char *fname=0, const char *pattern=0)
Retrieve the content of the log file associated with worker 'ord'.
Basic TProofMgr functionality implementation in the case of Lite session.
TProofLog * GetSessionLogs(Int_t ridx=0, const char *stag=0, const char *pattern="-v | SvcMsg", Bool_t rescan=kFALSE)
Get logs or log tails from last session associated with this manager instance.
TProofMgrLite(const char *url, Int_t loglevel=-1, const char *alias="")
Create a PROOF manager for the Lite environment.
TProof * CreateSession(const char *=0, const char *=0, Int_t=-1)
Create a new session.
TObjString * ReadBuffer(const char *file, Long64_t ofs, Int_t len)
Read 'len' bytes from offset 'ofs' of the local file 'fin'.
The PROOF manager interacts with the PROOF server coordinator to create or destroy a PROOF session,...
This class controls a Parallel ROOT Facility, PROOF, cluster.
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
Int_t GetSessionID() const
Regular expression class.
A sorted doubly linked list.
void Add(TObject *obj)
Add object in sorted list.
TString & Insert(Ssiz_t pos, const char *s)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
TString & Remove(Ssiz_t pos)
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
static void ResetErrno()
Static function resetting system error number.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
static Int_t GetErrno()
Static function returning system error number.
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 const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
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 const char * WorkingDirectory()
Return working directory.
This class represents a WWW compatible URL.
const char * GetFile() const
const char * GetOptions() const
static constexpr double ns