Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pygenray/eigenrays.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def find_eigenrays(
# map individual eigen ray finding to different workers
if num_workers is None:
num_workers = mp.cpu_count()
with mp.Pool(num_workers) as pool:
with mp.get_context('spawn').Pool(num_workers) as pool:
results = list(tqdm(pool.imap(_find_single_eigenray, args_list), total=len(args_list), desc="Finding eigenrays"))

# Filter out None results and add successful rays
Expand Down
2 changes: 1 addition & 1 deletion src/pygenray/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def _process_ranges_chunked_parallel(c, r_chunks, n_cpus):

# Run in parallel with progress bar
all_results = []
with mp.Pool(processes=n_cpus) as pool:
with mp.get_context('spawn').Pool(processes=n_cpus) as pool:
for chunk_results in tqdm(
pool.imap(_process_chunk_worker, args_list),
total=len(r_chunks),
Expand Down
2 changes: 1 addition & 1 deletion src/pygenray/launch_rays.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def shoot_rays(
terminate_backwards=terminate_backwards
)

with mp.Pool(n_processes) as pool:
with mp.get_context('spawn').Pool(n_processes) as pool:
rays_ls = list(tqdm(pool.imap(shoot_ray_part, y0s), total=len(y0s), desc="Computing ray fan"))

ranges = np.linspace(source_range, receiver_range, num_range_save)
Expand Down
Loading