Page MenuHomec4science

BUG: Test for small strain fails in release gcc, but not in gcc with RelWithDebInfo, nor with gcc-debug nor clang
Closed, ResolvedPublic

Description

something gets optimised away

Event Timeline

junge created this task.Jan 29 2018, 21:28
junge created this object in space S1 c4science.
junge created this object with visibility "µSpectre (Project)".
junge created this object with edit policy "µSpectre (Project)".
junge moved this task from Backlog to Doing on the µSpectre board.
junge changed the visibility from "µSpectre (Project)" to "Public (No Login Required)".Jan 31 2018, 13:05
junge lowered the priority of this task from Unbreak Now! to Needs Triage.Jan 31 2018, 13:12

Can't reproduce this on other computers. have to recheck whether this problem even exists.

junge moved this task from Doing to Backlog on the µSpectre board.Jan 31 2018, 13:12
junge closed this task as Resolved.Feb 3 2018, 23:40
junge claimed this task.

Figured it out:

In the case of linear problems, at the end of the cg solv step, we are at the final solution, but the simple convergence test (checking the increment in strain) is not yet triggered.

The second time around, the cg is called with an approximately zero right-hand side. This has a hard time converging, because were checking for |r|/|b| < tol, and |b| is close to zero. In the case of gcc on one of my computers, |b| was exacly zero and boom.

The correct way of handling it is to check convergence on the strain increment, yes, but more importantly we can directly compare the stress divergence to a tolerance.

Now the solvers also take a parameter equl_tol short for equilibrium tolerance, and as a result, the linear cases now converge in one step. Fixed in commit 7058c3ceeeab129d23d1da5b9f48a71e3a2ffe92

junge moved this task from Backlog to Done on the µSpectre board.Feb 3 2018, 23:42