Skip to content
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 the option to load a WarpX input file from PICMI #5283

Open
RemiLehe opened this issue Sep 17, 2024 · 0 comments
Open

Add the option to load a WarpX input file from PICMI #5283

RemiLehe opened this issue Sep 17, 2024 · 0 comments
Labels
component: Python Python layer enhancement New feature or request

Comments

@RemiLehe
Copy link
Member

RemiLehe commented Sep 17, 2024

When switching from using the WarpX executable to using Python/PICMI (e.g. in order to take advantage of the Python callback functions), users usually have to rewrite their input script from scratch. (i.e. switching from the input script syntax to the PICMI syntax)

This is often time consuming and error prone. Instead it could be useful to have the option to load an input script in Python, e.g.:

sim = Simulation.from_input_script( './inputs_3d' )  # loads an existing input script
installcallback('afterstep', myplots)  # optional: add callback function
sim.step()  # runs the simulation

One could use a syntax similar to the one in ImpactX:
https://github.com/ECP-WarpX/impactx/blob/24.09/src/python/ImpactX.cpp#L79

which relies on:
https://github.com/AMReX-Codes/pyamrex/blob/development/src/Base/ParmParse.cpp#L33

See also:
AMReX-Codes/amrex#4156

@ax3l ax3l added the component: Python Python layer label Sep 17, 2024
@RemiLehe RemiLehe added the enhancement New feature or request label Sep 17, 2024
WeiqunZhang pushed a commit to AMReX-Codes/amrex that referenced this issue 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: ECP-WarpX/WarpX#5283
ECP-WarpX/impactx#704
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Python Python layer enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants