Prevent C-level exceptions in NearestNeighbors from crashing jupyter notebook kernels

Issue #126 resolved
Bryan Vansaders created an issue

If the r_cut is set larger than half the box size in NearestNeighbors, then there is a C-level exception that crashes jupyter notebook kernels. Should display errors of this type inside the notebook instead of killing the kernel

Comments (9)

  1. Matthew Spellings

    Can you test adding an 'except +' to the end of the line in freud/_locality.pxd for the compute() method of NearestNeighbors?

  2. Bryan Vansaders reporter

    changing the line to:

    void compute(const box.Box&, const vec3[float], unsigned int, const vec3[float], unsigned int) nogil except +

    had no effect

  3. Matthew Spellings

    You did regenerate the _freud.cpp (i.e. run cmake with -DENABLE_CYTHON=on and having a working cython installation), right?

  4. Bryan Vansaders reporter

    Yes, the cython flag was on (and cmake found it) and all previous build files were cleared. No effect

  5. Bryan Vansaders reporter

    fix_cpp_exceptions branch does not change the behavior.

    Specifically, when the rcut for neighbor searching is set to more than half the box, the kernel crashes and the following error is output to the kernel log:

    'libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Cannot generate a cell list where cell_width is larger than half the box.'

  6. Log in to comment