Public Member Functions | Public Attributes | List of all members
BatchLog.BatchLog Class Reference

Public Member Functions

def __init__ (self, log_files)
 
def log_status (self)
 
def err_status (self)
 
def run_time (self)
 

Public Attributes

 files
 
 cmd
 
 log
 
 err
 
 out
 

Detailed Description

Definition at line 3 of file BatchLog.py.

Constructor & Destructor Documentation

def BatchLog.BatchLog.__init__ (   self,
  log_files 
)

Definition at line 5 of file BatchLog.py.

5  def __init__(self, log_files):
6  self.files = log_files
7  self.cmd = False
8  self.log = False
9  self.err = False
10  self.out = False
11  # print log_files
12  for log in self.files:
13  suffix = log[-3:]
14  # print log, suffix
15  if suffix == "cmd": self.cmd = open(log,"r").readlines()
16  if suffix == "log": self.log = open(log,"r").readlines()
17  if suffix == "err": self.err = open(log,"r").readlines()
18  if suffix == "out": self.out = open(log,"r").readlines()
19 
def __init__(self, log_files)
Definition: BatchLog.py:5
procfile open("FD_BRL_v0.txt")

Member Function Documentation

def BatchLog.BatchLog.err_status (   self)

Definition at line 28 of file BatchLog.py.

References BatchLog.BatchLog.err, and tf::Pt.err.

28  def err_status(self):
29  if (not self.err): return "no batch err"
30  for line in self.err:
31  if line.strip() == "": continue
32  # filter out benign problems
33  # batch system
34  if line.split()[0] in ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]: continue
35  # root
36  if line.split()[0] in ["Warning", "Info"]: continue
37  if line.split("::")[0] in ["TClass"]: continue
38  # IFDH
39  if line.split()[0] in ["IFDH_DEBUG=0","depth=0","depth=1","depth=2","verify","Try","Warning:","which"]: continue
40  if "......................" in line.split()[0]: continue
41  if "Xrd:" in line: continue
42  # this is an error
43  return "error: %s"%line.strip()
44  return "no error"
45 
def err_status(self)
Definition: BatchLog.py:28
def BatchLog.BatchLog.log_status (   self)

Definition at line 20 of file BatchLog.py.

References BatchLog.BatchLog.log.

20  def log_status(self):
21  if (not self.log): return "no batch log"
22  for line in self.log:
23  if ("SYSTEM_PERIODIC_REMOVE" in line): return "SYSTEM_PERIODIC_REMOVE"
24  if ("Abnormal termination" in line): return "Abnormal termination"
25  if ("Normal termination" in line): return "completed"
26  return "running"
27 
def log_status(self)
Definition: BatchLog.py:20
def BatchLog.BatchLog.run_time (   self)

Definition at line 46 of file BatchLog.py.

References BatchLog.BatchLog.out, split(), and submit_syst.str.

46  def run_time(self):
47  if (not self.out): return ""
48  start_time = False
49  if "BEGIN EXECUTION" in self.out[1]:
50  start_time = " ".join(self.out[1].split(" ")[:6])
51 
52  end_time = False
53  if "COMPLETED" in self.out[-1]:
54  end_time = " ".join(self.out[-1].split(" ")[:6])
55 
56  if (not start_time) or (not end_time):
57  return "unknown"
58 
59  # Mon Feb 22 02:49:53 CST 2016
60  parser_string = "%a %b %d %H:%M:%S %Z %Y"
61  d_t = str(datetime.strptime(end_time, parser_string) - datetime.strptime(start_time, parser_string))
62 
63  return d_t
void split(double tt, double *fr)
def run_time(self)
Definition: BatchLog.py:46

Member Data Documentation

BatchLog.BatchLog.cmd

Definition at line 7 of file BatchLog.py.

BatchLog.BatchLog.err

Definition at line 9 of file BatchLog.py.

Referenced by BatchLog.BatchLog.err_status().

BatchLog.BatchLog.files

Definition at line 6 of file BatchLog.py.

BatchLog.BatchLog.log
BatchLog.BatchLog.out

Definition at line 10 of file BatchLog.py.

Referenced by BatchLog.BatchLog.run_time().


The documentation for this class was generated from the following file: