uqfoundation / ppft

distributed and parallel Python
http://ppft.rtfd.io
Other
65 stars 14 forks source link

Python 3.13: Traceback during execution of tests #61

Open penguinpee opened 2 weeks ago

penguinpee commented 2 weeks ago

Fedora is preparing for the upcoming release of Python 3.13. Executing the tests with Python 3.13.0b2 leads to tracebacks:

Usage: python auto_diff.py [ncpus]
    [ncpus] - the number of workers to run in parallel,
    if omitted it will be set to the number of processors in the system
Starting pp with 3 workers
A fatal error has occured during the function execution
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-ppft-1.7.6.8-build/BUILDROOT/usr/lib/python3.13/site-packages/ppft/__main__.py", line 95, in run
    __args = pickle.loads(ppc.b_(__sargs))
AttributeError: Can't get attribute 'PartialSum' on <module 'ppft.__main__' from '/builddir/build/BUILD/python-ppft-1.7.6.8-build/BUILDROOT/usr/lib/python3.13/site-packages/ppft/__main__.py'>
 Traceback (most recent call last):
  File "/builddir/build/BUILD/python-ppft-1.7.6.8-build/BUILDROOT/usr/lib/python3.13/site-packages/ppft/tests/auto_diff.py", line 124, in <module>
    print("t_log(%lf) = %lf, t_log'(%lf) = %lf" % (x, val.x, x, val.dx))
                                                      ^^^^^
AttributeError: 'NoneType' object has no attribute 'x'

I've also observed:

Usage: python quicksort.py [ncpus]
    [ncpus] - the number of workers to run in parallel, 
    if omitted it will be set to the number of processors in the system

Starting pp with 8 workers
A fatal error has occured during the function execution
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-ppft-1.7.6.8-build/BUILDROOT/usr/lib/python3.13/site-packages/ppft/__main__.py", line 97, in run
    __f = locals()[ppc.str_(__fname)]
          ~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'quicksort'
 Traceback (most recent call last):
  File "/builddir/build/BUILD/python-ppft-1.7.6.8-build/BUILDROOT/usr/lib/python3.13/site-packages/ppft/tests/quicksort.py", line 59, in <module>
    output.extend(x())
    ~~~~~~~~~~~~~^^^^^
TypeError: 'NoneType' object is not iterable
mmckerns commented 1 week ago

Thanks for submitting the issue. I am aware of it. There's some issues that changes in python 3.13 starting around 0a5 have impacted dill as python has made some significant changes to core infrastructure to enable multi-threading.