-
Notifications
You must be signed in to change notification settings - Fork 17
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 leapfrog pusher for plasma #847
Add leapfrog pusher for plasma #847
Conversation
The differences between the new and old AB5 pusher in CI can be explained by: Ionization: for new electrons the old pusher would immediately push them with force terms equal to zero, while the new pusher would gather force terms first. Collisions: Because it is more convenient with how temp slices work, with the new pusher collisions are done after the push while the old pusher pushed after collisions. production.SI: This is a very tiny change in the checksum of fields like Bx, ExmBy, Bz etc. that don’t have a strong structure in on the xz slice, possibly caused by reordering some multiplications and divisions in the pusher. So they are effectively equivalent. I will now change the default to leapfrog. |
Suggestion I'd like: Since it is a compile time option, it would be great if it was printed in the output, similar to other compile time options like the precision. i.e.,
|
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.
Looks great, thanks for this PR! Indeed quite a bit of cleaning. See small comments below.
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.
Nice, thanks for the comments!
For the record, could you update the description of your PR to reflect the new name of the compile-time option? |
@@ -165,7 +165,8 @@ or by providing arguments to the CMake call | |||
``HiPACE_amrex_branch`` ``development`` Repository branch for ``HiPACE_amrex_repo`` | |||
``HiPACE_amrex_internal`` **ON**/OFF Needs a pre-installed AMReX library if set to ``OFF`` | |||
``HiPACE_OPENPMD`` **ON**/OFF openPMD I/O (HDF5, ADIOS2) | |||
============================= ======================================== ===================================================== | |||
``HiPACE_PUSHER`` **AB5**/LEAPFROG Use fifth-order Adams-Bashforth or leapfrog Plasma Pusher |
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.
@AlexanderSinn is it work making this a compile-time option?
I think pre-compiling both options and doing a runtime switch before the two specialized kernels would be more user friendly.
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.
Discussed: needs additional (25) force terms on the particle, so that's a bit of a heavy lift.
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.
As mentioned, it is a compile-time option not for performance of the push kernel, but rather to save on memory of the 25 Adams-Bashforth force terms (per plasma particle) if the leapfrog pusher is used. One would need to change these to runtime components to make this a runtime option.
To use the new leapfrog pusher, compile with
Leapfrog: 40% faster plasma push
AB5:
Leapfrog: 2.5x less memory for plasma
AB5:
Leapfrog: within ~10^-5 field results
AB5:
Delta:
const
isconst
)