Skip to content

Commit

Permalink
Use concurrency in the README (#3428)
Browse files Browse the repository at this point in the history
  • Loading branch information
WardLT committed May 16, 2024
1 parent ca0f879 commit e55ed98
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 7 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ Parsl lets you chain functions together and will launch each function as inputs
return x + 1
@python_app
def g(x):
return x * 2
def g(x, y):
return x + y
# Start Parsl on a single computer
with parsl.load():
# These functions now return Futures, and can be chained
# These functions now return Futures
future = f(1)
assert future.result() == 2
future = g(f(1))
assert future.result() == 4
# Functions run concurrently, can be chained
f_a, f_b = f(2), f(3)
future = g(f_a, f_b)
assert future.result() == 7
Start with the `configuration quickstart <https://parsl.readthedocs.io/en/stable/quickstart.html#getting-started>`_ to learn how to tell Parsl how to use your computing resource,
Expand Down
6 changes: 4 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ Parsl lets you chain functions together and will launch each function as inputs
future = f(1)
assert future.result() == 2
future = g(f(1))
assert future.result() == 4
# Functions run concurrently, can be chained
f_a, f_b = f(2), f(3)
future = g(f_a, f_b)
assert future.result() == 7
Start with the `configuration quickstart <quickstart.html#getting-started>`_ to learn how to tell Parsl how to use your computing resource,
Expand Down

0 comments on commit e55ed98

Please sign in to comment.