4 #include "KVLogReader.h"
7 #include "TObjString.h"
31 fCPUused = fCPUreq = fSCRreq = fMEMreq = fScratchKB = fMemKB = 0;
34 fGotRequests = kFALSE;
49 ifstream filestream(fname);
50 if (!filestream.good()) {
51 cout <<
"Error in KVLogReader::ReadFile - cannot open file " << fname
56 line.ReadLine(filestream);
58 while (filestream.good() && ok) {
60 line.ReadLine(filestream);
83 if (line.Contains(
"egmentation")) {
88 else if (line.Contains(
"Temps limite atteint")) {
91 fStatus =
"VEDA Fortran out of time";
94 else if (line.Contains(
"rfcp : Input/output error")) {
97 fStatus =
"rfcp error";
100 else if (line.Contains(
"TXNetFile") && line.Contains(
"open attempt failed")) {
103 fStatus =
"XROOTD error";
116 return (fCPUreq ? fCPUused / fCPUreq : 0.);
133 Double_t size = ReadStorage(stor);
134 if (type ==
"DISK_REQ")
136 else if (type ==
"MEM_REQ")
140 if (fSCRreq && fMEMreq) fGotRequests = kTRUE;
153 unique_ptr<TObjArray> toks(line.Tokenize(
"*: "));
154 fJobname = ((TObjString*) toks->At(1))->GetString();
166 sscanf(fJobname.Data(), fFMT.Data(), &run);
192 (!Killed() && !SegFault())
197 || (fStatus ==
"VEDA Fortran out of time")
198 || (fStatus.BeginsWith(
"rfcp"))
Base class for reading batch log files at CC-IN2P3.
virtual void ReadLine(const KVString &line, Bool_t &)
void ReadStorageReq(const KVString &line)
void ReadJobname(const KVString &line)
Double_t GetCPUratio() const
calculate ratio of used CPU to requested CPU
void ReadFile(const Char_t *fname)
Open file 'fname' and read contents.
virtual void Reset()
reset informations read from file
virtual Bool_t Incomplete() const
Int_t GetRunNumber() const
try to get run number from jobname using format string fFMT
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const