mpi_array.indexing.calc_intersection_split

mpi_array.indexing.calc_intersection_split(dst_extent, src_extent, update_factory, update_dst_halo)[source]

Calculates intersection between dst_extent and {src_extent}. Any regions of dst_extent which do not intersect with src_extent are returned as a list of left-over type(dst_extent) elements. The regions of dst_extent which do intersect with src_extent are returned as a list of update elements. The update elements are created with a call to the factory object update_factory:

update_factory(dst_extent, src_extent, intersection)

Returns tuple pair (leftovers, updates).

Parameters:
  • dst_extent (HaloIndexingExtent) – Extent which is to receive update from intersection with src_extent.
  • src_extent (HaloIndexingExtent) – Extent which is to provide update for the intersecting region of dst_extent.
  • update_factory (callable object) – Object called to create instances of mpi_array.decomposition.PairUpdateExtent.
  • update_dst_halo (bool) – If true, then the halo of dst_extent is include when calculating the intersection with src_extent.
Return type:

tuple

Returns:

Returns tuple pair of (leftovers, updates).