# Balancing core load when number of particles in cells vary (PIC on GPU)

Consider this basic scheme for particle in cell simulations ( with just short-range interactions ):

1. assign particles to disjunct cells
2. for cell $A$ go over neighboring cells $B$
• for each particle $a_i$ in $A$ interact with all $b_i$ in $B$
3. move all particles

For GPU is very important memory locality. Therefore it make sense to assign each cell-cell interaction $(A,B)$ to one work-group, which can share __local buffer of $a_i$s. But it may very well happen that some cells are empty and other are filled with very varying numbers of particles $n$. => each work group would have to process very different number of interaction $N = n_A . n_B$ between particle pairs $(a_i,b_i)$. They will have problem to synchronize.

I guess this is some commonplace problem in PIC, GPGPU and parallel computing. But I have seen just introductory tutorials and codes, without much care of optimizations. I would be happy for reference to good and concise learning resources.

• I guess you can have a look at a library like cs.sandia.gov/zoltan/Zoltan_phil.html – Vikram Mar 27 '17 at 8:29
• perhaps for production, but I would like something for learning the essential strategies ... this Zoltan does not seem to be even opensource – Prokop Hapala Mar 27 '17 at 8:38
• It'll depend a bit on your personal definition of open source, but if you look at the download page, Zoltan is available under three fairly standard licences (GPL, LGPL and BSD). – origimbo Mar 27 '17 at 10:21
• Zoltan IS open source, and not only can you look at the source, you can look at their publications as well cs.sandia.gov/zoltan/Zoltan_pubs.html – Vikram Mar 28 '17 at 8:33
• OK, thanks that's useful. But still I would like some more introductory learning resources than these state-of-the art library and papers. – Prokop Hapala Mar 28 '17 at 10:02