Skip to content

1536 ib neighborhood radius automatic size checking - #1736

Draft
danieljvickers wants to merge 5 commits into
MFlowCode:masterfrom
danieljvickers:1536-ib_neighborhood_radius-automatic-size-checking
Draft

1536 ib neighborhood radius automatic size checking#1736
danieljvickers wants to merge 5 commits into
MFlowCode:masterfrom
danieljvickers:1536-ib_neighborhood_radius-automatic-size-checking

Conversation

@danieljvickers

Copy link
Copy Markdown
Member

Description

Immersed Boundary cases have one extra layer of tediousness due to the IB neighborhood radius needing ot be recomputed based upon the number of ranks. This causes significant problems when attempting to run the same case on CPUs vs. GPUs (because one may use more CPUs for the same case) and in strong scaling scenarios.

To address this, this PR allows users to let MFC automatically compute the IB Neighborhood radius. The code computes the largest width required for any IB in the simulation and the largest processor width. These are used to approximate a size, with an additional 10% safety factor on the neighborhood size for safety.

This is not ideal, as it does not consider things like the orientation of the IB for reducing the size further. If particle forces are desired, it is always recommended to compute the IB neighborhood radius that one desires. However, for uniform distributions of small IBs, this will often produce optimal results with no modification to the case file.

To enable automatic radius checking, just set ib_neighborhood_radius: 0 in the case file, which is also the new default.

Closes #1536

Type of change (delete unused ones)

  • New feature

Testing

How did you test your changes?

2D ranks on GNU for increasing IB size.

Checklist

Check these like this [x] to indicate which of the below applies.

  • I added or updated tests for new behavior
  • I updated documentation if user-facing behavior changed

See the developer guide for full coding standards.

GPU changes (expand if you modified src/simulation/)
  • GPU results match CPU results
  • Tested on NVIDIA GPU or AMD GPU

AI code reviews

Reviews are not retriggered automatically. To request a review, comment on the PR:

  • @claude full review — Claude full review (also triggers on PR open/reopen/ready)
  • Or add label claude-full-review — Claude full review via label

@github-actions

Copy link
Copy Markdown

Claude Code Review

Head SHA: d0e083e

Files changed:

  • 5
  • docs/documentation/case.md
  • src/simulation/m_global_parameters.fpp
  • src/simulation/m_ib_patches.fpp
  • src/simulation/m_start_up.fpp
  • toolchain/mfc/params/definitions.py

Findings:

  • src/simulation/m_start_up.fpp: s_get_neighbor_bounds declares integer :: ... temporary_radius but the variable is never read or assigned anywhere in the new automatic-radius block (max_ib_bound, local_rank_width, max_rank_width, and bound are the ones actually used). This is dead code left over from the refactor and risks an unused-variable warning across the four CI-gated compilers; it should be removed.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

ib_neighborhood_radius automatic size checking

2 participants