46 fServType = kProofLite;
53 const char *,
Int_t loglevel)
56 if (!
c.Contains(
"workers=") && cfg && strstr(cfg,
"workers="))
c = cfg;
58 if (nwrk == 0)
return (
TProof *)0;
104 Error(
"CreateSession",
"creating PROOF session");
136 isess = (isess < 0) ? -isess : isess;
151 if (strlen(
gEnv->
GetValue(
"ProofLite.Sandbox",
"")) > 0) {
153 }
else if (strlen(
gEnv->
GetValue(
"Proof.Sandbox",
"")) > 0) {
158 sandbox.Insert(0, sb.
Data());
164 sessiondir.
Form(
"%s/session-%s", sandbox.Data(), tag.
Data());
166 Error(
"GetSessionLogs",
"information for session '%s' not available", tag.
Data());
176 if (!strncmp(e,
"session-", 8)) {
190 if (isess > olddirs->
GetSize() - 1) {
192 "session index out of range (%d): take oldest available session", isess);
193 isess = olddirs->
GetSize() - 1;
205 Error(
"GetSessionLogs",
"cannot locate session dir for index '%d' under '%s':"
206 " cannot continue!", isess, sandbox.Data());
217 Info(
"GetSessionLogs",
"analysing session dir %s", sessiondir.
Data());
238 }
else if (ord.
Contains(
".valgrind")) {
248 url =
Form(
"%s/%s", sessiondir.
Data(), e);
253 Info(
"GetSessionLogs",
"ord: %s, url: %s", ord.
Data(), url.
Data());
261 while ((n = (
TNamed *) nxl())) {
263 if (ord ==
"0.-1") ord =
"0";
274 if (pl && retrieve) {
275 const char *pat = pattern ? pattern :
"-v \"| SvcMsg\"";
276 if (pat && strlen(pat) > 0)
292 if (!fin || strlen(fin) <= 0) {
293 Error(
"ReadBuffer",
"undefined path!");
301 Error(
"ReadBuffer",
"problems opening file %s", fn.
Data());
306 off_t start = 0, end = lseek(fd, (off_t) 0, SEEK_END);
309 if (ofs > 0 && ofs < end) {
310 start = lseek(fd, (off_t) ofs, SEEK_SET);
312 start = lseek(fd, (off_t) 0, SEEK_SET);
314 if (len > (end - start + 1) || len <= 0)
315 len = end - start + 1;
318 const Int_t kMAXBUF = 32768;
321 Int_t wanted = (left > kMAXBUF - 1) ? kMAXBUF - 1 : left;
327 Error(
"ReadBuffer",
"error reading file %s", fn.
Data());
330 }
else if (len > 0) {
339 wanted = (left > kMAXBUF - 1) ? kMAXBUF - 1 : left;
341 }
while (len > 0 && left > 0);
357 if (!pattern || strlen(pattern) <= 0)
360 if (!fin || strlen(fin) <= 0) {
361 Error(
"ReadBuffer",
"undefined path!");
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual const char * GetTitle() const
Returns title of object.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
double read(const std::string &file_name)
reading
Ssiz_t Last(char c) const
Find last occurrence of a character c.
ClassImp(TProofMgrLite) TProofMgrLite
Create a PROOF manager for the Lite environment.
virtual const char * WorkingDirectory()
Return working directory.
Collectable string class.
This class represents a WWW compatible URL.
TString & ReplaceAll(const TString &s1, const TString &s2)
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)
Read a line from stream upto newline skipping any whitespace.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
const char *const kPROOF_WorkDir
virtual const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
Regular expression class.
const char * GetOptions() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
static void retrieve(const gsl_integration_workspace *workspace, double *a, double *b, double *r, double *e)
TString & Insert(Ssiz_t pos, const char *s)
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
static Int_t GetErrno()
Static function returning system error number.
const char * Data() const
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
The TNamed class is the base class for all named ROOT classes.
A sorted doubly linked list.
TString & Append(const char *cs)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TObjString * ReadBuffer(const char *file, Long64_t ofs, Int_t len)
Read 'len' bytes from offset 'ofs' of the local file 'fin'.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
R__EXTERN TSystem * gSystem
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
char * Form(const char *fmt,...)
virtual const char * GetName() const
Returns name of object.
TSubString Strip(EStripType s=kTrailing, char c= ' ') const
Return a substring of self stripped at beginning and/or end.
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
static Int_t GetNumberOfWorkers(const char *url=0)
Static method to determine the number of workers giving priority to users request.
virtual void FreeDirectory(void *dirp)
Free a directory.
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.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
TString & Remove(Ssiz_t pos)
R__EXTERN TProof * gProof
virtual Int_t GetSize() const
TProof * CreateSession(const char *=0, const char *=0, Int_t=-1)
Create a new session.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void Add(TObject *obj)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Int_t GetSessionID() const
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
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 ~.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * GetFile() const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.