-
Notifications
You must be signed in to change notification settings - Fork 35
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
Allow geometry selection independent of VecGeom being enabled #726
Merged
Conversation
This file contains 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
sethrj
added
minor
Minor internal changes or fixes
external
Dependencies and framework-oriented features
labels
Apr 19, 2023
mrguilima
reviewed
Apr 20, 2023
pcanal
reviewed
Apr 20, 2023
pcanal
reviewed
Apr 20, 2023
pcanal
reviewed
Apr 20, 2023
pcanal
reviewed
Apr 20, 2023
pcanal
reviewed
Apr 20, 2023
pcanal
reviewed
Apr 20, 2023
pcanal
reviewed
Apr 20, 2023
Provide a helper function that we can use to centralize the decision/implementation between outputting a message or changing the function.
@pcanal Any further comments? I think I've addressed all your concerns. If you want a clearer error message perhaps the following is good enough: diff --git a/cmake/CeleritasUtils.cmake b/cmake/CeleritasUtils.cmake
index b70f8abc..77d3d304 100644
--- a/cmake/CeleritasUtils.cmake
+++ b/cmake/CeleritasUtils.cmake
@@ -298,8 +298,9 @@ function(celeritas_define_options var doc)
list(FIND ${var}_OPTIONS "${${var}}" _index)
if(_index EQUAL -1)
+ string(JOIN "," _optlist ${${var}_OPTIONS})
celeritas_error_incompatible_option(
- "Invalid selection not in list: \"${${var}_OPTIONS}\""
+ "Invalid option for ${var}: must be in the list [${_optlist}] "
"${var}" "${_default}"
)
endif() |
pcanal
reviewed
Apr 26, 2023
pcanal
approved these changes
Apr 26, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This does something similar with geometry that we have for the RNGs: selecting in-house geometry while still building the others. I'm thinking about adding a "simple ORANGE" for performance testing, and it'll be good to have it available without a branch.
This replaces a lot of
#if CELERITAS_USE_VECGEOM
with#if CELERITAS_GEO == CELERITAS_GEO_VECGEOM
, which I think makes it a little clearer that it's about the main geometry selection rather than the availability of the external library.I also renamed
load_gdml
to make it clearer that it's loading into the global geant4 state as opposed to VecGeom. The way it also tried to handle memory was also wrong: the GDML reader isn't actually returning a new'd pointer with C++ style memory management; the underlying object savesthis
to a magical vector that manages memory.I also reworked the VecGeom test (since it can now be enabled without VecGeom being selected as the "core" geometry) so that it can run all the Geant4 geometry tests without having to break them apart into separate test instances or loading geant physics.