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.
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
Add example offloading template #1573
base: develop
Are you sure you want to change the base?
Add example offloading template #1573
Changes from 12 commits
d7d8c23
3522121
c38da6b
93344a7
7cda4be
cf3a6c8
7ab16f6
1e0c3bd
71fca31
136923c
2b0c86a
691db71
e60bfeb
4a24b74
d52259d
cd760cd
5995dc0
bfa3330
149a02f
66211f0
cc74293
e51c9c6
6f6e132
4ce08ad
2f75fcc
0af9cfa
6e5adf7
e85e2a7
e2a6722
e4eed68
beea6de
8d993c2
dfbe718
186a1b0
eaf6c30
c15f9c6
3024e9e
8895050
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
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 this make it MT if Geant4 is built with threading?
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.
I actually made this a
G4RunManagerType::Serial
to run a single-thread execution, and just added a comment on the MT case.Edit: My reasoning to keep it single-threaded is so that we don't have to also require an install with
GEANT4_BUILD_MULTITHREADED=ON
as a condition just to test a tiny offload 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.
GEANT4_BUILD_MULTITHREADED=ON is now the default (so, you do not need explicitly to set it), which then is able to run both sequential and tasking (default tasking option is the traditional old MT). So it will support all cases.
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.
Should this be in BuildForMaster (assuming that the default run manager (tasking run manager) is 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.
Not really, because it is not an MT application. But good point, I may have to either make it an MT example, or add a few notes throughout it about the MT case.
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 probably should support MT? Most new Geant4 apps should.
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.
Yeah, I thought of that. But then we have to require a Geant4 install with
GEANT4_BUILD_MULTITHREADED=ON
for a tiny example. Fairly, that would be standard for most cases, but seemed simpler to run a single-threaded one, so any compilation works, and explain how MT should be handled in a comment.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.
The
BuildForMaster
member function can be supplied always. If Geant4 is not MT enabled, it'll never be called, but by being there both cases can be supported.