Skip to content

WIP: Generalize multigrid hierarchy#1363

Open
lroberts36 wants to merge 32 commits intolroberts36/solver-speedup-restrictfrom
lroberts36/multigrid-reduce-block-size-first
Open

WIP: Generalize multigrid hierarchy#1363
lroberts36 wants to merge 32 commits intolroberts36/solver-speedup-restrictfrom
lroberts36/multigrid-reduce-block-size-first

Conversation

@lroberts36
Copy link
Collaborator

@lroberts36 lroberts36 commented Jan 15, 2026

PR Summary

  • Generalizes the geometric multigrid (GMG) hierarchy to support an initial
    sequence of leaf-only GMG grids before transitioning to two-level
    composite grids
    , rather than forcing an immediate move to composite grids.

  • Introduces a new runtime parameter parthenon/mesh/base_block_coarsenings
    which controls how many leaf GMG grids (with increasing in-block coarsening) are
    included at the start of the hierarchy.

  • Refactors GMG grid identification to explicitly track:

    • grid type (leaf vs two_level_composite),
    • in-block coarsening level (block_coarsenings),
    • multigrid level index,
    • and whether a grid participates in the GMG hierarchy.
  • Preserves and clarifies two-level composite grid semantics, where a composite
    grid at logical level ℓ includes:

    • level ℓ blocks (leaf + internal parents of finer leaves), and
    • level ℓ−1 leaf blocks to provide boundary conditions.
  • Updates GMG hierarchy construction logic to cleanly separate:

    • leaf-only GMG stages,
    • tree traversal using two-level composite grids,
    • and subsequent in-block coarsening at the root.
  • Extends boundary communication infrastructure to allow multiple
    communication buffers per communication channel
    , enabling concurrent
    communication on multiple MeshData stages without MPI lock contention.

    • Implements the above communication changes across:
      tag_map.*, bvals_utils.hpp, mesh_data.hpp, and build_boundary_buffers.cpp.

TODO before removing WIP

  • Update coalesced communication infrastructure to correctly handle the new
    “multiple buffers per communication channel” capability.

  • Add a more extensive solver testing infrastructure for GMG-based solvers.

  • Add or update documentation describing:

    • the parthenon/mesh/base_block_coarsenings parameter,
    • the generalized GMG hierarchy structure,
    • and the updated boundary communication buffering model.

PR Checklist

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • Change is breaking (API, behavior, ...)
    • Change is additionally added to CHANGELOG.md in the breaking section
    • PR is marked as breaking
    • Short summary API changes at the top of the PR (plus optionally with an automated update/fix script)
  • CI has been triggered on Darwin for performance regression tests.
  • Docs build
  • (@lanl.gov employees) Update copyright on changed files

@Yurlungur
Copy link
Collaborator

since this depends on all those other MRs... the diff is hard to read. I think I'll wait to review until those are in

@lroberts36
Copy link
Collaborator Author

since this depends on all those other MRs... the diff is hard to read. I think I'll wait to review until those are in

@Yurlungur: Yeah, no need to review while it is in WIP. I am still working on it and I put it up mostly because I wanted to easily be able to see the diff.

@lroberts36 lroberts36 changed the base branch from develop to lroberts36/solver-speedup-restrict January 26, 2026 17:46

MeshData<Real> mesh_data("base");
mesh_data.Initialize(block_list, nullptr, NDIM);
mesh_data.Initialize(block_list, nullptr);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just a previously existing bug where the NDIM being passed here was assumed to be the multigrid level.

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.

2 participants