LLNL / libROM

Model reduction library with an emphasis on large scale parallelism and linear subspace methods
https://www.librom.net
Other
201 stars 36 forks source link

add destructors and virtual destructor to DMD base and derived classes #160

Closed ebchin closed 1 year ago

ebchin commented 1 year ago

This PR adds destructors to delete allocated memory in CAROM::DMD, CAROM::NonuniformDMD, and CAROM::AdaptiveDMD.

dylan-copeland commented 1 year ago

@ebchin Did you run some DMD tests through valgrind to verify that all the memory is freed? Other memory leaks in libROM may be found, but it would be good at least to check the DMD classes.

ebchin commented 1 year ago

@ebchin Did you run some DMD tests through valgrind to verify that all the memory is freed? Other memory leaks in libROM may be found, but it would be good at least to check the DMD classes.

Thanks for the suggestion, @dylan-copeland. I ran dg_advection (serial) and valgrind found ~50 leaks in initialize_matrix() and factorize() in scalapack_f_wrapper.f90. I also fixed a few leaks in constructDMD().

ebchin commented 1 year ago

I just verified all of the other DMD examples are still working and I ran valgrind on heat_conduction. All of the leaks identified in heat_conduction within CAROM::DMD methods were limited to factorize() and initialize_matrix(). If there are no other concerns, I will squash and merge later today. Thanks!

chldkdtn commented 1 year ago

I just verified all of the other DMD examples are still working and I ran valgrind on heat_conduction. All of the leaks identified in heat_conduction within CAROM::DMD methods were limited to factorize() and initialize_matrix(). If there are no other concerns, I will squash and merge later today. Thanks!

Please go ahead and squash merge