Ensure LAMMPS pointer is of type c_void_p
Fixes segfaults caused by API change. The API change in lammps_open and lammps_open_no_mpi makes them return the LAMMPS pointer via their return value. However due to how ctypes operates, even if restype is specified to be c_void_p, the function returns an integer. Without the proper type of the pointer, calling functions without arglists would default to using 32bit integers to pass an argument, which cuts away parts of the 64bit pointer. Subsequently, resolving the truncated pointer in the library causes segfaults. This commit fixes the root cause. But it also highlights the need of specifying the arglists of all library functions.
Loading
Please sign in to comment