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

BUG: load_sample is not MPI-safe #4635

Closed
matthewturk opened this issue Aug 16, 2023 · 3 comments · Fixed by #4646
Closed

BUG: load_sample is not MPI-safe #4635

matthewturk opened this issue Aug 16, 2023 · 3 comments · Fixed by #4646
Labels

Comments

@matthewturk
Copy link
Member

We should decorate the appropriate function in load_sample so that it doesn't get run on all processors after enable_parallelism has been called.

@neutrinoceros
Copy link
Member

In fact almost the whole function would require special treatment to be parallel-safe. The current higher order function (yt.func.only_on_root) doesn't feel as appropriate as I'd like (though the goal is achievable with it), because it doesn't make processes await the working process (root).

I think this strategy would be better expressed as a new context manager.

@chrishavlin
Copy link
Contributor

I think this strategy would be better expressed as a new context manager.

does yt/utilities/parallel_tools/parallel_analysis_interface.parallel_root_only not work? that seems to dispatch a function call and block the other processes. and looks to be fine to use when enable_parallelism has not been called.

@chrishavlin
Copy link
Contributor

answered my own question -- and the answer is sort of. That parallel_root_only won't broadcast a result so would need to modify it to optionally broadcast a result (instead of the all_clear integer) or just write a new function... but I do have something that seems to work. I'll push it up in a moment.

@neutrinoceros neutrinoceros changed the title load_sample is not MPI-safe BUG: load_sample is not MPI-safe Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants