Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bf3635c

Browse files
committedJun 2, 2017
examples: polish yarn example
1 parent d5fd06a commit bf3635c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
 

‎examples/joblib_yarn_parallel.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
if __name__ == '__main__':
99
register_parallel_backend('yarn', YarnBackend)
10-
with parallel_backend('yarn', n_jobs=1):
11-
Parallel(verbose=100)(
12-
delayed(sqrt)(i**2) for i in range(100))
10+
11+
# Run in parallel using Yarn backend
12+
with parallel_backend('yarn', n_jobs=5):
13+
print(Parallel(verbose=100)(
14+
delayed(sqrt)(i**2) for i in range(100)))
15+
16+
# Should be executed in parallel locally
17+
print(Parallel(verbose=100, n_jobs=5)(
18+
delayed(sqrt)(i**2) for i in range(100))

0 commit comments

Comments
 (0)
Please sign in to comment.