@@ -336,30 +336,32 @@ class LinearNDInterpolator(NDInterpolatorBase):
336
336
eps = 100 * DBL_EPSILON
337
337
eps_broad = sqrt(DBL_EPSILON)
338
338
339
- with nogil:
340
- for i in range (xi.shape[0 ]):
339
+ # NOTE: a nogil block segfaults here with Python 3.10
340
+ # and 3.11 on x86_64 Ubuntu Linux with gcc 9.x and 11.x
341
+ # and therefore nogil was disabled to fix gh-21885
342
+ for i in range (xi.shape[0 ]):
341
343
342
- # 1) Find the simplex
344
+ # 1) Find the simplex
343
345
344
- isimplex = qhull._find_simplex(& info, c,
345
- & xi[0 ,0 ] + i* ndim,
346
- & start, eps, eps_broad)
346
+ isimplex = qhull._find_simplex(& info, c,
347
+ & xi[0 ,0 ] + i* ndim,
348
+ & start, eps, eps_broad)
347
349
348
- # 2) Linear barycentric interpolation
349
-
350
- if isimplex == - 1 :
351
- # don't extrapolate
352
- for k in range (nvalues):
353
- out[i,k] = fill_value
354
- continue
350
+ # 2) Linear barycentric interpolation
355
351
352
+ if isimplex == - 1 :
353
+ # don't extrapolate
356
354
for k in range (nvalues):
357
- out[i,k] = 0
355
+ out[i,k] = fill_value
356
+ continue
358
357
359
- for j in range (ndim+ 1 ):
360
- for k in range (nvalues):
361
- m = simplices[isimplex,j]
362
- out[i,k] = out[i,k] + c[j] * values[m,k]
358
+ for k in range (nvalues):
359
+ out[i,k] = 0
360
+
361
+ for j in range (ndim+ 1 ):
362
+ for k in range (nvalues):
363
+ m = simplices[isimplex,j]
364
+ out[i,k] = out[i,k] + c[j] * values[m,k]
363
365
364
366
return out
365
367
0 commit comments