-
Notifications
You must be signed in to change notification settings - Fork 14
Form fix ttree write threading #476
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
Changes from all commits
2f49029
df3b5f6
c5b786c
8be135e
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,7 +16,7 @@ ROOT_TTree_Write_ContainerImp::ROOT_TTree_Write_ContainerImp(std::string const& | |||||
| ROOT_TTree_Write_ContainerImp::~ROOT_TTree_Write_ContainerImp() | ||||||
| { | ||||||
| if (m_tree != nullptr) { | ||||||
| m_tree->Write(); | ||||||
| m_tree->GetDirectory()->WriteTObject(m_tree); | ||||||
|
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.
Suggested change
It should already be doing what (and a few more thing) the PR does. (On the other the SetDirectory is probably necessary to ensure that the TTree ends up in the right file). |
||||||
| delete m_tree; | ||||||
| } | ||||||
| } | ||||||
|
|
@@ -42,8 +42,8 @@ void ROOT_TTree_Write_ContainerImp::setupWrite(std::type_info const& /* type*/) | |||||
| m_tree = m_tfile->Get<TTree>(name().c_str()); | ||||||
| } | ||||||
| if (m_tree == nullptr) { | ||||||
| TDirectory::TContext context(m_tfile.get()); | ||||||
|
aolivier23 marked this conversation as resolved.
|
||||||
| m_tree = new TTree(name().c_str(), name().c_str()); | ||||||
| m_tree->SetDirectory(m_tfile.get()); | ||||||
|
Comment on lines
45
to
+46
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. The fix is unlikely to solve the underlying problem. If things are set properly (i.e. Thread Safety is enabled), the 2 codes have the same effective behavior.
If the new code is indeed more robust than the older code, it would (most likely) mean that Thread Safety is not enabled ... and if it not enabled all of ROOT/Core/Meta is not thread safe and will fail in many circumstances. If Thread Safely is already enabled, then we have a deeper mystery to investigate.
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. I think that must be it. Thread safety is probably not enabled. FORM doesn't do it to my knowledge, and I think we're the only component using ROOT. Thank you!
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. Note that there is no harm in enabling it multiple time, so indeed FORM must enabled it explicitly. |
||||||
| } | ||||||
| if (m_tree == nullptr) { | ||||||
| throw std::runtime_error("ROOT_TTree_Write_ContainerImp::setupWrite no tree created"); | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.