Skip to content

perf(profile): split the line and cable steps into their kernels - #34

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

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

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Summary

The run-time profile (CABLEDYN_PROFILE=1) now shows where the time inside the line and cable steps goes. It is the first step of the plan for a reused, scheduled factorisation, whose payoff depends on how much of the step the tangent and its factorisation take.

  • EI = 0 lines. Four kernels of CD_Cable_Gen_Alpha_Step are timed and counted: residual-only evaluations, residual and tangent evaluations, LU factorisations and back-substitutions.
    • eval_dynamic became a thin timing wrapper around the unchanged eval_dynamic_core.
    • The new CableDyn_Profile kernel counters are updated atomically, because lines step concurrently; their times are summed over the lines.
  • Finite-EI cables. Factorisations are timed apart from back-substitutions. Back-substitutions now include the force-blend correction that ends each step, with its own count. The count of Newton solves keeps its meaning.
  • Reports.
    • The standalone driver prints an EI = 0 line step kernels line and the split cable line.
    • The OpenFAST module prints CableDyn EI = 0 profile and counts lines, and the split Hermite line. It arms and disarms the line counters with its own profiler.
    • The CLI page and FAQ describe the new lines. The CLI example is regenerated from a real run.
  • Unchanged when off. Unprofiled, every new entry point returns 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 135 s 234 s
CableDyn step (step_s) 15.3 s 53.9 s
SeaState sampling (wave_s) 12.8 s 34.2 s
CalcOutput (69k calls, loads 3.3 / 19.9 s) 5.9 s 42.0 s
EI = 0 lines: residual / tangent / factor / back-substitution 2.1 / 7.3 / 1.4 / 0.6 s 2.3 / 7.8 / 1.4 / 0.6 s
Cable: residual / tangent / factor / back-substitution / added mass — 12.3 / 13.2 / 4.5 / 2.2 / 2.1 s
  • Tangent plus factorisation: 56 % of the EI = 0 line work and 49 % of the cable step. Both are above the 30 % threshold set for building the scheduled factorisation.
  • The step is not the only cost. In the mixed case CalcOutput (about 3 calls per step) and the SeaState sampling are as large as the step itself. They are the next things to profile.

Tests

  • test_profile, new kernel case:
    • unarmed, nothing is recorded;
    • under a 4-thread OpenMP team, the calls of each kernel are exact;
    • a kernel that began unarmed, or an unknown kernel, is not counted;
    • disarmed, the counts stay readable; re-arming zeroes them.
  • driver_profile_ei0, driver_profile_finite_ei: they require the new lines. 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.96–1.00, 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 solver sources build without 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 run-time profile (CABLEDYN_PROFILE=1) counted the steps and Newton
iterations of EI = 0 lines but did not say where their time went, and
it reported the factorisation and back-substitution of finite-EI cables
as one "linear solve". Deciding whether a reused, scheduled
factorisation is worth building needs both.

The step of an EI = 0 line now times its residual-only evaluations, its
residual and tangent evaluations, its LU factorisations and its
back-substitutions (CableDyn_Profile kernel counters, updated
atomically because lines step concurrently; their times are summed
over the lines). The finite-EI cable profile times its factorisations
apart from its back-substitutions, which now also include the
force-blend correction that ends each step. The standalone driver and
the OpenFAST module report both; the OpenFAST module arms and disarms
the line counters with its own profiler.

Unprofiled, every new entry point returns after one test: three decks
run in the same time as with 0.2.0 (ratios 0.96-1.00) and write
byte-identical outputs, and the driver tests check that every output
file is 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-21T02:19:00.821535Z 37d8455 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. What shall we delve into next?

Reviewed commit: 37d8455b70

ℹ️ 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 #35285935 | 📁 Comparing 37d8455 against latest (d3ddfeb)

  🔍 Preview build  

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

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