-
Notifications
You must be signed in to change notification settings - Fork 217
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
fix plugin energy field reduce #2112
fix plugin energy field reduce #2112
Conversation
All in all this is a out of memory access within the stack and could have unknown side effects. |
@@ -219,7 +219,7 @@ class EnergyFields : public ISimulationPlugin | |||
mpiReduce(nvidia::functors::Add(), | |||
&globalFieldEnergy, | |||
&localReducedFieldEnergy, | |||
2, | |||
1, /* only 1 reduce because type is float3_x[2] */ |
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.
after thinking about the fix I think we should fix it the other way around, this would be more intuitive
globalFieldEnergy,
localReducedFieldEnergy,
2,
mpi::reduceMethods::Reduce());
17a3d38
to
aee7784
Compare
I tested this with the TWTS/plane wave setup and got the same result for both 1 GPU and 2 GPUs. |
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.
good catch you two!
This pull request fixes a wrong MPI reduce in the field energy plugin.
It caused wrong field values (f.e. in TWTS runs) because the mpi reduce reduces over two
float3_X[2]
instead of over just onefloat3_X[2]
(which is equal two 2float3_X
- which was probably the intention of the developer).Thanks @psychocoderHPC for spotting this!
Run time test show taht this solves the wrong output we see during TWTS runs.
(This effects all heating tests)
Effects so far:
So far this caused mostly some massively increased
Ez
values.This does not effect the physics - just the output.
Test
CC-ing: @steindev, @BeyondEspresso