espressomd / espresso

The ESPResSo package
https://espressomd.org
GNU General Public License v3.0
222 stars 183 forks source link

LB: avoid double communicaiton #4921

Open RudolfWeeber opened 1 month ago

RudolfWeeber commented 1 month ago

In LB a lot of stuff is send aroudn twice in ghost comm:

Push scheme:

The final communication step is only there for particle coupling, which needs up to date velocities in ghost layers. Forces could be removed from that communication. The velocities could also be removed, as that info can be re-calculatd from the pdfs on the other side. Alternatively, the pdfs could be removed, as the velocities are communicated anyway. The only client of pdfs in ghost layers outside LB is the get_density_at_pos() function. If this is needed, the ghost comm could be done lazily once this is called, or a density field could be added to the output in the streaming step.

Pull scheme:

Here, there is only one communicatnio at the end, communicating pdfs, velocities and forces. The velocities could in principle be removed and re-calculated on the other side.

Right now, the final communication in the push and the pull scheme are done by the same funciton (ghost_communicaiton_pdfs), although the schemes have different comm requirements.