Skip to content

Commit

Permalink
Merge pull request #3921 from opensim-org/ci_fixes_09302024
Browse files Browse the repository at this point in the history
CI fixes: Mac runner upgrade and Doxygen installations
  • Loading branch information
nickbianco authored Oct 4, 2024
2 parents 4a8707b + a05e4db commit f874170
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 43 deletions.
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, 1e-10));

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, 1e-10));
CHECK_THAT(muscle.getActiveFiberForceAlongTendon(state),
Catch::Matchers::WithinAbs(0.0, 1e-10));
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, 1e-10));
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

0 comments on commit f874170

Please sign in to comment.