On Sun, Dec 19, 2021 at 1:46 PM MRAB <pyt...@mrabarnett.plus.com> wrote:
> On 2021-12-19 20:06, Tigran Aivazian wrote: > > So far I have narrowed it down to a block of code in solve.py doing a > lot of multi-threaded FFT (i.e. with fft(..., threads=6) of pyFFTW), as > well as numpy exp() and other functions and pure Python heavy list > manipulation (yes, lists, not numpy arrays). > The Python interpreter does have the GIL (Global Interpreter Lock). It > can't execute Python bytecodes in parallel, but timeshares between the > threads. > Sure. But what the OP seems to have discovered is that there is some difference in behavior between 3.8 and 3.10 -- and AFIAK, there are not intended major changes in the GIL between those two releases. I *think* that all of the issues have involved numpy (pyFFTW depends on numpy as well), and certainly matplotlib does) -- but I think the OP has made sure that the numpy (and other libs) versions are all the same. There still remains to confirm that numpy (and other libs) are built exactly the same way in the py3.8 and 3.10 versions -- this can be a very complicated stack! But it seems either cPython itself, or numpy (or Cyhton?) is doing something different. Still to be discovered what that is. Note the OP: make sure that it's not as simple as a change to the default for the threads parameter. Note2: even if this is a regression cPython itself, I suspect the numpy list may be a better wey to get it figured out. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/DEBHSISDF45B3XTOYNM34WUB7GOPJRNV/ Code of Conduct: http://python.org/psf/codeofconduct/