diff --git a/jwst/wfss_contam/observations.py b/jwst/wfss_contam/observations.py index 19aa05d7f8f..62b66dfcf63 100644 --- a/jwst/wfss_contam/observations.py +++ b/jwst/wfss_contam/observations.py @@ -1,6 +1,6 @@ import time +import multiprocessing import numpy as np -from multiprocessing import Pool from scipy import sparse @@ -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: