Skip to content

Commit 068501f

Browse files
Try to fix on Google Colab
1 parent ec02a9f commit 068501f

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

insardev_pygmtsar/insardev_pygmtsar/S1_transform.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -978,17 +978,10 @@ def process_burst_dates_parallel(bursts, target, n_jobs_inner, scheduler_inner=N
978978
calibration_xml, noise_xml, reference_height, debug
979979
))
980980

981-
# Use ProcessPoolExecutor or ThreadPoolExecutor based on scheduler
982-
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
983-
984-
if scheduler_inner == 'threads':
985-
with ThreadPoolExecutor(max_workers=n_jobs_inner) as executor:
986-
list(executor.map(_process_date_worker, worker_args))
987-
else:
988-
# Default: ProcessPoolExecutor with max_tasks_per_child=1 for memory isolation
989-
with ProcessPoolExecutor(max_workers=n_jobs_inner, mp_context=mp.get_context('spawn'),
990-
max_tasks_per_child=1) as executor:
991-
list(executor.map(_process_date_worker, worker_args))
981+
# Process dates in parallel using joblib
982+
joblib.Parallel(n_jobs=n_jobs_inner, backend=scheduler_inner)(
983+
joblib.delayed(_process_date_worker)(args) for args in worker_args
984+
)
992985

993986
# Cleanup and consolidate
994987
del topo, transform, prm_ref

0 commit comments

Comments
 (0)