Skip to main content

Module schedule

Module schedule 

Source
Expand description

Building the dependency graph of a region and generating its concurrent schedule.

A region is a run of nodes between barriers. Its graph has an edge u -> v whenever v must wait for u (depends). Nodes with a single predecessor whose predecessor has a single successor are fused into chains, so per-item pipelines (a1 -> b1, a2 -> b2) proceed independently. Chains are then leveled; each level with two or more chains becomes one join of their futures, and the results are bound in program order.

Structs§

ChainCode 🔒
Generated code for one chain.
DropMut 🔒
Drops mut from bindings the chain does not write.
Plan 🔒
The schedule of one region.
StripHints 🔒
Removes psync’s hint attributes (seq, fresh, independent), which only guide the analysis.

Functions§

cert_nodes 🔒
Each node’s places, for the region’s certificate: one place per reason depends can give, so that two nodes have no edge only if neither writes a place the other touches (the checker in verify/Cert.lean may be stricter than depends, never more lenient).
chain_code 🔒
Generate a chain body: the members’ statements in order, with early exits recorded instead of taken. needed lists names used after the chain; extra adds bindings defined outside the members (a loop’s pattern) that should be handed back too.
chain_code_with 🔒
chain_code, optionally storing the index of the member about to run in the atomic progress (synchronous code: a panic is replayed at the member that raised it).
depends 🔒
Why b (later in the program) must wait for a (earlier), if it must.
emit 🔒
Generate a region’s statements from its plan. positions are the nodes’ statement indices in the block and mentions what each statement of the block mentions.
plan 🔒
Build the graph, fuse chains and level them.
reachable 🔒
The nodes that (transitively) depend on from; nodes are in program order, so edges go forward.
strip_expr_hints 🔒
Removes hints from an expression statement’s own attributes.