Flowgraphs [Experimental]#

Primary APIs#

pystencils.flow.block(func=None, /, preds=None, name=None)#

Define a flowgraph block using let syntax.

block is a decorator used to define flowgraph blocks using Python function syntax.

Parameters:
  • preds (-) – Predecessor nodes to this block

  • name (-) – Name of this block. If none is given, the function’s name will be used

  • func (Callable[[EquationsBlockBuilder], None] | None)

pystencils.flow.cases(func=None, /, preds=None, name=None)#

Define a flowgraph cases block.

cases is a decorator used to define flowgraph case blocks using Python function syntax.

Parameters:
pystencils.flow.tie(*nodes, name=None)#

Tie multiple nodes together into a flowgraph

Return type:

Flowgraph

Parameters:
pystencils.flow.subgraph(*args, preds=(), name=None)#
Return type:

Subgraph

Parameters:

Flowgraph Nodes#

Inheritance Diagram#

Inheritance diagram of pystencils.flow.flowgraph

Classes#

pystencils.flow.flowgraph.SymbolicMemoryLoc = pystencils.field.Field.Access | pystencils.sympyextensions.pointers.mem_acc | pystencils.grids.protocols.IFieldAccess#

Expression types that are valid memory locations and can be used on the LHS of Store.

Flowgraph

A closed flowgraph in canonical form.

FlowgraphAssignment

Base class for assignments.

Let

Let assignments define subexpressions to be used within the same EquationsBlock.

Export

Export assignments define subexpressions that can be used within the same EquationsBlock and its direct successors in the flowgraph.

Store

Store assignments represent writing a value to an abstract memory location.

Reduce

Reduce assignments perform reductions onto a target typed symbol with a given operation.

FlowgraphNode

Base class for data-flow graph nodes in pystencils.flow.

Top

A flowgraph's top node.

Bottom

A flowgraph's bottom node.

EquationsBlock

A block of symbol assignments in static single-assignment form.

Subgraph

Another flowgraph embedded as a subgraph.

Cases

Case distinction.

Builders#

EquationsBlockBuilder

Builder for equation blocks.

CasesBuilder

Canonicalization#

CanonicalizeFlowgraph

Check a flowgraph for consistency and transform it into canonical form.

CanonicalizationResult

Result of the flowgraph canonicalizer

CanonicalizationError

Indicates that a flowgraph violates a canonicality condition.