WIP: Python variable coefficients and memory leak issues
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 thePython -> C++
step. This has been addressed by changing the Python pointers to a double pointer shared by all Arrays, in a similar manner tom_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 usingAllReduce
).