mdolab / pysurf

pySurf provides geometric operations for triangulated surfaces.
Apache License 2.0
2 stars 4 forks source link

Potential incompatibility with Numpy 1.26.4 #37

Open bmlowe4 opened 2 months ago

bmlowe4 commented 2 months ago

Description

I've been getting some seg faults from the code when running with numpy 1.26.4. Behavior goes away when using numpy 1.22.4. If reproducible on your end, you could simply limit the numpy version in the setup.py.

Steps to reproduce issue

  1. pip install numpy==1.26.4
  2. cd /path/to/pysurf
  3. pip install .
  4. find yourself a nice cgns file
  5. run the python script: \ from pysurf import tsurf_tools from mpi4py import MPI nodes, sectionDict = tsurf_tools.getCGNSsections("path/to/file.cgns")

Current behavior

Seg fault, seems to be occuring on line 33 of tsurf_tools.py: arraySizes = cgnsAPI.cgnsapi.readcgns(inputFile, comm.py2f()) I put a print statement at the beginning of cgnsAPI.F90::readCGNS (line 70) in the Fortran code, but the code seg faults before getting there. MPT ERROR: Rank 0(g:0) received signal SIGSEGV(11)

Expected behavior

No seg fault.

Code versions

eirikurj commented 1 month ago

Hi and thanks for the issue. We have had issues with some numpy versions in the past. However, I am not able to replicate this issue that you are describing using our Intel container mdolab/public:u22-intel-impi-latest. Updating numpy to 1.26.4 and importing one of the test CGNS files (e.g., ./input_files/cube.cgns) seems to work without issue. I also tested this on another system (using GCC compiler and OpenMPI, and Python 3.12) without any issues. That being said, at the moment, we dont test nor support numpy 1.26.x, but we are in the process of updating the dependency versions we support and my quick test seems to work. For supported versions, please see our docs. The latest numpy version we support is 1.25.2, which I suggest you try. You might also want to try other patch version of numpy 1.26.