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

Kokkos based P3M #4959

Open
3 tasks
RudolfWeeber opened this issue Jul 19, 2024 · 1 comment
Open
3 tasks

Kokkos based P3M #4959

RudolfWeeber opened this issue Jul 19, 2024 · 1 comment

Comments

@RudolfWeeber
Copy link
Contributor

RudolfWeeber commented Jul 19, 2024

  • parallelize charge and force assignment
  • use efficient parallel FFT library
  • parallelize K-space calculations

Charge/force assignment

  • This is already a for_each on all particles. A parallel for each can be used.
  • For force assignment (read from lattice, write to particle) the calculations are independent for each particle.
  • for charge assignment (particle to mesh), atomic adds have to be used when writing to the mesh, as several particles can contribute to the same mesh sites

Parallel FFT

  • @jngrad has separated the P3M from the FFT logic
  • A parallel FFT implementation has to be wrapped in a sub-class of FFTBackend
  • Currently, the data type of the meshes (e.g. res_mesh) is hard-coded in the FFTBackend class. This might have to be revisited.

K-Space calculations

  • @jngrad has introduced a for_each_3d algorithm for the lattice loops.
  • To my understanding, the iterations (i.e., calculations for different k-vectors) are independent from each other, so parallelization can be achieved by writing a Kokkos aware for_each_3d (if it not already exists in Kokkos)
@RudolfWeeber
Copy link
Contributor Author

Discussion elsewhere: to parallelize the loops, the meshes would have to be represented as Kokkos views.

I looked into this, briefly.

To bring this in iteratlively, one could begin by creating a Kokkos unmanaged view which points to the memory of the meshes.
In this way, Kokkos parallel loops can be leveraged immediately, and the underlying storage can be replaced separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant