-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Expansion of the TStreamerInfo actions. #16995
base: master
Are you sure you want to change the base?
Conversation
This enables the StreamerInfoActions to enable the shortcuts that are possible in that case.
The version recorded 'here' is the version of the TStreamerInfo class not the user class
Even without schema evolution, the representation of a collection of enums on file is a `vector<int>` so `TStreamerElement::fType` and `TStreamerElement::fClassObject` should point to `vector<int>` while `TStreamerElement::fNewType` and `TStreamerElement::fNewClass` should point to the current in memory representaition `actualCollectionType< actualEnum >` that will know/remember what is the actual enum in memory representation.
Combine the code with the one use for the text actions
Combine the code with the one use for the text actions
To use be for case where the read and write implementation differs only slightly
To be used for function template that can be used for more than one actual looper (usually in conjunction with the LoopOverCollection template
Allow to share code with the collection loopers.
Test Results 18 files 18 suites 3d 21h 3m 41s ⏱️ For more details on these failures, see this check. Results for commit 17097bc. ♻️ This comment has been updated with latest results. |
We need to go with a specific action that hold the sub sequence (sequence for a base class) rather than insert of the action directly into the main sequence as (currently) the splicing of the action sequences needed to implemenent the split streaming in TTree relies on the order/index of the elements
ef312d6
to
c9d3c07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this major improvement. I added some comments for the review. In general I believe it could be very useful to take this opportunity, perhaps to the documentation of TStreamerInfo, to add a 1 page explanation of what this major overhaul does, also explaining simply, without code and only in English, what the pre-existing code was doing.
@@ -188,6 +194,59 @@ namespace TStreamerInfoActions | |||
|
|||
}; | |||
|
|||
struct TConfObject : public TConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe could some comment here be useful to clarify why this new struct exists and how it will be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Humm .. this is one of 'many' specialization of the action configuration object. However we might indeed be missing an overview document of the Sequence/Action/Configuration scaffolding.
return 0; | ||
} | ||
class TConfNoFactor : public TConfiguration { | ||
// Configuration object for the Float16/Double32 where a factor has been specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could a more complete explanation help here, e.g. about what a factor is perhaps with an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not quite the right place (and/or would lead to duplicate information). The full explanation is at
root/io/io/src/TBufferFile.cxx
Line 555 in 6735f22
//////////////////////////////////////////////////////////////////////////////// |
As other place, maybe we should refer to TBufferFile::WriteFloat16
When executing the streaming on an object, the execution of the case covered by the case In its previous implementation (which is still used in a few rare cases involved backward compatibility), the case |
io/io/src/TStreamerInfoActions.cxx
Outdated
@@ -1760,9 +1760,7 @@ namespace TStreamerInfoActions | |||
// Read the class version and byte count from the buffer. | |||
UInt_t start = 0; | |||
UInt_t count = 0; | |||
buf.ReadVersion(&start, &count, cl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the commit message be extended explaining in which case the error is triggered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No error message was actually observed or is expected. The code is clearly asymmetrical between was is written and was is being read. The theorized error message is something like Can not find version 1 of class <wrong class name>
and then moving along correctly (beside printing the error) when reading a file produced by the version with version 1 of TStreamerInfo, i.e. version v2.26 (Circa 2001)
This add TStreamerInfo actions for the case of base class, nested objects, externally assignment streamer and array thereof (
kBase
,kAny
,kStreamer
,kStreamLoop
) for both scalar and collection cases. It also expands the scope of the writing actions to cover the collections cases and the new cases (kBase
,kAny
,kStreamer
,kStreamLoop
)Companion PR of root-project/roottest#1224
When executing the streaming on an object, the execution of the case covered by the case
kBase
,kAny
,kStreamer
,kStreamLoop
was migrated from using the legacy code within the source fileTStreamerInfoReadBuffer.cxx
andTStreamerInfoWriteBuffer.cxx
which is based on a pair of 'giant' switch statement to the newer framework based on the composition ofTStreamerInfoActions
(and the corresponding collection:TActionSequence
). The change fromswitch
statement to a set of function pointers allows to improve performance by executing for each data members only the code strictly necessary.In its previous implementation (which is still used in a few rare cases involved backward compatibility), the case
kBase
(for both reading and writing) was forcing the use of theswitch
statement for all the data members of the base classes. This prevented the use of the new convert-on-write actions (with no existing corresponding implementation in the writeswitch
statement) that are necessary for supporting theEnums
with non default size.