Skip to content

Commit

Permalink
allow asynchronous in LocalCluster
Browse files Browse the repository at this point in the history
  • Loading branch information
landmanbester committed Nov 20, 2023
1 parent b482e41 commit 19228a7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pfb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ def set_client(opts, stack, log, scheduler='distributed'):
from dask.distributed import Client, LocalCluster
print("Initialising client with LocalCluster.", file=log)
with dask.config.set({"distributed.scheduler.worker-saturation": 1.1}):
cluster = LocalCluster(processes=True, n_workers=opts.nworkers,
threads_per_worker=opts.nthreads_dask,
memory_limit=0) # str(mem_limit/nworkers)+'GB'
cluster = LocalCluster(processes=opts.nworkers > 1,
n_workers=opts.nworkers,
threads_per_worker=opts.nthreads_dask,
memory_limit=0, # str(mem_limit/nworkers)+'GB'
asynchronous=True)
cluster = stack.enter_context(cluster)
client = stack.enter_context(Client(cluster))

Expand Down

0 comments on commit 19228a7

Please sign in to comment.