Skip to content

Python variable coefficients and memory leak issues

Dave Moxey requested to merge dmoxey/nektar:feature/python-improvements into master

This MR addresses some issues with the Python bindings and brings a few new functionalities:

  • It was possible for memory to be leaked or pre-emptively freed through the chain of C++ allocation -> Python -> C++, since the original C++ Array was not aware of the Python -> C++ step. This has been addressed by changing the Python pointers to a double pointer shared by all Arrays, in a similar manner to m_count, so that they can be updated during the conversion step.
  • Although reference counters seem to be accurate, segfaults can arise if C++ tries to deallocate Python arrays after execution has finished (i.e. whilst Python is cleaning up). Presumably this is because the gc is essentially ignoring reference counters during this step, so we bypass decrementing Python counters if Python is not initialised.
  • Support for passing variable coefficients added in the HelmSolve call.
  • A rudimentary wrapper for the Comm class has been added, which allows for at least a small amount of communication to be performed (mostly using AllReduce).
  • Some other minor function additions to the wrappers.
  • Documentation updated in the developer guide.

In addition this branch contains some other fixes:

  • The user guide and developer guide both build rather slowly due to the inclusion of the source tree to TEXINPUTS, which means file lookups are slow (due to lack of a texhash). This has been adjusted.
  • libccmio is no longer present in the original VisIt svn repository due to their transition to git. The URL has been updated to a backup svn repository.
  • Fix a small bug in ThirdPartyFFTW in case the file path includes regex symbols (e.g. +).
Edited by Dave Moxey

Merge request reports