ytree-project / ytree

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

Parallel bug fix for progress bar in select_halos #158

Closed jwise77 closed 1 year ago

jwise77 commented 1 year ago

PR Summary

When using select_halos in parallel runs, the progress bar throws this error.

halos = list(a.select_halos("tree['forest', 'mass'].to('Msun') > 1e7"))
  File "/home/jwise/codes/ytree/ytree/data_structures/arbor.py", line 815, in select_halos
    pbar._pbar.set_description_str(f"Selecting halos (found {found})")
P001 yt : [ERROR    ] 2023-03-17 11:40:24,898 AttributeError: 'DummyProgressBar' object has no attribute '_pbar'
P001 yt : [ERROR    ] 2023-03-17 11:40:24,898 Error occurred on rank 1.

This PR places a check whether the progress bar exists (i.e. on the root process) before updating the progress bar text. Sorry for including all of the merge commits. You might want to squash the PR when accepting.

PR Checklist

brittonsmith commented 1 year ago

Thanks for fixing this @jwise77!