Event generation within Herwig is generically separated into a phase
of building an event generator object starting from an input file, a
warm-up phase (or grid adaption) of the hard subprocess integrator and
the actual event generation step. In previous Herwig releases,
the first steps could not be separated and have been referred to as
the read step, while the last phase is called the run step. With the
new capabilities of Herwig to handle more complicated
processes at leading or next-to-leading order, we have made these
steps more flexible, providing parallelization as far as possible for
an efficient workflow. Please note that functionality beyond the
standard event generation is applicable only when using the
GeneralSampler integration framework, which is the default for all
*-Matchbox.in input files.

Especially in the presence of external amplitude libraries to be
compiled, as well as for processes with a large number of jets at NLO,
building the event generator object can be time consuming. In order to
prevent excessive build steps, when only parameters need to be
changed, or, when a parallel integration of the hard subprocesses is
desirable, Herwig 7.0 allows to separate the read step into a
build step dedicated to setting up the event generator, and an
integrate step, which can both be parallelized and allows for
changing parameters of the event generation such as scale choices,
generation cuts etc. Similar to the read step, the build steps
expect an input file to be read, e.g.:

HerwigbuildLHC-Matchbox.in

After this, a .run file has been created, but subprocess
integration has been postponed to the next step, which can then be run
via:

HerwigintegrateLHC-Matchbox.run

Notice that this step is expecting a ready .run file. After this
step, event generation proceeds through the run command as
discussed above. We will introduce changing parameters and parallel
integration as the main motivation for this separation below.

Parameters for event generators which have been prepared in a
build step can be modified in the integrate and run steps
by passing additional input file statements, contained in a so-called
setup file, to Herwig:

Here, parameters.in is an input file containing the desired
parameter changes with respect to those made in the input file from
which the event generator has been build. If the parameter changes
contained in the setup file will not affect the hard subprocess
(e.g. changing hadronization parameters), or are expected to not
change hard cross sections dramatically, then passing the
--setupfile argument to the run command is sufficient.

Herwig is then able to generate events using the run command, as
before. Note that if a --setupfile argument has been passed to
the integrate command, then the same argument has to be provided
to when running in order to determine the right
subgrids to be merged. See Higgs Production in Vector Boson Fusion using VBFNLO
for a concrete example how to use parallel subprocess integration.

When the subprocess integration has been split into several jobs, their
results have to be merged before event generation. This is done
automatically the first time the run step is executed, so in general
no special user action is needed. When submitting several run-step
jobs in parallel, it can be useful to perform the grid merging manually
beforehand.
This is done by running

HerwigmergegridsLHC-Matchbox.run

Again, if a --setupfile argument has been passed to the integrate
command, it also needs to be included in the command line above so that
the correct subgrids are merged.

Parallel event generation can be performed by using a number of jobs
with different random seeds,:

Herwigrun--seed=426738LHC-Matchbox.run

and the statistically independent results from these different runs
can then be combined. In the Contrib directory, we provide two
collections of helper scripts for easing parallel event generation and
parameter variations. On top of this straightforward parallelization,
Herwig also has the option of forking event generation jobs on the
same machine: