Skip to content

Commit d21c13c

Browse files
committed
🩹 Writing variables is limited to the worker used.
1 parent 7615e7f commit d21c13c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

zcollection/storage.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import dask.local
2121
import fsspec
2222
import numcodecs.abc
23+
import numcodecs.blosc
2324
import numpy
2425
import zarr
2526

@@ -39,6 +40,9 @@
3940
#: Module logger.
4041
_LOGGER: logging.Logger = logging.getLogger(__name__)
4142

43+
#: Disable multithreading in Blosc to avoid competing with Dask.
44+
numcodecs.blosc.use_threads = False
45+
4246

4347
def execute_transaction(
4448
client: dask.distributed.Client,
@@ -247,13 +251,16 @@ def write_zarr_group(
247251
futures: list[Any] = client.map(
248252
write_zarr_variable,
249253
iterables,
250-
batch_size=64,
251254
block_size_limit=zds.block_size_limit,
252255
chunks=zds.chunks,
253256
dirname=dirname,
254257
fs=fs,
255258
)
256-
execute_transaction(client, sync.NoSync(), futures)
259+
execute_transaction(
260+
client,
261+
sync.NoSync(),
262+
futures,
263+
workers=dask.distributed.get_worker().address)
257264
else:
258265
tuple(
259266
map(

0 commit comments

Comments
 (0)