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

specextract use make_tool instead of importing global instance #730

Closed
kglotfelty opened this issue Jan 18, 2023 · 2 comments
Closed

specextract use make_tool instead of importing global instance #730

kglotfelty opened this issue Jan 18, 2023 · 2 comments

Comments

@kglotfelty
Copy link
Member

We should look at replacing the import of individual tools

from ciao_contrib.runtool import dmstat, dmcoords, dmlist, acis_fef_lookup, get_sky_limits, new_pfiles_environment

with using make_tool in the places where they are used.

from ciao_contrib.runtool import make_tool
dmstat = make_tool("dmstat")

This is especially important for dmstat which is storing info back into it's own parameter file and especially when running in parallel. Since this is imported into the global scope, all the paralell threads are updating the same object. If you create separate objects for each parallel thread then no race condition.

This should help remove the need for so many new_pfiles_environemnt contexts.

@DougBurke
Copy link
Member

@nplee does #736 close this issue, or is it worth keeping open?

@nplee
Copy link
Contributor

nplee commented May 16, 2023 via email

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

No branches or pull requests

3 participants