Fast cloning¶An art job configured with a
RootInputsource and a
RootOutputoutput module will, by default, copy the entire input file into the art ROOT output file. This is by and large the most common job configuration.
Normally, this would imply some steps:
- read from the input file the packed data including the event
- unpack the event data from the input tree (all branches)
- pack its data into the output tree
- write the packed data into the output file
RootOutputmodule in the event loop.
In the "most common" case described above, the neat result of this process is that each branch in the input tree is exactly replicated in the output tree.
The fast cloning feature shortcuts all those steps and just copies the data from all the input branches into the output tree:
- read the packed data in a branch from the input tree
- write that packed data as a new branch in the output tree
This happens before the event loop has even started1.
Note that since fast cloning process is outside the event loop, the usual time tracking tools (e.g.
TimeTrackerservice) will not charge the time taken by the cloning on
RootOutputtab; the observable will be art spending a lot of time without writing anything on screen, and in that meanwhile the output art ROOT file can be observed to grow in size up to the one of the input file.
1 This is technically incorrect, since it actually happens in the
postProcessEvent state (art 2.8.3), and also because this may happen on each input file.
Disabling fast cloning¶
Fast cloning feature is enabled by default as it saves some time and loads of memory. Yet there are cases where it needs to be disabled.
Automatic disable¶Modern art versions (for sure from 2.6 on) are pretty smart in guessing when fast cloning is feasible. In general, fast cloning is not feasible when the output branches would be different from the input ones. Reasons may include:
- excluding (filtering out) events
- changes in the data product structure ("schema evolution")
- critical changes in ROOT tree format
- changes in branch settings (but not necessarily: see below)
- multiple input files, even with a single output file
- change of general compression level
- selection of branches to keep/drop (
outputCommandsconfiguration parameter of
When relevant conditions are detected, art disables fast cloning and prints a message about it. Note that when
compressionLevel is specified, art prefers fast cloning, so that the new branches are created with the specified compression level but the old ones are cloned and retain the original compression level.
Here are collected some conditions under which art will enable and disable fast cloning, and their message on screen:
|per job|| no
|per input file|| limited number of events (e.g.
| skipping events (e.g.
|change in data product structure||
|input from a version of art too old||
|input file from older ROOT (ROOT 5)||?|
Only one message (at most) is printed per input file. The messages in this table are in rough order of priority. For example, a file from LArSoft 5 is both from a version of art too old to support
RangeSet, and from ROOT 5: only the message about
RangeSet support is printed.
If you have reasons on your own to disable fast cloning, this can be achieved by a configuration parameter in
fastCloning: false (see
lar --print-description RootOutput).