ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Generators
PowhegControl
python
algorithms
generators
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.utility.process_handling.ProcessManager
Wrapper to handle multiple Powheg subprocesses.
Definition
process_handling.py:12
python.utility.process_handling.SingleProcessThread
Single executable running in a subprocess (usually PowhegBox).
Definition
process_handling.py:41
python.algorithms.generators.singlecore.singlecore_untimed
singlecore_untimed(process)
Run a single Powheg process in its own thread.
Definition
singlecore.py:19
Generated on
for ATLAS Offline Software by
1.17.0