@@ -44,20 +44,19 @@ class RNTupleFillContext;
4444\brief A writer to fill an RNTuple from multiple contexts
4545
4646Compared to the sequential RNTupleWriter, a parallel writer enables the creation of multiple RNTupleFillContext (see
47- RNTupleParallelWriter:: CreateFillContext) . Each fill context prepares independent clusters that are appended to the
48- common ntuple with internal synchronization. Before destruction, all fill contexts must have flushed their data and
49- been destroyed (or data could be lost!).
47+ CreateFillContext()) . Each fill context prepares independent clusters that are appended to the common RNTuple with
48+ internal synchronization. Before destruction, all fill contexts must have flushed their data and been destroyed (or
49+ data could be lost!).
5050
51- For user convenience, RNTupleParallelWriter::CreateFillContext is thread-safe and may be called from multiple threads
52- in parallel at any time, also after some data has already been written. Internally, the original model is cloned and
53- ownership is passed to a newly created RNTupleFillContext. For that reason, it is recommended to use
54- RNTupleModel::CreateBare when creating the model for parallel writing and avoid the allocation of a useless default
55- REntry per context.
51+ For user convenience, CreateFillContext() is thread-safe and may be called from multiple threads in parallel at any
52+ time, also after some data has already been written. Internally, the original model is cloned and ownership is passed
53+ to a newly created RNTupleFillContext. For that reason, it is recommended to use RNTupleModel::CreateBare when creating
54+ the model for parallel writing and avoid the allocation of a useless default REntry per context.
5655
5756Note that the sequence of independently prepared clusters is indeterminate and therefore entries are only partially
5857ordered: Entries from one context are totally ordered as they were filled. However, there is no orderering with other
59- contexts and the entries may be appended to the ntuple either before or after other entries written in parallel into
60- other contexts. In addition, two consecutive entries in one fill context can end up separated in the final ntuple , if
58+ contexts and the entries may be appended to the RNTuple either before or after other entries written in parallel into
59+ other contexts. In addition, two consecutive entries in one fill context can end up separated in the final RNTuple , if
6160they happen to fall onto a cluster boundary and other contexts append more entries before the next cluster is full.
6261
6362At the moment, the parallel writer does not (yet) support incremental updates of the underlying model. Please refer to
@@ -82,11 +81,17 @@ private:
8281 RNTupleParallelWriter &operator =(const RNTupleParallelWriter &) = delete ;
8382
8483public:
85- // / Recreate a new file and return a writer to write an ntuple .
84+ // / Recreate a new file and return a writer to write an RNTuple .
8685 static std::unique_ptr<RNTupleParallelWriter>
8786 Recreate (std::unique_ptr<ROOT::RNTupleModel> model, std::string_view ntupleName, std::string_view storage,
8887 const ROOT::RNTupleWriteOptions &options = ROOT::RNTupleWriteOptions());
89- // / Append an ntuple to the existing file, which must not be accessed while data is filled into any created context.
88+ // / Append an RNTuple to the existing file.
89+ // /
90+ // / While the writer synchronizes between multiple fill contexts created from the same writer, there is no
91+ // / synchronization with other writers or other clients that write into the same file. The caller must ensure that
92+ // / the underlying file is not be accessed while data is filled into any created context. To improve performance, it
93+ // / is allowed to use special methods that are guaranteed to not interact with the underlying file, such as
94+ // / RNTupleFillContext::FillNoFlush().
9095 static std::unique_ptr<RNTupleParallelWriter>
9196 Append (std::unique_ptr<ROOT::RNTupleModel> model, std::string_view ntupleName, TDirectory &fileOrDirectory,
9297 const ROOT::RNTupleWriteOptions &options = ROOT::RNTupleWriteOptions());
@@ -97,7 +102,7 @@ public:
97102 // / thread-safe and may be called from multiple threads in parallel at any time, also after some data has already
98103 // / been written.
99104 // /
100- // / Note that all fill contexts must be destroyed before RNTupleParallelWriter:: CommitDataset() is called.
105+ // / Note that all fill contexts must be destroyed before CommitDataset() is called.
101106 std::shared_ptr<RNTupleFillContext> CreateFillContext ();
102107
103108 // / Automatically called by the destructor
0 commit comments