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

fix plugin energy field reduce #2112

Merged

Conversation

PrometheusPi
Copy link
Member

@PrometheusPi PrometheusPi commented Jun 30, 2017

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 one float3_X[2] (which is equal two 2 float3_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

  • test field energy with TWTS enabled

CC-ing: @steindev, @BeyondEspresso

@PrometheusPi PrometheusPi added the bug a bug in the project's code label Jun 30, 2017
@psychocoderHPC
Copy link
Member

All in all this is a out of memory access within the stack and could have unknown side effects.

@psychocoderHPC psychocoderHPC added the affects latest release a bug that affects the latest stable release label Jun 30, 2017
@psychocoderHPC psychocoderHPC added this to the 0.4.0 / 1.0.0: Next Stable milestone Jun 30, 2017
@@ -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] */
Copy link
Member

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());

@PrometheusPi PrometheusPi force-pushed the fix_pluginEnergyField branch from 17a3d38 to aee7784 Compare July 2, 2017 22:01
@PrometheusPi
Copy link
Member Author

I tested this with the TWTS/plane wave setup and got the same result for both 1 GPU and 2 GPUs.

Copy link
Member

@ax3l ax3l left a 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!

@ax3l ax3l added the component: plugin in PIConGPU plugin label Jul 3, 2017
@ax3l ax3l merged commit 43d7c07 into ComputationalRadiationPhysics:dev Jul 3, 2017
@psychocoderHPC psychocoderHPC mentioned this pull request Jul 6, 2017
2 tasks
@ax3l ax3l mentioned this pull request Jul 18, 2017
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects latest release a bug that affects the latest stable release bug a bug in the project's code component: plugin in PIConGPU plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants