-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Refactor PathsAndConsumesOfModules #47937
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?
Refactor PathsAndConsumesOfModules #47937
Conversation
- moved complex logic for creating the internal data structures to the class itself - can no ask an ESProducer what is produces - provide a mechanism to get minimal information about what ES products are being consumed
cms-bot internal usage |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47937/44595 ERROR: Build errors found during clang-tidy run.
|
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47937/44596
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
632df35
to
f1d9dc9
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47937/44597
|
A new Pull Request was created by @Dr15Jones for master. It involves the following packages:
@Dr15Jones, @atpathak, @cmsbuild, @consuegs, @francescobrivio, @makortel, @perrotta, @smuzaffar, @tvami can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
Additional changes to PathsAndConsumesOfModules , probably for another PR
|
@@ -236,4 +238,20 @@ CondHDF5ESSource::KeyedResolversVector CondHDF5ESSource::registerResolvers(Event | |||
return returnValue; | |||
} | |||
|
|||
std::vector<edm::eventsetup::ESModuleProducesInfo> CondHDF5ESSource::producesInfo() const { | |||
std::vector<edm::eventsetup::ESModuleProducesInfo> returnValue; |
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.
Would returnValue.reserve()
be worth it? E.g. with records_.size()
? (unlikely to be exact, but maybe would avoid a number of small reallocations)
@@ -648,6 +649,22 @@ edm::eventsetup::ESProductResolverProvider::KeyedResolversVector CondDBESSource: | |||
return keyedResolversVector; | |||
} | |||
|
|||
std::vector<edm::eventsetup::ESModuleProducesInfo> CondDBESSource::producesInfo() const { | |||
std::vector<edm::eventsetup::ESModuleProducesInfo> returnValue; |
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.
How about
returnValue.reserve(m_resolvers.size());
?
///This can only be called before the end of beginJob (after that the underlying data has been deleted) | ||
std::vector<ModuleConsumesMinimalESInfo> moduleConsumesMinimalESInfos() const; |
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.
A comment here if the returned ModuleConsumesMinimalESInfo
can be used beyond the end of beginJob
would be helpful (given that ModuleConsumesMinimalESInfo
holds string_view
).
assert(*consumedModuleLabel.data() != | ||
'\0'); // consumesMany used to create empty labels before we removed consumesMany |
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.
assert(*consumedModuleLabel.data() != | |
'\0'); // consumesMany used to create empty labels before we removed consumesMany | |
// consumesMany used to create empty labels before we removed consumesMany | |
assert(*consumedModuleLabel.data() != '\0'); |
would look better
eventsetup::EventSetupProvider const& eventSetupProvider) { | ||
esRecordsToProductResolverIndices_ = std::move(esRecordsToProductResolverIndices); | ||
schedule_->fillESModuleAndConsumesInfo(esModulesWhoseProductsAreConsumedBy_, esRecordsToProductResolverIndices_); | ||
namespace {} // namespace |
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.
This can probably be removed?
namespace {} // namespace |
Thinking more about this change, I'm not certain it would properly handle the case where multiple ES modules want to deliver the same data product. |
- The EventSetupProvider structures already handle such cases.
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47937/44608
|
Pull request #47937 was updated. @Dr15Jones, @atpathak, @cmsbuild, @consuegs, @francescobrivio, @makortel, @perrotta, @smuzaffar, @tvami can you please check and sign again. |
please test |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47937/44609
|
Pull request #47937 was updated. @Dr15Jones, @atpathak, @consuegs, @francescobrivio, @makortel, @perrotta, @smuzaffar, @tvami can you please check and sign again. |
+1 Size: This PR adds an extra 100KB to repository Comparison SummarySummary:
|
PR description:
PR validation:
Framework unit tests pass.
resolves cms-sw/framework-team#1368