From 39d033c3ddf452c64d4b7a39f6c12967ef675413 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Wed, 18 Oct 2023 15:58:38 -0400 Subject: [PATCH] Improved parallelization? investigating this --- adam_core/propagator/propagator.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/adam_core/propagator/propagator.py b/adam_core/propagator/propagator.py index 51c81c9f..f5609e12 100644 --- a/adam_core/propagator/propagator.py +++ b/adam_core/propagator/propagator.py @@ -195,10 +195,14 @@ def generate_ephemeris( max_workers=max_processes ) as executor: futures = [] + # Iterate off of all combined chunks of orbits and observers. for orbit_chunk in _iterate_chunks(orbits, chunk_size): - futures.append( - executor.submit(ephemeris_worker, orbit_chunk, observers, self) - ) + for observers_chunk in _iterate_chunks(observers, 1): + futures.append( + executor.submit( + ephemeris_worker, orbit_chunk, observers_chunk, self + ) + ) ephemeris_list = [] for future in concurrent.futures.as_completed(futures):