52 const char *,
Int_t loglevel)
55 if (!
c.Contains(
"workers=") && cfg && strstr(cfg,
"workers="))
c = cfg;
57 if (nwrk == 0)
return (
TProof *)0;
62 if (nwrk > 0 &&
gProof->GetParallel() != nwrk) {
78 if (strlen(
fUrl.GetOptions()) > 0) u.
Form(
"lite/?%s",
fUrl.GetOptions());
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) {
151 sandbox.
Insert(0,
gEnv->GetValue(
"ProofLite.Sandbox",
""));
152 }
else if (strlen(
gEnv->GetValue(
"Proof.Sandbox",
"")) > 0) {
153 sandbox.
Insert(0,
gEnv->GetValue(
"Proof.Sandbox",
""));
159 gSystem->ExpandPathName(sandbox);
163 sessiondir.
Form(
"%s/session-%s", sandbox.
Data(), tag.
Data());
165 Error(
"GetSessionLogs",
"information for session '%s' not available", tag.
Data());
171 void *dirp =
gSystem->OpenDirectory(sandbox);
174 while ((
e =
gSystem->GetDirEntry(dirp))) {
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());
208 sessiondir =
n->GetTitle();
209 tag =
gSystem->BaseName(sessiondir);
216 Info(
"GetSessionLogs",
"analysing session dir %s", sessiondir.
Data());
221 void *dirp =
gSystem->OpenDirectory(sessiondir);
225 while ((
e =
gSystem->GetDirEntry(dirp))) {
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)
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
const char *const kPROOF_WorkDir
R__EXTERN TProof * gProof
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
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.
TObject * Remove(TObject *obj) override
Remove object from the list.
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
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.
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.
TObjString * ReadBuffer(const char *file, Long64_t ofs, Int_t len) override
Read 'len' bytes from offset 'ofs' of the local file 'fin'.
TProofLog * GetSessionLogs(Int_t ridx=0, const char *stag=0, const char *pattern="-v | SvcMsg", Bool_t rescan=kFALSE) override
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) override
Create a new session.
TProofMgr(const TProofMgr &)
This class controls a Parallel ROOT Facility, PROOF, cluster.
Int_t GetSessionID() const
Regular expression class.
A sorted doubly linked list.
void Add(TObject *obj) override
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.
static Int_t GetErrno()
Static function returning system error number.
This class represents a WWW compatible URL.
const char * GetFile() const