Skip to content

perf(ei0): coupled loads from the end rows; no OpenMP region on one thread (bit-identical) - #117

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

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

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

This PR removes overhead from the EI = 0 line route and the point system. Results are bit-identical on all 54 examples.

Changes

  • Coupled loads from the end rows. CD_Calc_Model_CoupledLoads assembled the full residual of every line at every step, then read only the coupled rows.
    • When every coupled DOF sits at an end node and the accelerations are finite, the new coupled_loads_at_ends forms just the two end rows. It uses the elements touching an end node, through the existing model_contributor_force(end_nodes_only=.TRUE.) contract.
    • Each row adds its terms in the order of the full assembly.
    • The whole-line internal-force assembly is kept, along with its geometry and finiteness checks.
    • An interior coupled DOF, or a non-finite acceleration, takes the full path.
  • No OpenMP region on one thread. CD_Step_System and CD_Calc_System_CoupledLoads run their per-line loops serially when the team has one thread. The former IF(.FALSE.) region still set up a team, with heap calls, on every call.
  • Element-state copies. extract_element_state and extract_element_positions copy contiguous triples instead of using a vector subscript.

Evidence

  • Bit-identity: all 54 examples, dev against this build, one thread. Of 268 output files, 214 are byte-identical and 54 match once paths and progress timings are masked. None differ. The line-break, mixed-body and two-train decks are also identical at the default OpenMP thread count.
  • Timings: median of 3, one thread:
deck before after
als_volturnus_line_break_time 38.12 s 35.61 s (−6.6 %)
als_volturnus_line_break_tension 39.16 s 36.15 s (−7.7 %)
all 54 examples 130.3 s 124.3 s (−4.6 %)
  • Remaining cost: OpenBLAS's banded solves (about 15 %) and the wave kinematics (26 %; one evaluation per node per step, none duplicated). A different solver path would change round-off, so that is left for a separate change.

Tests

  • Full Release CTest: 366/366 on the default kernel and on Prescott.
  • Debug -fcheck=all: all 130 EI = 0, system, coupled, OpenFAST, C API and hydro tests pass.
  • Build and format: no warnings; fprettify clean.

…rows

The coupled loads of an EI=0 line are the end rows of the residual
M a + f_int - f_ext + M_add a - load. CD_Calc_Model_CoupledLoads formed
the whole residual: the full structural mass product, the added-mass
force and every load contributor of every element, to read the rows of
the coupled DOFs. Every result stays bit-identical.

- A line whose coupled DOFs all belong to its first or last node (a line
  between points), with finite accelerations, now forms the remaining
  terms on the two end rows only (coupled_loads_at_ends). It uses the
  elements that touch an end node and the end nodes' own terms
  (model_contributor_force end_nodes_only, as CD_Get_Model_EndForces
  does). Each row takes its terms in the element order of the whole-line
  assembly, so the loads are bit-identical. The whole-line internal force
  is kept, with its geometry and finiteness checks. A line with an
  interior coupled DOF, or a non-finite acceleration, takes the
  whole-line path as before, so it fails as before.
- CD_Step_System and CD_Calc_System_CoupledLoads run their per-line
  loops without entering an OpenMP region when the team has one thread.
  The inactive region still set up a team on every call. The loop bodies
  are unchanged.
- extract_element_state and extract_element_positions copy the two
  nodes' contiguous triples instead of gathering them through a vector
  subscript.

All 54 examples give byte-identical output files on one thread (progress
timing aside), and so do the line-break, mixed-body and two-train decks on
the default thread count. The Rigid6 line-break
decks als_volturnus_line_break_time and _tension run 7-8 % faster.

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

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:18.913477Z 7a5cf3c 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.

@read-the-docs-community

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

Copy link
Copy Markdown

Documentation build overview

📚 CableDyn | 🛠️ Build #35731467 | 📁 Comparing 7a5cf3c against latest (e8f88f5)

  🔍 Preview build  

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

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 them coming!

Reviewed commit: 3b1a5c9b24

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 7a5cf3cb2b

ℹ️ 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 72e83f5 into dev Nov 8, 2026
10 of 11 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the perf/ei0-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