Skip to content

Commit

Permalink
use forkserver in wfss_contam
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Apr 5, 2024
1 parent 6bc88d5 commit 55f864d
Showing 1 changed file with 3 additions and 2 deletions.
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

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

0 comments on commit 55f864d

Please sign in to comment.