Skip to content

ENH: Gather timing summaries through a muGrid communicator directly - #1

Merged
pastewka merged 1 commit into
mainfrom
enh/mugrid-gather
Oct 22, 2026
Merged

pastewka merged 1 commit into
mainfrom
enh/mugrid-gather

Conversation

@pastewka

Copy link
Copy Markdown
Contributor

muGrid 1.6 (muSpectre/muGrid#242 + the follow-up PR) gathers Python objects itself — gather(obj, root=0) with mpi4py's semantics — and no longer imports or needs mpi4py. print_summary therefore accepts a communicator whose gather takes root as it is, instead of requiring mpi4py's interface (Get_rank) or an mpi4py_comm behind it. Detection is by inspect.signature, so muGrid < 1.6, whose gather concatenated arrays and took no root, is still left alone and falls back as before.

Verified with muGrid's branch on 2 ranks under mpirun without mpi4py importable: the summary is gathered and printed on rank 0 with mean/min/max across ranks. New unit test for the detection; the existing test_memory_tracking failure (psutil not installed) is unrelated.

🤖 Generated with Claude Code

A communicator could gather the per-rank timers only if it was mpi4py's
or wrapped one (muGrid's mpi4py_comm). muGrid 1.6 gathers Python objects
itself -- gather(obj, root=0) with mpi4py's semantics -- and no longer
needs mpi4py, so a communicator whose gather takes root is used as it is.
muGrid's earlier gather, an array concatenation without root, is still
left alone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@pastewka
pastewka merged commit 662dbe7 into main Oct 22, 2026
10 checks passed
@pastewka
pastewka deleted the enh/mugrid-gather branch October 22, 2026 05:39
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

Successfully merging this pull request may close these issues.

1 participant