Dask is a flexible library for parallel computing in Python.

This piece of code define some simple functions.

def inc(x):
    return x + 1

def double(x):
    return x + 2

def add(x, y):
    return x + y

data = [1, 2, 3, 4, 5]

output = []
for x in data:
    a = inc(x)
    b = double(x)
    c = add(a, b)

total = sum(output)

this piece of code wraps the functions above, and defer their execution.

x = dask.delayed(inc)(1)
y = dask.delayed(inc)(2)
z = dask.delayed(add)(x, y)

and this task graph

enter image description here


is the symbol here a general graph notation? is this a kind of graph language, like UML for visualizing the design of a system, used to visualize the computation task?


It's... a visualization. Don't read too much into it. Graphs in computer science are formalized, but unless specifically mentioned a visualization of a graph doesn't have a formal underpinning. They're generally self-explanatory, there are objects (nodes) and arrows (edges).

UML is more of the exception than the rule, being a graphical language with a formal interpretation. Most visualizations in computer science aren't that strict in meaning.

Here it seems that the round nodes are functions, the square nodes are (temporary) variables, and the arrows indicate data flow.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.