ParmParse::addfile needs Init#3440
Merged
WeiqunZhang merged 1 commit intoAMReX-Codes:developmentfrom Sep 18, 2023
Merged
Conversation
aa4fd0c to
452a29b
Compare
ax3l
commented
Jul 21, 2023
Member
|
This does not work because amrex::Initialized() does not work during amrex::Initialize(). I think the way to do it is |
Member
Author
|
Agreed on the solution - but isn't the issue due to |
ax3l
commented
Aug 1, 2023
ax3l
commented
Aug 1, 2023
ax3l
commented
Aug 1, 2023
ax3l
commented
Aug 1, 2023
ax3l
commented
Aug 1, 2023
Member
|
That's right. So there are two issues. We cannot call |
Member
Author
|
Yes, but I would rather throw an exception. |
`ParmParse` can be used before AMReX is initialized for most functionality, which is greatly helpful for us. One function that cannot be used before init is reading from a file, because it needs an MPI context to broadcast. Add a clean error message instead of a segfault.
12d93dc to
fced9ea
Compare
WeiqunZhang
approved these changes
Sep 18, 2023
5 tasks
WeiqunZhang
pushed a commit
that referenced
this pull request
Sep 18, 2024
## Summary If a file added via `ParmParse:addFile` does not exist, we did not yet receive a user-friendly error message. This fixes this in a way that does not hammer the file system from all MPI ranks. ## Additional background Follow-up to #2842 #2936 #3440 X-ref: BLAST-WarpX/warpx#5283 BLAST-ImpactX/impactx#704
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
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.
Summary
ParmParsecan be used before AMReX is initialized for most functionality, which is greatly helpful for us. One function that cannot be used before init is reading from a file, because it needs an MPI context to broadcast.Add a clean error message instead of a segfault.
Additional background
cc @EZoni @RevathiJambunathan
Checklist
The proposed changes: