simbody icon indicating copy to clipboard operation
simbody copied to clipboard

Mojave calculation result differs

Open Luli2020 opened this issue 6 years ago • 6 comments

We are trying to upgrade our development system into Mojave, however we found that the calculation results differs (slightly but noticeable) from that in other platform (High Sierra or Ubuntu) so our unit test failed. Anybody has same experience or any insight about it? The program used MultibodySystem, TimeStepper, RungeKuttaMersonIntegrator etc., and the change happens when first TimeStepper::stepTo() function was called.

Luli2020 avatar May 30 '19 16:05 Luli2020

Can you provide more information? Which unit test(s) failed (some are touchier than others)? It would also be interesting to know whether the test(s) fail only with full optimization on, or whether it always fails with Mojave even in unoptimized builds (Debug, for example).

sherm1 avatar May 31 '19 05:05 sherm1

Our system is basically a multibody vehicle with 4 wheels, and our unit test is to make sure the calculation will not change much for the expected location, velocity, and acceleration, etc after some time period. The acceleration changed more which caused the changes in velocity and location. The test failed in Majave for both cases with optimization on or off.

Luli2020 avatar May 31 '19 17:05 Luli2020

Oh, I thought you meant that Simbody's unit tests failed. If you build simbody and run all its built-in tests, are those OK?

sherm1 avatar May 31 '19 17:05 sherm1

Yes, there is no issue for the Simbody unit tests.

Luli2020 avatar May 31 '19 18:05 Luli2020

A few random thoughts:

  • One thing to check is whether you have any indeterminacy in your code (uninitialized variables, random numbers) that could be arbitrarily different on different machines.
  • Another possibility is that you are getting roundoff-error-sided changes in accelerations perhaps due to legitimate, but different, instruction choices made by a newer compiler on Mojave. In some very-sensitive simulations tiny changes can become magnified. You may want to look carefully at the simulation to make sure it doesn't behave chaotically during the testing.

sherm1 avatar May 31 '19 20:05 sherm1

Thanks for the input, will do more investigation.

Luli2020 avatar May 31 '19 21:05 Luli2020