ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.TaskManager.JobAnalyzer Class Reference
Collaboration diagram for python.TaskManager.JobAnalyzer:

Public Member Functions

def __init__ (self, jobDir, dsName, taskName)
 
def jobList (self)
 
def jobStatus (self, jobName)
 

Public Attributes

 jobDir
 
 dsName
 
 taskName
 
 path
 

Detailed Description

JobAnalyzer is a class for analyzing the jobs of a given task.

Definition at line 672 of file TaskManager.py.

Constructor & Destructor Documentation

◆ __init__()

def python.TaskManager.JobAnalyzer.__init__ (   self,
  jobDir,
  dsName,
  taskName 
)

Definition at line 675 of file TaskManager.py.

675  def __init__(self,jobDir,dsName,taskName):
676  self.jobDir = jobDir
677  self.dsName = dsName
678  self.taskName = taskName
679  self.path = jobDir+'/'+dsName+'/'+taskName
680  #self.maxWallTime = 5*86400 # max time job should be running in s
681 
682 

Member Function Documentation

◆ jobList()

def python.TaskManager.JobAnalyzer.jobList (   self)

Definition at line 683 of file TaskManager.py.

683  def jobList(self):
684  try:
685  l = os.listdir(self.path)
686  except Exception:
687  l = []
688  return l
689 
690 

◆ jobStatus()

def python.TaskManager.JobAnalyzer.jobStatus (   self,
  jobName 
)

Definition at line 691 of file TaskManager.py.

691  def jobStatus(self,jobName):
692  status = TaskManager.StatusCodes['UNKNOWN']
693  exitcode = ''
694  p = self.path+'/'+jobName
695  if os.path.exists(p):
696  if glob.glob(p+'/*.config.py'):
697  status = TaskManager.StatusCodes['CONFIGURED']
698  if glob.glob(p+'/*.SUBMITTED'):
699  status = TaskManager.StatusCodes['SUBMITTED']
700  # Protect against jobs dying w/o updating time stamp files - must be
701  # accompanied by similar protection in TaskAnalyzer
702  #r = glob.glob(p+'/*.RUNNING'):
703  #if r:
704  # status = TaskManager.StatusCodes['RUNNING']
705  # if len(r)==1 && (time.time()-os.path.getctime(r[0]))>self.maxWallTime:
706  # status = TaskManager.StatusCodes['FAILED']
707  if glob.glob(p+'/*.RUNNING'):
708  status = TaskManager.StatusCodes['RUNNING']
709  if glob.glob(p+'/*.POSTPROCESSING'):
710  status = TaskManager.StatusCodes['POSTPROCESSING']
711  if glob.glob(p+'/*.COMPLETED'):
712  status = TaskManager.StatusCodes['COMPLETED']
713  # Check if job completed w/o producing an exit status
714  if len(glob.glob(p+'/*.exit.0'))==0:
715  status = TaskManager.StatusCodes['FAILED']
716  try:
717  exitcode = open(glob.glob(p+'/*.exitstatus.dat')[0]).read()
718  except Exception:
719  pass
720  if len(glob.glob(p+'/*.exit.*'))>len(glob.glob(p+'/*.exit.0')):
721  status = TaskManager.StatusCodes['FAILED']
722  return (status,exitcode)
723 
724 
725 #
726 # Test code for modules
727 #

Member Data Documentation

◆ dsName

python.TaskManager.JobAnalyzer.dsName

Definition at line 677 of file TaskManager.py.

◆ jobDir

python.TaskManager.JobAnalyzer.jobDir

Definition at line 676 of file TaskManager.py.

◆ path

python.TaskManager.JobAnalyzer.path

Definition at line 679 of file TaskManager.py.

◆ taskName

python.TaskManager.JobAnalyzer.taskName

Definition at line 678 of file TaskManager.py.


The documentation for this class was generated from the following file:
read
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
Definition: openCoraCool.cxx:569
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Trk::open
@ open
Definition: BinningType.h:40