1919from ..modeling .core import _make_arithmetic_operator , BINARY_OPERATORS
2020from ..modeling .core import _CompoundModelMeta
2121from .utils import KernelSizeError , has_even_axis , raise_even_kernel_exception
22- from ..utils .openmp import handle_n_threads_usage
2322
2423# Turn the faulthandler ON to help catch any signals, e.g. segfaults
2524# or asserts. This doesn't, currently, work with Jupyter Notebook.
7170@support_nddata (data = 'array' )
7271def convolve (array , kernel , boundary = 'fill' , fill_value = 0. ,
7372 nan_treatment = 'interpolate' , normalize_kernel = True , mask = None ,
74- preserve_nan = False , normalization_zero_tol = 1e-8 , n_threads = 0 ):
73+ preserve_nan = False , normalization_zero_tol = 1e-8 ):
7574 '''
7675 Convolve an array with a kernel.
7776
@@ -130,12 +129,6 @@ def convolve(array, kernel, boundary='fill', fill_value=0.,
130129 The absolute tolerance on whether the kernel is different than zero.
131130 If the kernel sums to zero to within this precision, it cannot be
132131 normalized. Default is "1e-8".
133- n_threads : int
134- The number of threads to use (default 0). 0 => use all. There is no
135- limit, be cautious if over commmiting resources.
136- Note that an exception is raised for negative values. A warning is issued
137- if n_threads>1 and astropy was NOT built with OpenMP support.
138- With DASK, it is more performant to set ``n_threads=1``.
139132
140133 Returns
141134 -------
@@ -159,7 +152,8 @@ def convolve(array, kernel, boundary='fill', fill_value=0.,
159152 if nan_treatment not in ('interpolate' , 'fill' ):
160153 raise ValueError ("nan_treatment must be one of 'interpolate','fill'" )
161154
162- n_threads = handle_n_threads_usage (n_threads )
155+ # Take extra measures to disable OpenMP support
156+ n_threads = 1
163157
164158 # Keep refs to originals
165159 passed_kernel = kernel
0 commit comments