File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1838,7 +1838,7 @@ def become_dask(
1838
1838
scheduler_args : dict
1839
1839
Keyword arguments (e.g. ip) to pass to the distributed.Scheduler constructor.
1840
1840
**worker_args
1841
- Any additional keyword arguments (e.g. ncores ) are passed to the distributed.Worker constructor.
1841
+ Any additional keyword arguments (e.g. nthreads ) are passed to the distributed.Worker constructor.
1842
1842
1843
1843
Returns
1844
1844
-------
@@ -1867,8 +1867,13 @@ def become_dask(
1867
1867
# Start a Worker on the selected engines:
1868
1868
worker_args ['address' ] = distributed_info ['address' ]
1869
1869
worker_args ['nanny' ] = nanny
1870
- # set default ncores=1, since that's how an IPython cluster is typically set up.
1871
- worker_args .setdefault ('ncores' , 1 )
1870
+ # distributed 2.0 renamed ncores to nthreads
1871
+ if int (distributed .__version__ .partition ("." )[0 ]) >= 2 :
1872
+ nthreads = "nthreads"
1873
+ else :
1874
+ nthreads = "ncores"
1875
+ # set default nthreads=1, since that's how an IPython cluster is typically set up.
1876
+ worker_args .setdefault (nthreads , 1 )
1872
1877
dview .apply_sync (util .become_dask_worker , ** worker_args )
1873
1878
1874
1879
# Finally, return a Client connected to the Scheduler
You can’t perform that action at this time.
0 commit comments