Skip to content

IBM: num_local_ibs_max is a compile-time 30000 and sizes several arrays; make it a runtime parameter #2395

Open

Description

@sbryngelson

Observation

num_local_ibs_max = 30000 (src/common/m_constants.fpp) is not a loop bound anywhere; it only sizes allocations and checks: collision_lookup(num_local_ibs_max*27*8, 4) (about 104 MB per rank), wall_overlap_distances(num_local_ibs_max*27, 6) (about 39 MB), ib_box(6, num_local_ibs_max, -1:1, -1:1, -1:1), ib_face_ft, local_ib_patch_ids, an automatic local_ib_idx_old in the handoff routine, the handoff MPI buffer (patch_bytes * min(num_local_ibs_max, num_gbl_ibs)), the pair-bitset capacity cap, and the aborts from #2351. With about 1000 immersed boundaries per GPU that is about 150 to 200 MB of device memory per rank held for nothing.

Proposal

A runtime parameter (default 30000, same behaviour) read by those allocations; local_ib_patch_ids and the automatic array become allocatable. Low priority: it saves memory only, but it matters if several ranks share a GPU.

AI-assisted (Claude Code).

Activity

  1. sbryngelson commented on Nov 22, 2026

    @sbryngelson
    MemberAuthor

    Related pull requests: #2330 (sparse relax path and handoff, merged), #2351 (aborts), #2354. See also #1703.

    AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions