test if __finalizeFemModule__ at Python exit is needed
solvers.py
fails on github (and for me locally) if the finalize of the MPIManager
is included in the atexit
function of dune/fem/__init__.py
.
The failure only occurs if petsc spaces are used (actually only if a petsc discrete function is constructed).
It works fine without that explicit finalize (as do all other scripts). Possibly this is not needed anymore (and is harmful) but there might be other cases or mpi implementations were removing this will cause errors.
Tests
- master fails with Python 3.6 and 3.11 (our standard github setup).
- After change still fails with Python 3.6 https://github.com/adedner/dune-testpypi/actions/runs/3435850308/jobs/5728713128
- but changes seem to fix things with Python 3.11 https://github.com/adedner/dune-testpypi/actions/runs/3435850308/jobs/5728713282
- This branch work fine on github if changing workflow to use Python 3.8 and 3.11 https://github.com/adedner/dune-testpypi/actions/runs/3436750762
Using petsc 3.18.1 petsc4py 3.18.1
Edited by Andreas Dedner