Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove global multiprocessing.set_start_method #8343

Merged
merged 2 commits into from
Apr 11, 2024
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
3 changes: 0 additions & 3 deletions jwst/jump/jump_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
from ..stpipe import Step
from .jump import run_detect_jumps
import time
import multiprocessing

__all__ = ["JumpStep"]

multiprocessing.set_start_method('forkserver', force=True)


class JumpStep(Step):
"""
Expand Down
2 changes: 0 additions & 2 deletions jwst/ramp_fitting/ramp_fit_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
import logging
import copy
import warnings
import multiprocessing

log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)

multiprocessing.set_start_method('forkserver', force=True)


__all__ = ["RampFitStep"]
Expand Down
5 changes: 3 additions & 2 deletions jwst/wfss_contam/observations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time
import multiprocessing
import numpy as np
from multiprocessing import Pool

from scipy import sparse

Expand Down Expand Up @@ -259,7 +259,8 @@

time1 = time.time()
if self.max_cpu > 1:
mypool = Pool(self.max_cpu) # Create the pool
ctx = multiprocessing.get_context("forkserver")
mypool = ctx.Pool(self.max_cpu) # Create the pool

Check warning on line 263 in jwst/wfss_contam/observations.py

View check run for this annotation

Codecov / codecov/patch

jwst/wfss_contam/observations.py#L262-L263

Added lines #L262 - L263 were not covered by tests
all_res = mypool.imap_unordered(dispersed_pixel, pars) # Fill the pool
mypool.close() # Drain the pool
else:
Expand Down