-
Notifications
You must be signed in to change notification settings - Fork 345
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
ParmParse::addfile needs Init #3440
ParmParse::addfile needs Init #3440
Conversation
aa4fd0c
to
452a29b
Compare
This does not work because amrex::Initialized() does not work during amrex::Initialize(). I think the way to do it is
|
Agreed on the solution - but isn't the issue due to |
That's right. So there are two issues. We cannot call
|
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
## 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: ECP-WarpX/WarpX#5283 ECP-WarpX/impactx#704
Summary
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.
Additional background
cc @EZoni @RevathiJambunathan
Checklist
The proposed changes: