Skip to content

Non-square layouts are not supported by halo updates #408

@mcgibbon

Description

@mcgibbon

As written, the halo update code in Pace does not support non-square MPI layouts (e.g. where a tile is decomposed into 3x2 ranks). This is because the abstractions for partitioning of ranks currently assume that for a given rank and a given direction, there is only one rank bordering in that direction. Fortunately, this assumption is not required by anything using the code which has this abstraction.

To fix this, the Partitioner class must be refactored, replacing the boundary(self, boundary_type: int, rank: int) -> Optional[bd.SimpleBoundary]: method with a boundaries(self): -> Iterable[bd.SimpleBoundary] method, and code which currently calls boundary while iterating over directions should instead iterate over the boundaries. Once this is done, the implementation of boundaries can be modified to support non-square layouts, which should make it so that all halo update code works for non-square layouts.

I would strongly recommend test-driven development for this modification, similar to the current partitioner boundaries tests. In developing the current code, it was very, very helpful to be able to try various "guesses" as to what code would work until something passed the (extensive) test cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions