ATLAS Offline Software
singlecore.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2 
3 from ...decorators import timed
4 from ...utility import ProcessManager, SingleProcessThread
5 import os
6 
7 
8 @timed("single-core generation")
9 def singlecore(process):
10  """! Run a single Powheg process in its own timed thread.
11 
12  @param process PowhegBox process.
13 
14  @author James Robinson <james.robinson@cern.ch>
15  """
16  singlecore_untimed(process)
17 
18 
19 def singlecore_untimed(process):
20  """! Run a single Powheg process in its own thread.
21 
22  @param process PowhegBox process.
23 
24  @author James Robinson <james.robinson@cern.ch>
25  """
26  if not os.path.isfile(process.executable):
27  raise OSError("Powheg executable {} not found!".format(process.executable))
28  threads = [SingleProcessThread(process.executable,
29  warning_output=(process.warning_output if hasattr(process,"warning_output") else None),
30  info_output=(process.info_output if hasattr(process,"info_output") else None),
31  error_output=(process.error_output if hasattr(process,"error_output") else None))]
32  manager = ProcessManager(threads)
33  while manager.monitor():
34  pass
python.algorithms.generators.singlecore.singlecore
def singlecore(process)
Run a single Powheg process in its own timed thread.
Definition: singlecore.py:9
python.decorators.timed.timed
def timed(name)
Decorator to output function execution time.
Definition: timed.py:12
vtune_athena.format
format
Definition: vtune_athena.py:14
python.algorithms.generators.singlecore.singlecore_untimed
def singlecore_untimed(process)
Run a single Powheg process in its own thread.
Definition: singlecore.py:19