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

Add an option to build SWIG python bindings with threads enabled #1762

Open
kkg4theweb opened this issue Sep 22, 2021 · 2 comments
Open

Add an option to build SWIG python bindings with threads enabled #1762

kkg4theweb opened this issue Sep 22, 2021 · 2 comments

Comments

@kkg4theweb
Copy link
Contributor

MEEP is currently built with threads disabled by default for the SWIG python bindings. This means all calls swigged C++ code hold the GIL by default. This has the unfortunate side-effect of long running MEEP calls holding up the python interpreter and not being able to do anything else in parallel even if it is safe to do so.

We have a few options

  1. Do nothing
  2. Release the GIL on selected calls that we know to be long-running
  3. Enable 'threads' (optionally) for ALL of SWIG python bindings
@smartalecH
Copy link
Collaborator

Similar discussion here.

@smartalecH
Copy link
Collaborator

Does #1762 resolve this (very nice work btw)?

Did you by chance run any experiments to see if this works well (e.g. running on 1 proc with multiple threads and comparing speedup to before)? I see it's been added to CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants