xnn.common.deploy.domain.choose_grid#

xnn.common.deploy.domain.choose_grid(n_domains, widths, halo)[source]#

The grid of n_domains sub-domains that evaluates the fewest ghosts.

Every cut axis adds a shell of thickness halo on both sides of a sub-domain; the grid minimizing the evaluated volume relative to the owned volume is returned.

Parameters:
  • n_domains (int) – Number of sub-domains (processes).

  • widths (sequence of float) – Width of the box along each axis (the distance between opposite faces).

  • halo (float) – Thickness of the ghost shell.

Returns:

Sub-domains along the three axes, with product n_domains.

Return type:

tuple of int