Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/scripts/rerun_unacquired.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
#
# Rerun the jobs of a finished workflow run that never started because GitHub found no hosted
# runner for them. A job GitHub could not hand to a runner ends cancelled after about 15 minutes
# with the annotation "The job was not acquired by Runner of type hosted even after multiple
# attempts"; it happens when the macOS arm64 pool is short of capacity. Such a job ran none of
# our code, so rerunning it hides nothing. A job that ran and failed is never rerun.
#
# usage: rerun_unacquired.sh <owner/repo> <run id> <run attempt> [--dry-run]
#
# The jobs are judged by their latest execution over all the run's attempts (the run's job list,
# filter=latest), not by the last attempt alone, which lists only the jobs it reran. When every
# job whose latest execution failed went unacquired, the run's failed jobs are rerun together
# (GitHub reruns every job whose latest execution failed, so these alone). When some job failed
# on its own, the run stays failed whatever happens, and only the first unacquired job is rerun,
# alone, so that its own result is known; the next completion of the run reruns the next one.
# Reruns stop at the fourth attempt.
set -euo pipefail

repo=$1
run=$2
attempt=$3
dry_run=${4:-}
max_attempt=4

if [ "$attempt" -ge "$max_attempt" ]; then
echo "run $run attempt $attempt: no further reruns (at most $max_attempt attempts)"
exit 0
fi

unacquired=()
ran=0
jobs=$(gh api "repos/$repo/actions/runs/$run/jobs?filter=latest&per_page=100" --paginate \
--jq '.jobs[] | select(.conclusion == "failure" or .conclusion == "cancelled" or .conclusion == "timed_out")
| [.id, .conclusion, .name] | @tsv')
while IFS=$'\t' read -r id conclusion name; do
[ -n "$id" ] || continue
if gh api "repos/$repo/check-runs/$id/annotations" --jq '.[].message' | grep -q 'was not acquired by Runner'; then
unacquired+=("$id")
echo "not started (no runner acquired): $name"
else
ran=$((ran + 1))
echo "ran and ended $conclusion, left as it is: $name"
fi
done <<< "$jobs"

if [ "${#unacquired[@]}" -eq 0 ]; then
echo "run $run (latest executions, attempt $attempt): no unacquired job"
exit 0
fi

if [ "$ran" -eq 0 ]; then
echo "rerunning the failed jobs of run $run (all ${#unacquired[@]} went unacquired)"
[ "$dry_run" = "--dry-run" ] || gh run rerun "$run" --repo "$repo" --failed
else
echo "rerunning job ${unacquired[0]} of run $run alone ($ran other job(s) failed on their own)"
[ "$dry_run" = "--dry-run" ] || gh api -X POST "repos/$repo/actions/jobs/${unacquired[0]}/rerun" --silent
fi
37 changes: 37 additions & 0 deletions .github/workflows/rerun-unacquired.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
#
# Reruns the jobs of a failed CI run that GitHub never started because no hosted runner was
# acquired (the macOS arm64 pool runs short of capacity; such a job is cancelled after about
# 15 minutes and ran none of the repository's code). Jobs that ran and failed stay failed. The
# logic, with its limits, is in .github/scripts/rerun_unacquired.sh. A workflow_run workflow
# runs from the default branch's copy of this file.
name: rerun unacquired jobs

on:
workflow_run:
workflows: [fortran, python, wheels]
types: [completed]

permissions:
actions: write
checks: read
contents: read

jobs:
rerun:
if: github.event.workflow_run.conclusion == 'failure'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: .github/scripts
persist-credentials: false
- name: Rerun the jobs no runner picked up
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
RUN_ID: ${{ github.event.workflow_run.id }}
RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt }}
run: bash .github/scripts/rerun_unacquired.sh "$REPO" "$RUN_ID" "$RUN_ATTEMPT"
115 changes: 114 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,118 @@ All notable changes to CableDyn are recorded in this file. The format follows

## [Unreleased]

## [0.5.0] - 2026-12-04

### Added

- `OPTIONS SEASTATE_SPECTRAL WaterKin` (OpenFAST): the lines take SeaState's first-order waves from its
own wave components, evaluated at the line nodes, instead of interpolating its grid. At a grid vertex
and a wave step the values equal SeaState's grid to the round-off of its single-precision FFT; between
the vertices they are the sums of the components, not an interpolation, so a sea at any heading, long- or short-crested, needs no grid over the
lines and SeaState's grid can shrink to the hull. Each node evaluates the components once per wave
step at its position advanced to the middle of the step and interpolates by cubic Hermite polynomials
with the exact time derivatives; `OPTIONS waveKinTol` (default `1e-6`) lets each node drop the
components whose velocity and acceleration variances stay within that fraction of the totals at
every depth the node reaches, reported per node in `<root>.CD.wavekin.out`; under Wheeler stretching
the elevation that maps a node's depth keeps, by the same bound, the short waves its kinematics
drop. Every SeaState stretching mode is reproduced;
second-order kinematics, `WaveMod = 6`, `WvCrntMod` 1 or 2, `CurrMod = 2` and a `WaveTimeShift` stop
the run with a message naming `SEASTATE_GRID`, which, like `SEASTATE` and a deck without a WaterKin
row, keeps the grid. A `CurrMod = 1` current is taken at each node's depth, in the static start as in
the steps, so neither depends on SeaState's vertical grid. `cabledyn_wavekin_check` (built in the
OpenFAST tree) compares the two routes at SeaState's grid vertices.

- Every OpenFAST, FAST.Farm and standalone run writes a provenance record, `<RootName>.CD.provenance.json`
(`<FarmRoot>.FarmCD.provenance.json`, `<out_root>.CD.provenance.json`): JSON of schema
`cabledyn.provenance/1` with the host, the wave route, the sea (SeaState's `WaveMod`, direction,
wave step and period, depth, and a fingerprint of its components that identifies the sea exactly),
the SeaState grid and `waveGridCheck` mode on the grid route, and per deck line the wave-grid guard's
findings (with the weighted velocity ratio: the rms wave velocity at the line's shallowest node
outside the grid over that at the surface, from SeaState's components, also given in the guard's
message) and the variances the node-wise route drops. It is written at the start and replaced, in one
step, at the end (`complete`, or `stopped` after an error); a checkpoint carries its findings, so a
restarted run writes the same record but for `restarted_from`. Unknown values are `null`. Under
`waveGridCheck warn` the coverage check now goes on silently after its one warning, for the record, and
a restart no longer repeats the warning.

- `integration/openfast/cabledyn_preflight.py` checks an OpenFAST case before it runs: line ends and hull
joints against the SeaState grid with a margin for the platform motion, `NX` or `NY` = 2 under a sea
that varies along that axis, the amplitude the grid keeps at the shortest wavelength that matters,
SeaState's stored memory and start-up peak (about 3 times the stored arrays), and whether
`SEASTATE_SPECTRAL` takes the case, with a hull-only grid for it. `integration/openfast/cabledyn_logscan.py`
reads the logs (and provenance records) of many runs and lists per line what the wave-grid guard found.

### Changed

- In OpenFAST, a coupled run whose lines take their wave or current kinematics from the SeaState grid now
stops when the grid cannot give them those kinematics, where it warned once and ran on. It stops at the
static start or at the first CableDyn step at which a line node in the water lies outside the grid,
where SeaState gives it the kinematics of the grid boundary; the message gives the time and, line by
line, the number of such nodes and the deepest and shallowest of them. It also stops at the start when
the grid has `NX = 2` or `NY = 2` (three points across that axis) under waves that vary along the axis
(a long-crested sea not along the other axis, within 1e-4 deg, a short-crested sea, or supplied
`WaveMod 6` kinematics that differ across the axis, judged from the data) while the lines
sample the grid in the water: SeaState then interpolates across a large part of a wavelength for every
line node and hull member, also near a grid line, from which the sea sways the lines.
A grid with `NY = 2` under waves along x, or `NX = 2` under waves along y, still runs. The new
`OPTIONS waveGridCheck warn` turns both checks into the former warnings (`error`, the default, stops).
The r-test `MD_Shared` SeaState file of the OpenFAST tutorial, which covers only the platform, now stops
until its grid is enlarged as the tutorial describes. Runs that pass the checks give the same results,
bit for bit.
- In OpenFAST, CableDyn evaluates its output channels only at the steps OpenFAST writes (`DT_Out`, from
`TStart`) and when it linearizes, as AeroDyn and BeamDyn can, where it evaluated them at every output
call of every step (two to four per step in the tightly coupled solver). The loads are evaluated as
before. On the IEA-15 MW lazy-wave cable deck with 17 stations and torsion channels at DT = 0.025 s,
`DT_Out` = 0.05 s, the channels cost 12.6 s where they cost 53.1 s and the run 10 % less CPU time; the
`.out` and `.CD.out` are the same as before, bit for bit, also with the mooring supercycled and after a
restart from a checkpoint. This needs the OpenFAST integration patches of this release.
- The nodal twist of a finite-EI line costs less. Its residual no longer forms the Hessian of the
torque-tension coupling term, which only the tangent uses. An element's reference twist is taken
from the last evaluation when every input it reads is the same, bit for bit; in OpenFAST every output
call moves only the fairlead end, so all elements but the end ones are taken over. On the IEA-15 MW
lazy-wave cable deck (237 elements, torsion, DT = 0.0125 s, 400 s, operating rotor) the run takes
9.00 min of CPU time where it took 9.79 min after the change above (11.23 min before both); the
`.out` and `.CD.out` are the same, bit for bit.

- In OpenFAST, the lines on the SeaState grid route take the wave and current kinematics at their
positions at the sample time (the end of the CableDyn step): their committed positions advanced by
their velocity, taken from their last two committed positions. Before, they took them at the
committed positions of the step's start, one CableDyn step behind (a phase error of k v dtM).
Grid-route results change at that level, by design: on the r-test chain mooring of the OpenFAST
tutorial (Hs 6 m, Tp 12 s, 60 s, dtM 0.025 s) the fairlead-tension standard deviations move by less
than 0.001 % and the tensions by at most 200 N (0.002 standard deviations); on a chain and lazy-wave
cable mooring at dtM 0.0125 s over 300 s the standard deviations of tension, curvature and twist
move by less than 0.001 % and the largest differences are at the last printed digit. The wave-grid
guard and the provenance record check and report the positions sampled, so a node that a step's
motion carries out of the grid is found at that step. A checkpoint carries the position history, so
a restarted run continues bit for bit. The node-wise route (`SEASTATE_SPECTRAL`) has advanced its
nodes this way from the start.

### Fixed

- A Syrope rope at its running maximum had a band of slow strains, up to 9e-7 wide on the shipped table,
over which its recovered mean tension did not change, so every one of them was a rest point and rounding
chose the one a static start took. Two starts of the composite example that agreed to 1e-10 gave runs
that differed by up to 2.3e-4 of the channel maxima. The OWC recovery is now the exact inverse of
`eps_owc(T) - eps_fast(T)`, where it interpolated the slow strains of the table rows, and the working
curve meets it at one slow strain. Results of a rope loaded along its OWC change by about the size of
the former interpolation error (1.4e-4 on the composite example) and no longer depend on the spacing
of the OWC rows. On the OWC the recovery differs from MoorDyn's, which interpolates the rows.
A table with a row steeper than the fast spring at the row's start stops with a named error.

- A single-section Syrope line was refused as slack where its chord strain lay below the zero-tension
strain of its `SYROPE IC` working curve, or its chord was shorter than the line, although its weight sags
it taut. It now starts as a composite line does, from the curve's alpha. Nine ropes from 39 kN to 236 kN
agree with an independent elastic catenary to 3.4e-6. A rope that carries no tension still stops with a
named error.

- A Syrope line whose rest tension is a small part of its past one (a `SYROPE IC` `Tmax0` well above the
installed tension, as of a polyester mooring line after a storm that loaded it) failed to start when its
static secants, far below the working curve's tangent along the whole line, did not settle in 50
iterations. From the thirtieth iteration on, the static start combines the stored solves of the whole line
(Anderson acceleration); a 644 m rope that stopped at a residual of 1.2e-10 after 50 iterations starts in
fewer than 40, with the same tensions. Lines that settled in fewer iterations start as before, bit for bit.

## [0.4.3] - 2026-11-20

### Added
Expand Down Expand Up @@ -1412,7 +1524,8 @@ Corrections made during the pre-release review.
values of the shipped example decks and states which tension (end element or
`FairTen` end force) each comparison uses.

[Unreleased]: https://github.com/SMI-Lab-Inha/CableDyn/compare/v0.4.3...HEAD
[Unreleased]: https://github.com/SMI-Lab-Inha/CableDyn/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/SMI-Lab-Inha/CableDyn/releases/tag/v0.5.0
[0.4.3]: https://github.com/SMI-Lab-Inha/CableDyn/releases/tag/v0.4.3
[0.4.2]: https://github.com/SMI-Lab-Inha/CableDyn/releases/tag/v0.4.2
[0.4.1]: https://github.com/SMI-Lab-Inha/CableDyn/releases/tag/v0.4.1
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ authors:
repository-code: "https://github.com/SMI-Lab-Inha/CableDyn"
url: "https://github.com/SMI-Lab-Inha/CableDyn"
license: Apache-2.0
version: 0.4.3
date-released: 2026-11-20
version: 0.5.0
date-released: 2026-12-04
keywords:
- mooring dynamics
- cable dynamics
Expand Down
Loading
Loading