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

Reloading C++ modules each time a node executes #51

Open
borupdaniel opened this issue Jul 15, 2020 · 3 comments
Open

Reloading C++ modules each time a node executes #51

borupdaniel opened this issue Jul 15, 2020 · 3 comments

Comments

@borupdaniel
Copy link
Member

Per Jim, in previous versions of GPI PyMOD extensions would be re-loaded each time a node ran. This meant you could run gpi_make in the background and immediately use the new changes. The current behavior is not the same — now you have to re-launch GPI to use the newly compiled extension. I'm not sure if this is always consistent as I thought sometimes refreshing or re-placing the node would work, as did using the "imp.reload()" function in the node.

Ideal behavior: PyMOD extensions are re-loaded each time a node executes OR when a node is refreshed/replaced.

@borupdaniel
Copy link
Member Author

@aganders3 can you add any info on how this worked previously?

@aganders3
Copy link
Member

I don't think this was ever the case. I looked into this recently actually and it's pretty hard (unsafe) to reload c-extensions in Python without restarting the interpreter. If you find a way to do this cleanly please let me know!

I think Python changes still required a node reload (⌘-R) to take effect, but you could probably make this happen each run fairly easily.

With the second piece of information you might be able to hack something that would detect recompiled C/C++ code and re-import it, but it would be a hack (like renaming the file or something).

@aganders3
Copy link
Member

This covers some workarounds. Maybe with the node execution mode set to process it will work?

https://stackoverflow.com/a/8295590/333308

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