ludwig-cf / ludwig

A lattice Boltzmann code for complex fluids
https://ludwig.epcc.ed.ac.uk
Other
54 stars 35 forks source link

Distribution halo swap #316

Open kevinstratford opened 3 months ago

kevinstratford commented 3 months ago

Distribution halo swap

This concerns the halo swap for the distributions which currently occurs in lb_data.c via lb_halo(). There are currently two implementations: an internal "host" implementation and a "target" implementation via halo_swap.c.

The intention is to replace the "target" implementation with one using GPU-aware MPI in a similar fashion to that seen in field.c. This will allow the removal of the code in hanlo_swap.c.

This will also provide a more effective halo swap for device applications.

Background

The mechanism for the halo swap is:

  1. Pack contiguous send buffers with the relevant data for transfers between up to 26 nearest-neighbours.
  2. [Conditional] Transfer send buffers from device to host.
  3. Undertake message passing between send and recv buffers.
  4. [Conditional] Transfer recv buffers to device.
  5. Unpack receive buffers to appropriate location in memory.

What's needed