![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
|
| logger = Logging.logging.getLogger("PowhegControl") |
|
◆ __multicore_multistage()
def python.algorithms.generators.multicore.__multicore_multistage |
( |
|
process, |
|
|
|
generation_fn |
|
) |
| |
|
private |
Run Powheg V2/RES generation in multi-core mode.
- Parameters
-
process | PowhegBox process. |
generation_fn | Function that can be called without argument to generate events. |
- Author
- James Robinson james.nosp@m..rob.nosp@m.inson.nosp@m.@cer.nosp@m.n.ch
Definition at line 52 of file multicore.py.
53 """! Run Powheg V2/RES generation in multi-core mode.
55 @param process PowhegBox process.
56 @param generation_fn Function that can be called without argument to generate events.
58 @author James Robinson <james.robinson@cern.ch>
60 shutil.rmtree(
"multistage_inputs", ignore_errors=
True)
61 os.mkdir(
"multistage_inputs")
62 shutil.copy(
"pwgseeds.dat",
"multistage_inputs/pwgseeds.dat")
64 if(process.executable !=
"pwhg_semileptonic" ):
65 if process.stage_is_completed(1):
66 logger.info(
"=> Skipping multi-core generation (V2/RES): stage 1 <=")
68 process.modify_parameter(stage = 1)
70 if process.stage_is_completed(2):
71 logger.info(
"=> Skipping multi-core generation (V2/RES): stage 2 <=")
73 process.modify_parameter(stage = 2)
75 if process.stage_is_completed(3):
76 logger.info(
"=> Skipping multi-core generation (V2/RES): stage 3 <=")
78 process.modify_parameter(stage = 3)
81 process.modify_parameter(stage = 3)
84 process.modify_parameter(stage = 4)
87 @
timed(
"multi-core generation (V2/RES): stage 1)")
◆ __multicore_multistage_stage_1()
def python.algorithms.generators.multicore.__multicore_multistage_stage_1 |
( |
|
generation_fn, |
|
|
|
n_xgrid_iterations |
|
) |
| |
|
private |
Run Powheg V2/RES (stage 1) generation in multi-core mode.
- Parameters
-
generation_fn | Function that can be called without argument to generate events. |
n_xgrid_iterations | Number of xgrid iterations to perform. |
- Author
- James Robinson james.nosp@m..rob.nosp@m.inson.nosp@m.@cer.nosp@m.n.ch
Definition at line 88 of file multicore.py.
89 """! Run Powheg V2/RES (stage 1) generation in multi-core mode.
91 @param generation_fn Function that can be called without argument to generate events.
92 @param n_xgrid_iterations Number of xgrid iterations to perform.
94 @author James Robinson <james.robinson@cern.ch>
96 FileParser(
"powheg.input").text_replace(
"parallelstage.*",
"parallelstage 1")
98 for xgrid_iteration
in range(1, n_xgrid_iterations + 1):
99 FileParser(
"powheg.input").text_replace(
"xgriditeration.*",
"xgriditeration {}".
format(xgrid_iteration))
100 shutil.copy(
"powheg.input",
"multistage_inputs/powheg.input.parallelstage{ps}.xgriditeration{xgi}".
format(ps=1, xgi=xgrid_iteration))
103 @
timed(
"multi-core generation (V2/RES): stage 2)")
◆ __multicore_multistage_stage_2()
def python.algorithms.generators.multicore.__multicore_multistage_stage_2 |
( |
|
generation_fn | ) |
|
|
private |
Run Powheg V2/RES (stage 2) generation in multi-core mode.
- Parameters
-
generation_fn | Function that can be called without argument to generate events. |
- Author
- James Robinson james.nosp@m..rob.nosp@m.inson.nosp@m.@cer.nosp@m.n.ch
Definition at line 104 of file multicore.py.
105 """! Run Powheg V2/RES (stage 2) generation in multi-core mode.
107 @param generation_fn Function that can be called without argument to generate events.
109 @author James Robinson <james.robinson@cern.ch>
111 FileParser(
"powheg.input").text_replace(
"parallelstage.*",
"parallelstage 2")
112 shutil.copy(
"powheg.input",
"multistage_inputs/powheg.input.parallelstage{ps}".
format(ps=2))
115 @
timed(
"multi-core generation (V2/RES): stage 3)")
◆ __multicore_multistage_stage_3()
def python.algorithms.generators.multicore.__multicore_multistage_stage_3 |
( |
|
generation_fn | ) |
|
|
private |
Run Powheg V2/RES (stage 3) generation in multi-core mode.
- Parameters
-
generation_fn | Function that can be called without argument to generate events. |
- Author
- James Robinson james.nosp@m..rob.nosp@m.inson.nosp@m.@cer.nosp@m.n.ch
Definition at line 116 of file multicore.py.
117 """! Run Powheg V2/RES (stage 3) generation in multi-core mode.
119 @param generation_fn Function that can be called without argument to generate events.
121 @author James Robinson <james.robinson@cern.ch>
123 FileParser(
"powheg.input").text_replace(
"parallelstage.*",
"parallelstage 3")
124 shutil.copy(
"powheg.input",
"multistage_inputs/powheg.input.parallelstage{ps}".
format(ps=3))
127 @
timed(
"multi-core generation (V2/RES): stage 4)")
◆ __multicore_multistage_stage_4()
def python.algorithms.generators.multicore.__multicore_multistage_stage_4 |
( |
|
generation_fn | ) |
|
|
private |
Run Powheg V2/RES (stage 4) generation in multi-core mode.
- Parameters
-
generation_fn | Function that can be called without argument to generate events. |
- Author
- James Robinson james.nosp@m..rob.nosp@m.inson.nosp@m.@cer.nosp@m.n.ch
Definition at line 128 of file multicore.py.
129 """! Run Powheg V2/RES (stage 4) generation in multi-core mode.
131 @param generation_fn Function that can be called without argument to generate events.
133 @author James Robinson <james.robinson@cern.ch>
135 FileParser(
"powheg.input").text_replace(
"parallelstage.*",
"parallelstage 4")
136 shutil.copy(
"powheg.input",
"multistage_inputs/powheg.input.parallelstage{ps}".
format(ps=4))
◆ __multicore_v1()
def python.algorithms.generators.multicore.__multicore_v1 |
( |
|
generation_fn | ) |
|
|
private |
Run Powheg V1 generation in multi-core mode.
- Parameters
-
generation_fn | Function that can be called without argument to generate events. |
- Author
- James Robinson james.nosp@m..rob.nosp@m.inson.nosp@m.@cer.nosp@m.n.ch
Definition at line 42 of file multicore.py.
43 """! Run Powheg V1 generation in multi-core mode.
45 @param generation_fn Function that can be called without argument to generate events.
47 @author James Robinson <james.robinson@cern.ch>
51 @
timed(
"multi-core generation (V2/RES)")
◆ multicore()
def python.algorithms.generators.multicore.multicore |
( |
|
process | ) |
|
Run multiple Powheg processes, each in its own thread.
- Parameters
-
process | PowhegBox process. |
- Author
- James Robinson james.nosp@m..rob.nosp@m.inson.nosp@m.@cer.nosp@m.n.ch
Definition at line 14 of file multicore.py.
15 """! Run multiple Powheg processes, each in its own thread.
17 @param process PowhegBox process.
19 @author James Robinson <james.robinson@cern.ch>
22 logger.info(
"Running in multicore mode with {} subjobs".
format(process.cores))
23 with open(
"pwgseeds.dat",
"w")
as random_seed_list:
24 for idx
in range(process.cores):
25 random_seed_list.write(
str(process.random_seed +
int(idx * 1e6)) +
"\n")
28 FileParser(
"powheg.input").text_remove(
"^iseed")
29 logger.debug(
"Disabling iseed variable when multiple seeds are used")
32 generation_fn = partial(multicore_untimed, process)
34 if process.powheg_version ==
"V1":
36 elif process.powheg_version ==
"V2" or process.powheg_version ==
"RES":
39 raise ValueError(
"Powheg version {} is not supported for multicore running!".
format(process.powheg_version))
41 @
timed(
"multi-core generation (V1)")
◆ multicore_untimed()
def python.algorithms.generators.multicore.multicore_untimed |
( |
|
process | ) |
|
Run multiple Powheg processes, each in its own thread.
- Parameters
-
process | PowhegBox process. |
- Author
- James Robinson james.nosp@m..rob.nosp@m.inson.nosp@m.@cer.nosp@m.n.ch
Definition at line 139 of file multicore.py.
140 """! Run multiple Powheg processes, each in its own thread.
142 @param process PowhegBox process.
144 @author James Robinson <james.robinson@cern.ch>
146 if not os.path.isfile(process.executable):
147 raise OSError(
"Powheg executable {} not found!".
format(process.executable))
148 threads = [SingleProcessThread(process.executable, seed_index=idx,
149 warning_output=(process.warning_output
if hasattr(process,
"warning_output")
else None),
150 info_output=(process.info_output
if hasattr(process,
"info_output")
else None),
151 error_output=(process.error_output
if hasattr(process,
"error_output")
else None))
for idx
in range(1, process.cores + 1)]
152 manager = ProcessManager(threads)
153 while manager.monitor():
◆ logger
python.algorithms.generators.multicore.logger = Logging.logging.getLogger("PowhegControl") |
def timed(name)
Decorator to output function execution time.
def __multicore_multistage_stage_4(generation_fn)
Run Powheg V2/RES (stage 4) generation in multi-core mode.
def multicore(process)
Run multiple Powheg processes, each in its own thread.
def __multicore_multistage_stage_1(generation_fn, n_xgrid_iterations)
Run Powheg V2/RES (stage 1) generation in multi-core mode.
def __multicore_multistage(process, generation_fn)
Run Powheg V2/RES generation in multi-core mode.
def __multicore_multistage_stage_2(generation_fn)
Run Powheg V2/RES (stage 2) generation in multi-core mode.
def multicore_untimed(process)
Run multiple Powheg processes, each in its own thread.
def __multicore_v1(generation_fn)
Run Powheg V1 generation in multi-core mode.
def __multicore_multistage_stage_3(generation_fn)
Run Powheg V2/RES (stage 3) generation in multi-core mode.