-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dashboard docs for queuing (dask#9660)
- Loading branch information
Showing
6 changed files
with
104 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
""" | ||
This script was run to produce some of the screenshots on https://docs.dask.org/en/stable/dashboard.html | ||
""" | ||
import time | ||
|
||
from dask import delayed | ||
from dask.distributed import Client, wait | ||
|
||
|
||
@delayed | ||
def inc(x): | ||
time.sleep(0.1) | ||
return x + 1 | ||
|
||
|
||
@delayed | ||
def double(x): | ||
time.sleep(0.1) | ||
return 2 * x | ||
|
||
|
||
@delayed | ||
def add(x, y): | ||
time.sleep(0.1) | ||
return x + y | ||
|
||
|
||
if __name__ == "__main__": | ||
with Client(n_workers=4, threads_per_worker=2, memory_limit="4 GiB") as client: | ||
while True: | ||
data = list(range(1000)) | ||
output = [] | ||
for x in data: | ||
a = inc(x) | ||
b = double(x) | ||
c = add(a, b) | ||
output.append(c) | ||
|
||
total = delayed(sum)(output) | ||
total = total.persist() | ||
wait(total) | ||
time.sleep(5) | ||
del total | ||
time.sleep(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.