Utility

Helper Functions

ComputableDAGs.bytes_to_human_readableMethod
bytes_to_human_readable(bytes)

Return a human readable string representation of the given number.

julia> using ComputableDAGs

julia> ComputableDAGs.bytes_to_human_readable(4096)
"4.0 KiB"
source
ComputableDAGs.infer_types!Method
infer_types!(schedule::Vector{FunctionCall})

Infer the result type of each function call in the given schedule. Returns a dictionary with the result type for each Node. This assumes that each node has only one statically inferrable return type and will throw an exceptin otherwise. This also assumes that the given Vector contains a topological ordering of its nodes, such as returned by a call to schedule_dag.

source
ComputableDAGs.memMethod
mem(graph::DAG)

Return the memory footprint of the graph in Byte. Should be the same result as Base.summarysize(graph) but a lot faster.

source
ComputableDAGs.memMethod
mem(op::Operation)

Return the memory footprint of the node in Byte. Used in mem(graph::DAG). Unlike Base.summarysize() this doesn't follow all references which would yield (almost) the size of the entire graph.

source
ComputableDAGs.memMethod
mem(op::Operation)

Return the memory footprint of the operation in Byte. Used in mem(graph::DAG). Unlike Base.summarysize() this doesn't follow all references which would yield (almost) the size of the entire graph.

source
ComputableDAGs.sort_node!Method
sort_node!(node::Node)

Sort the nodes' parents and children vectors. The vectors are mostly very short so sorting does not take a lot of time. Sorted nodes are required to make the finding of NodeReductions a lot faster using the NodeTrie data structure.

source

Trie Helper

This is a simple implementation of a Trie Data Structure to greatly improve the performance of the Node Reduction search.

ComputableDAGs.NodeIdTrieType
NodeIdTrie

Helper struct for NodeTrie. After the Trie's first level, every Trie level contains the vector of nodes that had children up to that level, and the TrieNode's children by UUID of the node's children.

source
ComputableDAGs.NodeTrieType
NodeTrie

Trie data structure for node reduction, inserts nodes by children. Assumes that given nodes have ordered vectors of children (see sort_node!). First insertion level is the node's own task type and thus does not have a value (every node has a task type).

See also: insert! and collect

source
Base.collectMethod
collect(trie::NodeTrie)

Return all sets of at least 2 Nodes that have accumulated in leaves of the trie.

source
Base.insert!Method
insert!(trie::NodeTrie, node::Node)

Insert the given node into the trie. It's sorted by its type in the first layer, then by its children in the following layers.

source
ComputableDAGs.insert_helper!Method
insert_helper!(trie::NodeIdTrie, node::Node, depth::Int)

Insert the given node into the trie. The depth is used to iterate through the trie layers, while the function calls itself recursively until it ran through all children of the node.

source