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

Public Member Functions

def __init__ (self, jobDir, dsName, taskName)
 
def isOnDisk (self)
 
def analyzeFiles (self)
 
def updateStatus (self, taskman)
 

Public Attributes

 jobDir
 
 dsName
 
 taskName
 
 path
 
 status
 
 onDisk
 
 nResultFiles
 
 nJobs
 
 nJobsSubmitted
 
 nJobsRunning
 
 nJobsPostProc
 
 nJobsFailed
 
 nJobsCompleted
 

Detailed Description

TaskAnalyzer is a class for analyzing the files of a given task.

Definition at line 607 of file TaskManager.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 610 of file TaskManager.py.

610  def __init__(self,jobDir,dsName,taskName):
611  self.jobDir = jobDir
612  self.dsName = dsName
613  self.taskName = taskName
614  self.path = jobDir+'/'+dsName+'/'+taskName
615 
616  self.status = TaskManager.StatusCodes['UNKNOWN']
617  self.onDisk = TaskManager.OnDiskCodes['UNKNOWN']
618  self.nResultFiles = 0
619  self.nJobs = 0
620  self.nJobsSubmitted = 0
621  self.nJobsRunning = 0
622  self.nJobsPostProc = 0
623  self.nJobsFailed = 0
624  self.nJobsCompleted = 0
625 
626 

Member Function Documentation

◆ analyzeFiles()

def python.TaskManager.TaskAnalyzer.analyzeFiles (   self)

Definition at line 635 of file TaskManager.py.

635  def analyzeFiles(self):
636  onDisk = self.isOnDisk()
637  if onDisk:
638  self.nJobs = len(glob.glob(self.path+'/*/*.config.py'))
639  self.nResultFiles = len(glob.glob(self.path+'/*')) - self.nJobs
640  self.nJobsSubmitted = len(glob.glob(self.path+'/*/*.SUBMITTED'))
641  self.nJobsRunning = len(glob.glob(self.path+'/*/*.RUNNING'))
642  self.nJobsPostProc = len(glob.glob(self.path+'/*/*.POSTPROCESSING'))
643  self.nJobsCompleted = len(glob.glob(self.path+'/*/*.COMPLETED'))
644  self.nJobsFailed = self.nJobsCompleted - len(glob.glob(self.path+'/*/*.exit.0'))
645 
646  self.status = TaskManager.StatusCodes['UNKNOWN']
647  if self.nJobs>0:
648  self.status = TaskManager.StatusCodes['CONFIGURED']
649  if self.nJobs==self.nJobsCompleted:
650  self.status = TaskManager.StatusCodes['COMPLETED']
651 
652  if self.nJobsSubmitted>0:
653  self.status = TaskManager.StatusCodes['SUBMITTED']
654  if self.nJobsRunning>0:
655  self.status = TaskManager.StatusCodes['RUNNING']
656  if self.nJobsPostProc>0:
657  self.status = TaskManager.StatusCodes['POSTPROCESSING']
658  if self.nJobsFailed>0:
659  if self.nJobsSubmitted>0 or self.nJobsRunning>0 or self.nJobsPostProc>0:
660  self.status = TaskManager.StatusCodes['PARTIALFAILED']
661  else:
662  self.status = TaskManager.StatusCodes['FAILED']
663 
664  return onDisk
665 
666 

◆ isOnDisk()

def python.TaskManager.TaskAnalyzer.isOnDisk (   self)
Check if task directories are still on disk.

Definition at line 627 of file TaskManager.py.

627  def isOnDisk(self):
628  """Check if task directories are still on disk."""
629  onDisk = os.path.exists(self.path)
630  if not onDisk:
631  self.onDisk = TaskManager.OnDiskCodes['DELETED']
632  return onDisk
633 
634 

◆ updateStatus()

def python.TaskManager.TaskAnalyzer.updateStatus (   self,
  taskman 
)

Definition at line 667 of file TaskManager.py.

667  def updateStatus(self,taskman):
668  taskman.updateStatus(self.dsName,self.taskName,
669  self.status,self.nResultFiles,
670  self.nJobs,self.nJobsSubmitted,self.nJobsRunning,self.nJobsPostProc,self.nJobsFailed,self.nJobsCompleted)
671 
672 
673 

Member Data Documentation

◆ dsName

python.TaskManager.TaskAnalyzer.dsName

Definition at line 612 of file TaskManager.py.

◆ jobDir

python.TaskManager.TaskAnalyzer.jobDir

Definition at line 611 of file TaskManager.py.

◆ nJobs

python.TaskManager.TaskAnalyzer.nJobs

Definition at line 619 of file TaskManager.py.

◆ nJobsCompleted

python.TaskManager.TaskAnalyzer.nJobsCompleted

Definition at line 624 of file TaskManager.py.

◆ nJobsFailed

python.TaskManager.TaskAnalyzer.nJobsFailed

Definition at line 623 of file TaskManager.py.

◆ nJobsPostProc

python.TaskManager.TaskAnalyzer.nJobsPostProc

Definition at line 622 of file TaskManager.py.

◆ nJobsRunning

python.TaskManager.TaskAnalyzer.nJobsRunning

Definition at line 621 of file TaskManager.py.

◆ nJobsSubmitted

python.TaskManager.TaskAnalyzer.nJobsSubmitted

Definition at line 620 of file TaskManager.py.

◆ nResultFiles

python.TaskManager.TaskAnalyzer.nResultFiles

Definition at line 618 of file TaskManager.py.

◆ onDisk

python.TaskManager.TaskAnalyzer.onDisk

Definition at line 617 of file TaskManager.py.

◆ path

python.TaskManager.TaskAnalyzer.path

Definition at line 614 of file TaskManager.py.

◆ status

python.TaskManager.TaskAnalyzer.status

Definition at line 616 of file TaskManager.py.

◆ taskName

python.TaskManager.TaskAnalyzer.taskName

Definition at line 613 of file TaskManager.py.


The documentation for this class was generated from the following file:
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18