4 #include "KVGELogReader.h"
20 KVLogReader::ReadLine(line, ok);
24 if (
line.Contains(
"Cputime limit exceeded")) {
30 else if (
line.Contains(
"Filesize limit exceeded")) {
36 else if (
line.Contains(
"File size limit exceeded")) {
42 else if (
line.Contains(
"Job received KILL signal")) {
46 else if (
line.BeginsWith(
"* Requested")) {
50 else if (
line.BeginsWith(
"* Consumed")) {
54 else if (
line.BeginsWith(
"* CPU time:")) {
57 else if (
line.Contains(
"CpuUser ="))
59 else if (fInConsumed &&
line.BeginsWith(
"* vmem:"))
61 else if (fStatus !=
"KILLED" &&
line.BeginsWith(
"* Exit status:"))
63 else if (
line.Contains(
"Jobname:"))
65 else if (
line.Contains(
"DISK_REQ") ||
line.Contains(
"MEM_REQ"))
75 void KVGELogReader::ReadKVCPU(
const KVString& line)
83 if (token ==
"CpuUser") {
84 fCPUused =
line.Next().Atof();
86 else if (token ==
"VirtMem") {
87 fMemKB =
line.Next().Atof();
88 fMemKB *= GetByteMultiplier(
line.Next());
90 else if (token ==
"DiskUsed") {
91 fScratchKB = ReadStorage(
line.Next());
103 void KVGELogReader::ReadCPU(
const KVString& line)
113 if (fInRequested) fCPUreq =
line.Next().Atoi();
114 else if (fInConsumed) fCPUused =
line.Next().Atoi();
123 void KVGELogReader::ReadScratchUsed(
const KVString&)
136 void KVGELogReader::ReadMemUsed(
const KVString& line)
141 if (
line.GetNValues(
":(") < 3) {
156 fMemKB = mem_use * GetByteMultiplier(vmem.
Next());
170 static Int_t MB = 2 << 9;
171 static Int_t GB = 2 << 19;
187 void KVGELogReader::ReadStatus(
const KVString& line)
201 fStatus =
line.Next(kTRUE);
202 fOK = (fStatus ==
"0");
218 static KVString units[] = {
"K",
"M",
"G" };
220 while ((index = stor.
Index(units[i])) < 0 && i < 2)
230 return (STOR.Atof() * GetByteMultiplier(u));
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Read GE (Grid Engine) log files to extract status of batch jobs.
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
Int_t GetNValues(TString delim) const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const