-
Notifications
You must be signed in to change notification settings - Fork 20
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
initialize the distributions on the GPU #498
Conversation
5111901
to
d1967fe
Compare
d1967fe
to
55e4c43
Compare
29c1881
to
286459d
Compare
{ | ||
BL_PROFILE("ImpactX::AddNParticles"); | ||
|
||
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(lev == 0, "AddNParticles: only lev=0 is supported yet."); |
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.
ImpactX support MR now. I wonder if lev!=0
is generally needed or if we want to remove the parameter altogether.
I assume that on Redistribute
we automatically move the particles in the corresponding level at the end of AddNParticles
?
Fix the missing resize before redistribute. Remove the old, unusued, serial initialization logic.
Ok, this passed the thermal tests on GPU on Perlmutter 🎉 |
Remove stack memory usage and use GPU memory for pre-computed CDF.
c03bfc1
to
d7a2652
Compare
@cemitch99 a couple of tests fail with this PR on GPU due to tolerances in analysis scripts. The main reason is that we change the way we draw random numbers and have different seeds in parallel execution now. Unless there is a GPU bug, might need to relax tolerances a bit, I think. |
|
For the FODO cell example, the initial beam sigma_x,y and emittance_x,y is 2 orders of magnitude smaller then the reference value. Update: misread, indeed just sampling noise. Will slightly push tolerances. |
Avoid promoting to double in C functions.
On older NVCC
Run on local GPU (RTX A2000).
Parallelize particle initialization using
ParallelForRNG
for all backends.Follow-up to #73
Close #495