ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
Herwig7Utils.ProcessHandler Class Reference

Class for handling parallel local multi-processing. More...

Collaboration diagram for Herwig7Utils.ProcessHandler:

Public Member Functions

def __init__ (self, process_list, logger)
 
def success (self)
 

Public Attributes

 processes
 
 n_initial
 
 logger
 

Detailed Description

Class for handling parallel local multi-processing.

Provides management functionality for waiting for a set of subprocesses to terminate and catch success/failure

Definition at line 46 of file Herwig7Utils.py.

Constructor & Destructor Documentation

◆ __init__()

def Herwig7Utils.ProcessHandler.__init__ (   self,
  process_list,
  logger 
)

Definition at line 48 of file Herwig7Utils.py.

48  def __init__(self, process_list, logger):
49  self.processes = process_list
50  self.n_initial = len(process_list)
51  self.logger = logger
52 

Member Function Documentation

◆ success()

def Herwig7Utils.ProcessHandler.success (   self)

Definition at line 53 of file Herwig7Utils.py.

53  def success(self):
54  result = True
55  while len(self.processes) > 0:
56  for ID, process in enumerate(self.processes):
57  returncode = process.poll()
58  if returncode is not None:
59 
60 
61  self.processes.remove(process)
62  if returncode == 0:
63  athMsgLog.info(ansi_format_info('Process #{} finished sucessfully, {}/{} still running'.format(process.ID, len(self.processes), self.n_initial)))
64  elif returncode > 0:
65  athMsgLog.error(ansi_format_error("Process #{} finished with error code {} (please check logfile '{}'), {}/{} still running".format(process.ID, returncode, process.logfile_title, len(self.processes), self.n_initial)))
66  result = False
67  elif returncode < 0:
68  athMsgLog.error(ansi_format_error("Process #{} was terminated by signal {} (please check logfile '{}'), {}/{} still running".format(process.ID, -returncode, process.logfile_title, len(self.processes), self.n_initial)))
69  result = False
70 
71 
75  athMsgLog.info("Content of integration log file '%s':", process.logfile_title)
76  athMsgLog.info("")
77  with open(process.logfile_title, 'r') as logfile:
78  for line in logfile:
79  athMsgLog.info(' %s', line.rstrip('\n'))
80  athMsgLog.info("")
81  # self.logger.info('================================================================================')
82  # self.logger.info("End of integration log file '{}'".format(process.logfile_title))
83  # self.logger.info('================================================================================')
84 
85  return(result)
86 
87 

Member Data Documentation

◆ logger

Herwig7Utils.ProcessHandler.logger

Definition at line 51 of file Herwig7Utils.py.

◆ n_initial

Herwig7Utils.ProcessHandler.n_initial

Definition at line 50 of file Herwig7Utils.py.

◆ processes

Herwig7Utils.ProcessHandler.processes

Definition at line 49 of file Herwig7Utils.py.


The documentation for this class was generated from the following file:
vtune_athena.format
format
Definition: vtune_athena.py:14
Herwig7Utils.ansi_format_error
def ansi_format_error(text)
Red colouring.
Definition: Herwig7Utils.py:270
PixelModuleFeMask_create_db.remove
string remove
Definition: PixelModuleFeMask_create_db.py:83
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
Herwig7Utils.ansi_format_info
def ansi_format_info(text)
Blue colouring.
Definition: Herwig7Utils.py:262