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

LWFA on cpu shows different (wrong) physics #2688

Closed
PrometheusPi opened this issue Aug 15, 2018 · 4 comments
Closed

LWFA on cpu shows different (wrong) physics #2688

PrometheusPi opened this issue Aug 15, 2018 · 4 comments
Assignees
Labels
backend: omp2b OpenMP2 backend bug a bug in the project's code

Comments

@PrometheusPi
Copy link
Member

When running the default LWFA example with 32.cfgthere is a major difference between using gpus or cpus.

In the following you will see png pictures of the simulation after 600 iterations/time steps.

The current master brach:
grafik

The current devbranch on k80GPUs:
grafik

The current devbranch on laserCPUs:
grafik

The last is definitely wrong, an a_0=8.0 would cause a blow out, not these streams.

@PrometheusPi PrometheusPi added bug a bug in the project's code affects latest release a bug that affects the latest stable release backend: omp2b OpenMP2 backend labels Aug 15, 2018
@PrometheusPi
Copy link
Member Author

@kossag14 This is probably not an issue that effects you. I think it is more likely the difference you see arise from #2687.

@PrometheusPi
Copy link
Member Author

as recommended by @psychocoderHPC offline I checked how PIConGPU performs on CPUs (lasernodes) at 60 commits before tags/0.4.0-rc1.

The results looks great! We have "correct" physics! ✨ 🎉

600 iterations of 57bcf5cc592b3bf9ad14902d1cadbd4ec8d76193 on laser nodes:
grafik

Probably the laser refactoring #2587 (or #2624) caused this bug.

@PrometheusPi
Copy link
Member Author

@psychocoderHPC as you expected, calling the laser functor is causing the error.

With the fix:

diff --git a/include/picongpu/fields/LaserPhysics.hpp b/include/picongpu/fields/LaserPhysics.hpp
index 66f8c84..09bab6f 100644
--- a/include/picongpu/fields/LaserPhysics.hpp
+++ b/include/picongpu/fields/LaserPhysics.hpp
@@ -79,12 +79,6 @@ namespace fields
 
             uint32_t cellOffsetInSuperCellFromInitPlaneY = LaserFunctor::Unitless::initPlaneY % SuperCellSize::y::value;
 
-            auto accLaserFunctor = laserFunctor(
-                acc,
-                localSuperCellOffset,
-                mappings::threads::WorkerCfg< numWorkers >{ workerIdx }
-            );
-
             mappings::threads::ForEachIdx<
                 mappings::threads::IdxConfig<
                     planeSize,
@@ -96,6 +90,12 @@ namespace fields
                     uint32_t const
                 )
                 {
+                   auto accLaserFunctor = laserFunctor(
+                       acc,
+                       localSuperCellOffset,
+                       mappings::threads::WorkerCfg< numWorkers >{ workerIdx }
+                    );
+
                     /* cell index within the superCell */
                     DataSpace< simDim > cellIdxInSuperCell = DataSpaceOperations< simDim >::template map< LaserPlaneSizeInSuperCell >( linearIdx );
                     cellIdxInSuperCell.y() += cellOffsetInSuperCellFromInitPlaneY;

the issue is solved:

png picture after 600 iterations with above fix on laser cpu nodes:

grafik

@PrometheusPi PrometheusPi removed the affects latest release a bug that affects the latest stable release label Aug 15, 2018
@PrometheusPi PrometheusPi self-assigned this Aug 15, 2018
@ax3l
Copy link
Member

ax3l commented Aug 16, 2018

thx for the fix in #2689! will add it to 0.4.0-rc2

@ax3l ax3l closed this as completed Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: omp2b OpenMP2 backend bug a bug in the project's code
Projects
None yet
Development

No branches or pull requests

2 participants