-
Notifications
You must be signed in to change notification settings - Fork 4.7k
upgrade EvtGen interface for v03.00.00 #51029
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
Open
kawaho
wants to merge
9
commits into
cms-sw:CMSSW_17_0_X
Choose a base branch
from
kawaho:EvtGev3
base: CMSSW_17_0_X
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5d91b5b
minimal changes to make it compile
8a34914
move to thread_local
72ed0d7
Apply ThreadHandoff to ConcurrentExternalDecayDriver
a6dfc85
move pythia patch to cmsdist
4dcf499
bump to EvtGen v3.0.0; enable fsr options
d66589b
add fsr models to evtgen tests
150b0c7
ThreadHandoff.h is moved to FWCore/Utilities
ba5de48
add dummy MPI initialize
8de3e47
format
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
GeneratorInterface/ExternalDecays/interface/EvtGenThreadOwner.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #ifndef gen_EvtGenThreadOwner_h | ||
| #define gen_EvtGenThreadOwner_h | ||
|
|
||
| // Pins one dedicated pthread per stream and marshals every EvtGen call onto it. | ||
| // Mirrors SimG4Core's OscarMTProducer + omt::ThreadHandoff pattern | ||
|
|
||
| #include "SimG4Core/Application/interface/ThreadHandoff.h" | ||
| #include "FWCore/ServiceRegistry/interface/ServiceRegistry.h" | ||
|
|
||
| namespace gen { | ||
|
|
||
| class EvtGenThreadOwner { | ||
| public: | ||
| explicit EvtGenThreadOwner(int stackSize) : m_handoff{stackSize} {} | ||
|
|
||
| EvtGenThreadOwner(const EvtGenThreadOwner&) = delete; | ||
| EvtGenThreadOwner& operator=(const EvtGenThreadOwner&) = delete; | ||
|
|
||
| template <typename F> | ||
| void run(F&& f) { | ||
| auto token = edm::ServiceRegistry::instance().presentToken(); | ||
| m_handoff.runAndWait([token, &f]() { | ||
| edm::ServiceRegistry::Operate guard{token}; | ||
| f(); | ||
| }); | ||
| } | ||
|
|
||
| private: | ||
| omt::ThreadHandoff m_handoff; | ||
| }; | ||
|
|
||
| } | ||
|
|
||
| #endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
(as I commented already in the earlier issue) I think this dependence on
SimG4Coreshould be avoided. I opened #51041 to move theThreadHandofftoFWCore/Utilities.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, merged