tile
Safe HaskellNone
LanguageGHC2024

Tile.Schedule

Description

A schedule is a list of directed send steps. This module defines the schedule representation and the primitive functions that turn tile relationships into member-to-member communication edges.

Divergence schedule
Edges run from root toward leaves. This is the form produced by buildSchedule and accepted by every collective in Tile.Execution and Tile.Execution.Concurrent.
Convergence schedule
Edges run from leaves toward root. Obtained by applying reverseSchedule to a divergence schedule. Execution APIs derive convergence internally where needed; callers rarely need it directly.
Synopsis

Schedule representation

data Step a Source #

A directed communication step from one member to another.

Constructors

Step 

Fields

  • from :: a

    Sender.

  • to :: a

    Receiver.

Instances

Instances details
Eq a => Eq (Step a) Source # 
Instance details

Defined in Tile.Schedule

Methods

(==) :: Step a -> Step a -> Bool #

(/=) :: Step a -> Step a -> Bool #

Ord a => Ord (Step a) Source # 
Instance details

Defined in Tile.Schedule

Methods

compare :: Step a -> Step a -> Ordering #

(<) :: Step a -> Step a -> Bool #

(<=) :: Step a -> Step a -> Bool #

(>) :: Step a -> Step a -> Bool #

(>=) :: Step a -> Step a -> Bool #

max :: Step a -> Step a -> Step a #

min :: Step a -> Step a -> Step a #

Show a => Show (Step a) Source # 
Instance details

Defined in Tile.Schedule

Methods

showsPrec :: Int -> Step a -> ShowS #

show :: Step a -> String #

showList :: [Step a] -> ShowS #

type Schedule a = [Step a] Source #

A communication schedule: an ordered list of directed steps.

data RoutedSchedule a Source #

A schedule with an explicit ingress member.

Under occlusion, the ingress may differ from the natural root of the starting tile.

Constructors

RoutedSchedule 

Fields

Instances

Instances details
Eq a => Eq (RoutedSchedule a) Source # 
Instance details

Defined in Tile.Schedule

Show a => Show (RoutedSchedule a) Source # 
Instance details

Defined in Tile.Schedule

adjacencyList :: Ord a => Schedule a -> Map a [a] Source #

Group schedule steps by sender.

Occlusion

newtype Occlusion a Source #

A predicate describing unavailable members.

Constructors

Occlusion 

Fields

representative :: Eq a => Occlusion a -> [a] -> Tile -> Maybe a Source #

Choose the first non-occluded member in a tile.

Step construction

stepFor :: [a] -> Tile -> Tile -> Maybe (Step a) Source #

Build a fault-free step from a parent tile to a child tile.

Returns Nothing when the two tiles have the same root, since that would be a self-edge.

stepForOccluded :: Eq a => Occlusion a -> [a] -> Tile -> Tile -> Maybe (Step a) Source #

Build a step using live representatives for the parent and child.

Returns Nothing if either tile has no representative or if both tiles choose the same representative.

Reversal

reverseStep :: Step a -> Step a Source #

Reverse the direction of one step, converting a divergence edge to a convergence edge or vice versa.

reverseSchedule :: Schedule a -> Schedule a Source #

Convert a divergence schedule to a convergence schedule, or vice versa, by reversing every step.