Skip to content

perf(profile): split the cable assembly, CalcOutput and wave sampling - #35

Merged
SMI-Lab-Inha merged 1 commit into
devfrom
perf/profile-split-2
Oct 21, 2026
Merged

SMI-Lab-Inha merged 1 commit into
devfrom
perf/profile-split-2

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Summary

Second profiling step before any optimisation (follows #34). The first coupled profile showed that, on a mooring with a finite-EI power cable, CalcOutput and the SeaState sampling cost as much as the mooring step, and that the cable step is dominated by its assemblies. This PR times the inside of each.

  • Finite-EI cable assembly. assemble_residual times its sections:
    • band zeroing, tangent element kernels, tangent scatter, structural residual, weight, attachments, dry buoyancy, seabed contact, axial damping, drag, end connections, wave and held Froude-Krylov loads, torsion.
    • The sections count every assembly made while profiling, including those outside the step (reactions, end moments, consistent accelerations).
    • The marks sit outside the parallel element loop; a profiled run steps its cables one at a time.
  • OpenFAST CalcOutput. Split into:
    • the overlay of the current kinematics (at nsuper = 1);
    • the output channels of a fresh evaluation;
    • the restore of the committed state.
  • OpenFAST SeaState sampling. Split into:
    • the node queries (with the current decomposition);
    • the grid checks;
    • the hand-over of the fields to the aggregate.
  • Reports.
    • The driver prints a Finite-EI cable assembly time line.
    • OpenFAST prints CableDyn profile parts and CableDyn Hermite assembly lines.
    • cli.rst (example regenerated from a real run), faq.rst and the CHANGELOG describe them.
  • Unchanged when off. Each new timer is skipped after one test.

Measurement

IEA-15 VolturnUS-S, DLC-1.6 environment (turbulent wind 10.6 m/s, JONSWAP sea), 600 s at dtM = DT = 0.025 s, OMP_NUM_THREADS=1, gfortran build of this branch.

Chain only Chain + 248-element power cable
Total wall time 133 s 227 s
CableDyn step 14.6 s 51.2 s
CalcOutput 5.9 s 40.9 s
– loads 3.6 s 19.7 s
– kinematics overlay 0.34 s 17.4 s
– channels / restore 0.82 / 0.35 s 1.4 / 1.1 s
SeaState sampling 11.7 s 32.9 s
– node queries / hand-over 11.7 / 0.05 s 29.9 / 2.9 s
Cable assembly sections, total — 43.4 s
– drag / tangent kernels / structural / held Froude-Krylov — 12.6 / 10.6 / 9.1 / 6.6 s

Cable assembly outside the step. The cable's residual and tangent assemblies in the step take 25.0 s, but the sections add up to 43.4 s. About 18 s of cable assembly therefore happens outside the step. The overlay and the loads, which cost little on the chain-only mooring, are the likely places. That makes the cable's work in CalcOutput the first candidate for optimisation, ahead of reusing factorisations.

Tests

  • driver_profile_finite_ei: requires the new assembly line. As before, every output file must be byte-identical with and without the profile.
  • Timing, unprofiled, against the v0.2.0 build: dynamic_chain_current, lozon_gomex80_power_cable_motion and buoy_clamped_cable run in the same time (ratios 0.95–1.01 over two rounds, minimum of five alternating runs) and write byte-identical .out files.
  • Full suite (Windows, gfortran, Release, slow tier included): 293/293. Python: 2038 passed. pre-commit run --all-files and the Sphinx build with -W pass. OpenFAST builds; the changed sources build without new warnings.

Checklist

  • pre-commit run --all-files passes
  • ctest --test-dir build --output-on-failure passes
  • python -m pytest tests python/tests passes (if Python or validation records changed)
  • VALIDATION.md updated if a validation result changed (none changed)
  • CHANGELOG.md updated under [Unreleased] (heading added if missing) for user-visible changes
  • Documentation in doc/ updated for changed inputs, options, or outputs
  • Conventional Commit title (feat:, fix:, docs:, ...)
  • Commits are signed off (git commit -s) under the
    Developer Certificate of Origin

The first coupled profile showed that, on a mooring with a finite-EI
power cable, CalcOutput and the SeaState sampling cost as much as the
mooring step itself, and that the cable step is dominated by its
residual and tangent assemblies. Choosing what to optimise first needs
the inside of each.

The residual and tangent assembly of a finite-EI cable now times its
sections (band zeroing, tangent element kernels, tangent scatter,
structural residual, weight, attachments, dry buoyancy, seabed contact,
axial damping, drag, end connections, wave and held Froude-Krylov loads,
torsion). The OpenFAST module splits CalcOutput into the overlay of the
current kinematics, the output channels and the restore of the
committed state, and the SeaState sampling into the node queries, the
grid checks and the hand-over of the fields. The standalone driver and
the OpenFAST module report them.

Unprofiled, each new timer is skipped after one test; outputs are
byte-identical with and without the profile.

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 Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T03:45:33.625388Z c6a5d27 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. Hooray!

Reviewed commit: c6a5d27f18

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

Copy link
Copy Markdown

Documentation build overview

📚 CableDyn | 🛠️ Build #35286921 | 📁 Comparing c6a5d27 against latest (d3ddfeb)

  🔍 Preview build  

3 files changed
± changelog.html
± cli.html
± faq.html

@SMI-Lab-Inha
SMI-Lab-Inha merged commit eb28b20 into dev Oct 21, 2026
15 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the perf/profile-split-2 branch October 21, 2026 04:48
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