Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leaks in Simulation.get_eigenmode and enable building without MPB #558

Merged
merged 10 commits into from
Oct 18, 2018
Merged

Fix memory leaks in Simulation.get_eigenmode and enable building without MPB #558

merged 10 commits into from
Oct 18, 2018

Conversation

ChristopherHogan
Copy link
Contributor

There were actually 3 leaks here. Gk and kdom are now returned directly as Python objects (Gk via _get_eigenmode_Gk and kdom is a numpy array passed as an output argument to _get_eigenmode), so Python gc will handle them properly. Also added a destructor that calls destroy_eigenmode_data for meep::eigenmode_data.
@stevengj @oskooi

@stevengj
Copy link
Collaborator

We should make sure that Meep+Python compiles even if MPB is not installed. This might involve adding #ifdef HAVE_MPB at appropriate places.

@stevengj
Copy link
Collaborator

Would be nice to have a regression test for this. Maybe just compile Meep with MPB disabled (./configure ac_cv_header_mpb_h=no ....) and check that it compiles.

@ChristopherHogan ChristopherHogan changed the title Fix memory leaks in Simulation.get_eigenmode Fix memory leaks in Simulation.get_eigenmode and enable building without MPB Oct 18, 2018
@coveralls
Copy link

coveralls commented Oct 18, 2018

Coverage Status

Coverage increased (+0.06%) to 81.937% when pulling 4e8d9a3 on ChristopherHogan:chogan/mem_leak into f6786f9 on stevengj:master.

@stevengj stevengj merged commit 031a33b into NanoComp:master Oct 18, 2018
@ChristopherHogan ChristopherHogan deleted the chogan/mem_leak branch October 31, 2018 13:46
bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
…out MPB (NanoComp#558)

* Fix memory leaks in Simulation.get_eigenmode

* Enable building without MPB

* Wrong macro name in meep.i

* Build without MPB in travis

* Fix .travis syntax

* Include config.h

* Typo

* Stub out _get_eigenmode and pass preprocessor directives through SWIG

* Make config.h available to SWIG preprocessor

* Run make clean before building without MPB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants