Skip to content

Commit 8486672

Browse files
committed
Reordering to match original code
1 parent 1819ae1 commit 8486672

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/mdio/segy/_workers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,14 @@ def trace_worker( # noqa: PLR0913
110110
SummaryStatistics object containing statistics about the written traces.
111111
"""
112112
global _worker_segy_file
113-
# Setting the zarr config to 1 thread to ensure we honor the `MDIO__IMPORT__CPU_COUNT` environment variable.
114-
# The Zarr 3 engine utilizes multiple threads. This can lead to resource contention and unpredictable memory usage.
115-
zarr_config.set({"threading.max_workers": 1})
116113

117114
# Use the pre-opened segy file from worker initialization
118115
segy_file = _worker_segy_file
119116

117+
# Setting the zarr config to 1 thread to ensure we honor the `MDIO__IMPORT__CPU_COUNT` environment variable.
118+
# The Zarr 3 engine utilizes multiple threads. This can lead to resource contention and unpredictable memory usage.
119+
zarr_config.set({"threading.max_workers": 1})
120+
120121
region_slices = tuple(region.values())
121122
local_grid_map = grid_map[region_slices[:-1]] # minus last (vertical) axis
122123

0 commit comments

Comments
 (0)