Skip to content

Commit

Permalink
remove global multiprocessing.set_start_method (#8343)
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram authored Apr 11, 2024
1 parent 8ac7060 commit fb8605c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
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 @@ def disperse_chunk(self, c, order, wmin, wmax, sens_waves, sens_resp):

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
all_res = mypool.imap_unordered(dispersed_pixel, pars) # Fill the pool
mypool.close() # Drain the pool
else:
Expand Down

0 comments on commit fb8605c

Please sign in to comment.