Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI fixes: Mac runner upgrade and Doxygen installations #3921

Merged
merged 24 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e02d16c
Replace Doxygen download with choco install; upgrade Mac runners to m…
nickbianco Sep 30, 2024
394fad0
Use ubuntu-latest for perf jobs
nickbianco Oct 1, 2024
678a86e
Fix Mac build failures
nickbianco Oct 1, 2024
25be1b3
Reduce tolerances on failing tests
nickbianco Oct 1, 2024
a8f7061
Use WithinAbs over WithinRel
nickbianco Oct 2, 2024
fc851e1
Add tolerances for WithinAbs usages
nickbianco Oct 2, 2024
0ea8583
Try using checkout@v4 to avoid temp HOME directory issue
nickbianco Oct 2, 2024
4c1e2be
Use correct URL for doxygen download
nickbianco Oct 2, 2024
38ede67
Add some debugging print out statements
nickbianco Oct 2, 2024
93c571f
Add missing semicolon
nickbianco Oct 2, 2024
e6c3e8e
Fix typo
nickbianco Oct 2, 2024
8d67de2
Fix debugging outputs
nickbianco Oct 2, 2024
3587789
Remove unused timing code from testOutputReporter
nickbianco Oct 2, 2024
5f3a5e7
Use WithinRel comparison for fiber stiffness since were using a finit…
nickbianco Oct 2, 2024
bc3545f
Add some debug print outs
nickbianco Oct 2, 2024
1e13a8b
Fix indexing typo and add more debug statements
nickbianco Oct 2, 2024
94db201
Even more debug statements
nickbianco Oct 2, 2024
bfc635b
Try using Catch2 comparisons
nickbianco Oct 2, 2024
5398b46
Loosen tolerance on kinetic energy check
nickbianco Oct 2, 2024
9b5a1a5
Revert AnalysisSet changes
nickbianco Oct 2, 2024
6a19e3c
Revert OutputReporter.cpp changes
nickbianco Oct 2, 2024
a08f3ba
Remove unused header includes
nickbianco Oct 3, 2024
d0852c1
Use SimTK::Eps over custom tolerances; add TODO about failing testOut…
nickbianco Oct 3, 2024
a05e4db
Revert usages of SimTK::Eps
nickbianco Oct 3, 2024
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
30 changes: 15 additions & 15 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Doxygen
# choco install doxygen.portable # <-- too unreliable.
run: |
(New-Object System.Net.WebClient).DownloadFile("https://sourceforge.net/projects/myosin/files/doxygen-1.8.14.windows.x64.bin.zip/download", "doxygen.zip")
(New-Object System.Net.WebClient).DownloadFile("https://github.com/doxygen/doxygen/releases/download/Release_1_12_0/doxygen-1.12.0.windows.x64.bin.zip", "doxygen.zip")
7z x $env:GITHUB_WORKSPACE/doxygen.zip -odoxygen
echo "$env:GITHUB_WORKSPACE\\doxygen" >> $GITHUB_PATH

Expand Down Expand Up @@ -159,14 +159,14 @@ jobs:
runs-on: windows-2022

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}

- name: Install Doxygen
# choco install doxygen.portable # <-- too unreliable.
run: |
(New-Object System.Net.WebClient).DownloadFile("https://sourceforge.net/projects/myosin/files/doxygen-1.8.14.windows.x64.bin.zip/download", "doxygen.zip")
(New-Object System.Net.WebClient).DownloadFile("https://github.com/doxygen/doxygen/releases/download/Release_1_12_0/doxygen-1.12.0.windows.x64.bin.zip", "doxygen.zip")
7z x $env:GITHUB_WORKSPACE/doxygen.zip -odoxygen
echo "$env:GITHUB_WORKSPACE\\doxygen" >> $GITHUB_PATH

Expand Down Expand Up @@ -269,12 +269,12 @@ jobs:
version: ${{ steps.configure.outputs.version }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Doxygen
# choco install doxygen.portable # <-- too unreliable.
run: |
(New-Object System.Net.WebClient).DownloadFile("https://sourceforge.net/projects/myosin/files/doxygen-1.8.14.windows.x64.bin.zip/download", "doxygen.zip")
(New-Object System.Net.WebClient).DownloadFile("https://github.com/doxygen/doxygen/releases/download/Release_1_12_0/doxygen-1.12.0.windows.x64.bin.zip", "doxygen.zip")
7z x $env:GITHUB_WORKSPACE/doxygen.zip -odoxygen
echo "$env:GITHUB_WORKSPACE\\doxygen" >> $GITHUB_PATH

Expand Down Expand Up @@ -370,12 +370,12 @@ jobs:
mac_target:
name: Mac [target]

runs-on: macos-12
runs-on: macos-14

if: ${{ contains(github.event.pull_request.title, '[perf-mac]') || contains(github.event.pull_request.body, '[perf-mac]') }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}

Expand Down Expand Up @@ -498,15 +498,15 @@ jobs:

mac_source:

runs-on: macos-12
runs-on: macos-14

name: ${{ (contains(github.event.pull_request.title, '[perf-mac]') || contains(github.event.pull_request.body, '[perf-mac]')) && 'Mac [source]' || 'Mac' }}

outputs:
version: ${{ steps.configure.outputs.version }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Python packages
uses: actions/setup-python@v4
Expand Down Expand Up @@ -635,7 +635,7 @@ jobs:
- windows2022_target
- windows2022_source

runs-on: macos-12
runs-on: ubuntu-latest

if: ${{ contains(github.event.pull_request.title, '[perf-win]') || contains(github.event.pull_request.body, '[perf-win]') }}

Expand Down Expand Up @@ -719,7 +719,7 @@ jobs:
- mac_target
- mac_source

runs-on: macos-12
runs-on: ubuntu-latest

if: ${{ contains(github.event.pull_request.title, '[perf-mac]') || contains(github.event.pull_request.body, '[perf-mac]') }}

Expand Down Expand Up @@ -798,7 +798,7 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Python packages
uses: actions/setup-python@v4
Expand Down Expand Up @@ -912,7 +912,7 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Python packages
uses: actions/setup-python@v4
Expand Down Expand Up @@ -1060,7 +1060,7 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check for tabs
# Ensure that there are no tabs in source code.
Expand Down
24 changes: 14 additions & 10 deletions OpenSim/Actuators/Test/testDeGrooteFregly2016Muscle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,13 +597,16 @@ TEST_CASE("DeGrooteFregly2016Muscle basics") {
CHECK(muscle.getFiberVelocityAlongTendon(state) == -1 * Vmax);
CHECK(muscle.getPennationAngularVelocity(state) == 0);
CHECK(muscle.getTendonVelocity(state) == 0);
CHECK(muscle.getForceVelocityMultiplier(state) == 0);
CHECK_THAT(muscle.getForceVelocityMultiplier(state),
Catch::Matchers::WithinAbs(0.0, SimTK::Eps));

model.realizeDynamics(state);
const auto Fmax = muscle.getMaxIsometricForce();
const auto fpass = muscle.calcPassiveForceMultiplier(1.0);
CHECK(muscle.getActiveFiberForce(state) == 0);
CHECK(muscle.getActiveFiberForceAlongTendon(state) == 0);
CHECK_THAT(muscle.getActiveFiberForce(state),
Catch::Matchers::WithinAbs(0.0, SimTK::Eps));
CHECK_THAT(muscle.getActiveFiberForceAlongTendon(state),
Catch::Matchers::WithinAbs(0.0, SimTK::Eps));
CHECK(muscle.getPassiveFiberForce(state) == Approx(Fmax * fpass));
CHECK(muscle.getPassiveFiberForceAlongTendon(state) ==
Approx(Fmax * fpass));
Expand All @@ -630,16 +633,17 @@ TEST_CASE("DeGrooteFregly2016Muscle basics") {
SimTK::Real fiberStiffnessAlongTendon =
diffFiberStiffnessAlongTendon.calcDerivative(
muscle.get_optimal_fiber_length());
CHECK(muscle.getFiberStiffnessAlongTendon(state) ==
Approx(fiberStiffnessAlongTendon));
CHECK_THAT(muscle.getFiberStiffnessAlongTendon(state),
Catch::Matchers::WithinRel(fiberStiffnessAlongTendon, 1e-6));

SimTK::Real tendonStiffness = SimTK::Infinity;
CHECK(muscle.getTendonStiffness(state) == SimTK::Infinity);
CHECK(muscle.getMuscleStiffness(state) ==
Approx(muscle.calcMuscleStiffness(
tendonStiffness, fiberStiffnessAlongTendon)));

CHECK(muscle.getFiberActivePower(state) == Approx(0.0));
SimTK::Real muscleStiffness = muscle.calcMuscleStiffness(
tendonStiffness, fiberStiffnessAlongTendon);
CHECK_THAT(muscle.getMuscleStiffness(state),
Catch::Matchers::WithinRel(muscleStiffness, 1e-6));
CHECK_THAT(muscle.getFiberActivePower(state),
Catch::Matchers::WithinAbs(0.0, SimTK::Eps));
CHECK(muscle.getFiberPassivePower(state) ==
Approx(Vmax * Fmax * fpass));
CHECK(muscle.getTendonPower(state) == Approx(0.0));
Expand Down
37 changes: 21 additions & 16 deletions OpenSim/Analyses/Test/testOutputReporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,9 @@ void simulateMuscle(
state.setTime(initialTime);
manager.initialize(state);

cout << "\nIntegrating from " << initialTime << " to " << finalTime << endl;

// Start timing the simulation
const clock_t start = clock();
// simulate
state = manager.integrate(finalTime);

// how long did it take?
double comp_time = (double)(clock() - start) / CLOCKS_PER_SEC;

//==========================================================================
// 4. Print the results
//==========================================================================
Expand All @@ -221,13 +214,19 @@ void simulateMuscle(

double val_t0 = tableD.getIndependentColumn()[0];
const SimTK::Real& val_ke0 = tableD.getRowAtIndex(0)[0];
const Vec3& val_omega0 = tableV3.getRowAtIndex(01)[1];
const Vec3& val_omega0 = tableV3.getRowAtIndex(0)[1];
const SimTK::SpatialVec& val_jrf0 = tableSV.getRowAtIndex(0)[1];

ASSERT_EQUAL(t0, val_t0, SimTK::Eps);
ASSERT_EQUAL(ke0, val_ke0, SimTK::Eps);
ASSERT_EQUAL(ang_acc0, val_omega0, SimTK::Eps);
ASSERT_EQUAL(reaction0, val_jrf0, SimTK::Eps);
CHECK_THAT(t0, Catch::Matchers::WithinAbs(val_t0, SimTK::Eps));
CHECK_THAT(ke0, Catch::Matchers::WithinAbs(val_ke0, SimTK::Eps));
for (int i = 0; i < 3; ++i) {
CHECK_THAT(ang_acc0[i],
Catch::Matchers::WithinAbs(val_omega0[i], SimTK::Eps));
for (int j = 0; j < 2; ++j) {
CHECK_THAT(reaction0[j][i],
Catch::Matchers::WithinAbs(val_jrf0[j][i], SimTK::Eps));
}
}

double val_tf = tableD.getIndependentColumn()[tableD.getNumRows() - 1];
const SimTK::Real& val_ke = tableD.getRowAtIndex(tableD.getNumRows() - 1)[0];
Expand All @@ -240,10 +239,16 @@ void simulateMuscle(
auto ang_acc = ball->getAngularAccelerationInGround(state);
auto reaction = slider->calcReactionOnChildExpressedInGround(state);

ASSERT_EQUAL(state.getTime(), val_tf, SimTK::Eps);
ASSERT_EQUAL(ke, val_ke, SimTK::Eps);
ASSERT_EQUAL(ang_acc, val_omega, SimTK::Eps);
ASSERT_EQUAL(reaction, val_jrf, SimTK::Eps);
CHECK_THAT(state.getTime(), Catch::Matchers::WithinAbs(val_tf, SimTK::Eps));
CHECK_THAT(ke, Catch::Matchers::WithinAbs(val_ke, 1e-10));
for (int i = 0; i < 3; ++i) {
CHECK_THAT(ang_acc[i],
Catch::Matchers::WithinAbs(val_omega[i], SimTK::Eps));
for (int j = 0; j < 2; ++j) {
CHECK_THAT(reaction[j][i],
Catch::Matchers::WithinAbs(val_jrf[j][i], SimTK::Eps));
}
}
}

TEST_CASE("Output Reporter")
Expand Down
5 changes: 3 additions & 2 deletions Vendors/tropter/tests/test_derivatives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,9 @@ TEST_CASE("User-supplied sparsity of Hessian of Lagrangian")
const auto& i = hes_sparsity.row[inz];
const auto& j = hes_sparsity.col[inz];
INFO(inz << " (" << i << " " << j << ")");
REQUIRE(analytical_hessian(i, j) ==
Approx(actual_hessian_values[inz]).epsilon(1e-5));
REQUIRE_THAT(analytical_hessian(i, j),
Catch::Matchers::WithinAbs(
actual_hessian_values[inz], 1e-5));
}
}
{
Expand Down
Loading