The channels for persistent MPI communications should be freed upon deletion of any object of class StencilVector. If we do not do so, the creation of many temporary vectors (e.g. in a CG solver) will cause a memory leak and eventually an out-of-memory error.
This can be obtained with the following magic function:
def __del__(self):
if self._requests:
for request in self._requests:
request.Free()
This memory leak was observed in parallel mode on different operating systems (Ubuntu 20.04, macOS 10.15, Windows) but only when periodic boundary conditions are employed.
The channels for persistent MPI communications should be freed upon deletion of any object of class
StencilVector
. If we do not do so, the creation of many temporary vectors (e.g. in a CG solver) will cause a memory leak and eventually an out-of-memory error.This can be obtained with the following magic function: