pyccel / psydac

Python 3 library for isogeometric analysis
https://pyccel.github.io/psydac/
MIT License
52 stars 18 forks source link

Avoid MPI memory leaks on persistent communication #263

Closed yguclu closed 1 year ago

yguclu commented 1 year ago

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()
yguclu commented 1 year ago

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.

CC: @saidctb