File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 3838 zfpy = None
3939
4040default_cpus = cpu_count (logical = True )
41- NUM_CPUS = int (os .getenv ("MDIO__IMPORT__CPU_COUNT" , default_cpus ))
4241
4342
4443def to_zarr (
@@ -119,7 +118,8 @@ def to_zarr(
119118 # For Unix async writes with s3fs/fsspec & multiprocessing,
120119 # use 'spawn' instead of default 'fork' to avoid deadlocks
121120 # on cloud stores. Slower but necessary. Default on Windows.
122- num_workers = min (num_chunks , NUM_CPUS )
121+ num_cpus = int (os .getenv ("MDIO__IMPORT__CPU_COUNT" , default_cpus ))
122+ num_workers = min (num_chunks , num_cpus )
123123 context = mp .get_context ("spawn" )
124124 executor = ProcessPoolExecutor (max_workers = num_workers , mp_context = context )
125125
Original file line number Diff line number Diff line change 2121 from segy import SegyFile
2222
2323default_cpus = cpu_count (logical = True )
24- NUM_CPUS = int (os .getenv ("MDIO__IMPORT__CPU_COUNT" , default_cpus ))
2524
2625
2726def parse_index_headers (
@@ -54,7 +53,8 @@ def parse_index_headers(
5453 # For Unix async reads with s3fs/fsspec & multiprocessing,
5554 # use 'spawn' instead of default 'fork' to avoid deadlocks
5655 # on cloud stores. Slower but necessary. Default on Windows.
57- num_workers = min (n_blocks , NUM_CPUS )
56+ num_cpus = int (os .getenv ("MDIO__IMPORT__CPU_COUNT" , default_cpus ))
57+ num_workers = min (n_blocks , num_cpus )
5858 context = mp .get_context ("spawn" )
5959
6060 tqdm_kw = dict (unit = "block" , dynamic_ncols = True )
You can’t perform that action at this time.
0 commit comments