45 fServType = kProofLite;
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");
135 isess = (isess < 0) ? -isess : isess;
150 if (strlen(
gEnv->
GetValue(
"ProofLite.Sandbox",
"")) > 0) {
152 }
else if (strlen(
gEnv->
GetValue(
"Proof.Sandbox",
"")) > 0) {
157 sandbox.Insert(0, sb.
Data());
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)) {
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());
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";
273 if (pl && retrieve) {
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!");
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.
This class starts a PROOF session on the local machine: no daemons, client and master merged...
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.
The PROOF manager interacts with the PROOF server coordinator to create or destroy a PROOF session...
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.
Basic TProofMgr functionality implementation in the case of Lite session.
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.
This class controls a Parallel ROOT Facility, PROOF, cluster.
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
Implementation of the PROOF session log handler.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.