-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[ntuple] add read support to SoA I/O #22139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
|
|
||
| #include <cstddef> | ||
| #include <memory> | ||
| #include <mutex> | ||
| #include <string_view> | ||
| #include <typeinfo> | ||
| #include <vector> | ||
|
|
@@ -66,9 +67,18 @@ class RSoAField : public RFieldBase { | |
| /// The offset of the RVec members in the SoA type in the order of subfields of the underlying record type. | ||
| /// In particular, the order is not necessarily the same then the order of RVec members in the SoA class. | ||
| std::vector<std::size_t> fSoAMemberOffsets; | ||
| ///< A deleter returned by each record member's GetDeleter() | ||
| std::vector<std::unique_ptr<RDeleter>> fRecordMemberDeleters; | ||
| std::size_t fMaxAlignment = 1; | ||
| ROOT::Internal::RColumnIndex fNWritten; | ||
|
|
||
| /// For reading and writing, the RVecs of the SoA class do not have a dedicated field. The in-memory RVecs of the | ||
| /// SoA object are used directly with the subfields of the underlying record type. For splitting a SoA class object | ||
| /// (SplitValue()), however, we need actual RRVecFields so that we can recursively split the in-memory SoA value. | ||
| /// The split fields are created only when SplitField() is called. | ||
| mutable std::unique_ptr<std::vector<std::unique_ptr<ROOT::RRVecField>>> fSplitFields; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we group together the vector and its mutex in a single struct/allocation?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure how this would work. Don't we need to acquire the mutex before we can initialize the unique pointer with the vector? |
||
| mutable std::unique_ptr<std::mutex> fLockSplitFields; ///< protects the fSplitFields member. | ||
|
|
||
| RSoAField(std::string_view fieldName, const RSoAField &source); ///< Used by CloneImpl | ||
| RSoAField(std::string_view fieldName, TClass *clSoA); | ||
|
|
||
|
|
@@ -85,8 +95,6 @@ protected: | |
| std::size_t AppendImpl(const void *from) final; | ||
| void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final; | ||
|
|
||
| void ReconcileOnDiskField(const RNTupleDescriptor &) final {} | ||
|
|
||
| void CommitClusterImpl() final { fNWritten = 0; } | ||
|
|
||
| public: | ||
|
|
@@ -104,8 +112,7 @@ public: | |
| /// of any user object. If the class is not polymorphic, return nullptr. | ||
| /// TODO(jblomer): use information in unique pointer field | ||
| const std::type_info *GetPolymorphicTypeInfo() const; | ||
| // TODO(jblomer) | ||
| // void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final; | ||
| void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final; | ||
|
|
||
| TClass *GetSoAClass() const { return fSoAClass; } | ||
| }; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.