ytree-project / ytree

A yt-based merger-tree code.
Other
15 stars 10 forks source link

add parallel iterators for analysis #112

Closed brittonsmith closed 3 years ago

brittonsmith commented 3 years ago

PR Summary

This adds three new functions for parallel iteration over trees and/or nodes using the yt parallel_objects function.

These are to be used either with analysis fields or simply for iterating over halos. All analysis fields set in the process are copied back to the root processor so they can be saved. In the cases of parallel_trees and parallel_nodes, results will be saved automatically either at the end of the loop or after a designated number of trees have completed. Because they use yt's parallel_objects underneath, the parallel loops can be configured to customize the size of process groups and to toggle on/off a task queue for each level of parallelism (trees and nodes).

See the API reference in the docs built for this PR for more information.

PR Checklist

I have added docstrings, but do not have time at the moment to update narrative docs or add tests. This will stay as a work in progress until I do. Nonetheless, I thought these useful enough to put here for others to use for the time being.