-
Notifications
You must be signed in to change notification settings - Fork 21
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
Parameters: Use AMReX Parser #792
base: development
Are you sure you want to change the base?
Conversation
@@ -8,10 +8,10 @@ beam.charge = 1.0e-9 | |||
beam.particle = electron | |||
beam.distribution = waterbag | |||
beam.lambdaX = 3.162277660e-6 | |||
beam.lambdaY = 3.162277660e-6 | |||
beam.lambdaY = beam.lambdaX |
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.
Do we really want to change all of the existing examples? Couldn't this cause some confusion to users? It might be better to have just one example to illustrate this feature.
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 added it whenever it made sense so people come definitely across it. I hope I did not add it in confusing places, can revert a few where it is complicating the logic ofc.
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.
Just one question/comment about the examples.
9da3ad0
to
4aa0a49
Compare
4aa0a49
to
68efd71
Compare
I think the issue with python is ParmParse::Initialize (called by amrex::Initialize) has not been called when ImpactX::init_grids is called. |
We could try to make amrex::ParmParse more robust so that queryWithParse would work even without ParmParse::Initialize. But it may not be that easy to make it thread safe. |
Nevertheless, if we assume queryWithParser (before ParmParse::initialize is called) is not used inside omp parallel, it's easy to fix. |
However, it may not make sense to use queryWithParser if ParmParse has not been initialized. For example
does not work as expected if foo.x and foo.y are not in the ParmParse database. |
AMReX-Codes/amrex#4291 I did the FODO.py.run test, it seems to work with the amrex PR. |
Could I call We def use ParmParse quite a bit before AMReX init (WarpX: dim selection; ImpactX: configuration, ...). What actually happens in MPI contexts if we do that? Usually, ParmParse reads files only from the I/O rank, and in that case...? |
Use the advanced right-hand-side parser of AMReX to read user parameters in inputs files. Enable constants, temporary variables, reuse of parameters, and simple mathematical expressions.
68efd71
to
62795b5
Compare
Use the advanced right-hand-side parser of AMReX to read user parameters in inputs files. Enable constants, temporary variables, reuse of parameters, and simple mathematical expressions.
Examples: Use Parser Where Sensible.
development
#791development
#796