pydstool icon indicating copy to clipboard operation
pydstool copied to clipboard

Inefficient memory usage

Open z2v opened this issue 10 years ago • 4 comments

While preparing data to be returned to Python, function PackOut (PyDSTool/integrator/interface.c) makes a copy of all computed data and doubles amount of used memory as a result.

z2v avatar Nov 21 '14 21:11 z2v

@z2v Do you know that it's safe to not copy based on possible need for the original data at a later time? For instance, could the returned data be changed in the interface or in python and affect the contents of the solver that might be needed e.g. for continuing an orbit?

robclewley avatar Apr 27 '15 04:04 robclewley

@robclewley, AFAIK, both radau and dopri are single-step methods and previously computed trajectory data is not used in solvers.

z2v avatar Apr 28 '15 15:04 z2v

We can test it without the memory copy, then. My only concern is something like compute's continue integration option, but we have a test for that use case.

robclewley avatar Apr 28 '15 17:04 robclewley

It makes me nervous because it has been almost 10 years since the interface was written by my colleague, and I feel like there could have been a reason that I no longer remember. But since we are keeping a record of this discussion, we might as well try taking out the copy and testing the result. I can also see if I need to think up further tests than we already have to check that all is well.

robclewley avatar Apr 30 '15 21:04 robclewley