Skip to content

perf(hermite): remove overhead from the finite-EI dynamic step (bit-identical) - #115

Merged
SMI-Lab-Inha merged 2 commits into
devfrom
perf/hermite-overhead
Nov 8, 2026
Merged

SMI-Lab-Inha merged 2 commits into
devfrom
perf/hermite-overhead

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

This PR removes overhead from the finite-EI (cubic-Hermite) dynamic step. Every output keeps the floating-point operations of its values and their order, so all example outputs are bit-identical to dev's.

Changes

  • Band sweeps (zeroing, finiteness check, step-mass sum, band_combine) cover only the stored rows.
    • The LU fill-in rows above the stored band are zeroed once at allocation. Only a factor writes them.
    • The step mass is now one band_sum instead of band_copy plus band_add.
  • scatter12_band: adds each element column into its contiguous run of the band column.
  • Rigid-end transport tangent: it now works on the ≤ 25 rows of the three end-tangent columns, not two full band matvecs.
  • CD_HermiteCable_Dyn_EndConnection_Moment at a rigid end: it reads the end-tangent rows from node_reaction (a new optional tangent_rows). Before, every call did a full residual, added-mass assembly and matvec. Lines with torsion keep the full assembly.
  • Per-Gauss-point factors: the axial-damping, drag and Froude–Krylov Jacobians compute their 3×3 factor once per Gauss point. For damping that removes about 135 divisions per Gauss point.
  • Upper-triangle mode: hermite_element_integrated skips the node blocks below the diagonal.
  • evaluate_tangent_element: it no longer clears blocks that their single contributor sets in full.
  • Scalar checks: CD_Morison_Drag_Per_Length_Jac takes an optional scalars_validated. The drag element, which has already checked the same scalars before its Gauss loop, passes it. Vector inputs and results are still checked at every Gauss point, so every fail-closed message is unchanged.
  • CD_All_Finite on 2-D and 3-D arrays: checks columns inline.

Evidence

  • Bit-identity: all 54 examples were run with dev's build and this build, and every output file compared byte for byte (.out, .static.out, .elements.out, .range.out, .modes.out, stdout, stderr, exit codes). Of 268 files, 214 are byte-identical and 54 match once paths and progress timings are masked. None differ.
  • Speed: median of 5 interleaved runs, one thread:
deck before after change
buoy_clamped_cable 2.83 s 2.41 s −14.8 %
lazy_wave_vessel_motion 6.12 s 5.55 s −9.3 %
lazy_wave_bend_stiffener 8.67 s 8.28 s −4.5 %
lazy_wave_vessel_rao 13.23 s 12.94 s −2.2 % (CPU −4.8 %)

The EI = 0 decks are untouched.

Tests

  • Full Release CTest: 365/365 on the default kernel and on Prescott.
  • Debug (-fcheck=all): all 108 Hermite-related tests pass.
  • Build and format: no new warnings; fprettify is clean.

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T10:36:17.655849Z 320bc7c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: bf60f40a42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@read-the-docs-community

read-the-docs-community Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 CableDyn | 🛠️ Build #35731463 | 📁 Comparing 320bc7c against latest (e8f88f5)

  🔍 Preview build  

4 files changed
± changelog.html
± outputs.html
± theory.html
± validation.html

The cubic-Hermite dynamic step spent a measurable share of its time on
work that does not change any result. Every change below keeps the
floating-point operations of each output value and their order, so all
results are bit-identical.

- Band operators: the fill-in rows above the stored band are zero in
  every operator and only the LU factor writes them. The tangent and
  added-mass zeroing, the step-mass sum, the effective-tangent
  combination and the added-mass finiteness check now sweep the stored
  rows only, and the step mass Mgb + Mamb is formed in one sweep instead
  of a copy and an add. The sweeps take CONTIGUOUS dummies.
- scatter12_band adds each element-matrix column into its contiguous run
  of the band column (the element DOFs are consecutive).
- The rigid-end transport tangent forms its left vector on the band rows
  of the three end-tangent columns instead of two full band products.
- The rigid end-connection moment takes the end tangent's rows from the
  elements at the node (node_reaction, now also for the tangent rows),
  not from a full residual and added-mass assembly; lines with torsion
  keep the full assembly.
- Element kernels: the axial damping, drag and Froude-Krylov Jacobians
  form their 3 x 3 Gauss-point factor once instead of per entry; the
  bending-element tangent skips the node blocks below the diagonal when
  only the upper triangle is formed; the tangent worker no longer clears
  the wave and held-field blocks that their single contributor sets whole.
- The drag element validates rho, diameter and the drag coefficients once
  before its quadrature loop; CD_Morison_Drag_Per_Length_Jac gains an
  optional scalars_validated argument that skips the same checks at each
  Gauss point. Vector inputs and results are still checked there.
- CD_All_Finite on 2-D and 3-D arrays tests each column inline instead of
  calling the 1-D test per column.

All 54 examples give byte-identical output files (progress timing aside).
The finite-EI decks lazy_wave_vessel_rao, lazy_wave_bend_stiffener,
lazy_wave_vessel_motion and buoy_clamped_cable run 2-15 % faster.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha
SMI-Lab-Inha force-pushed the perf/hermite-overhead branch from bf60f40 to c6a1b2e Compare November 8, 2026 09:25
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: c6a1b2ebb2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The [Unreleased] entries of the open changes are added together in one
change, so that they do not conflict with each other.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 320bc7cbbd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SMI-Lab-Inha
SMI-Lab-Inha merged commit fbcebdc into dev Nov 8, 2026
6 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the perf/hermite-overhead branch November 9, 2026 08:56
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