Fix by Benjamin seems to work, but something in the changeset broke the 
reaction demo (does not
converge as it did before). Will file a separate bug report.

** Changed in: dolfin
       Status: Confirmed => Fix Committed

-- 
Reaction demo fails when GMP is enabled
https://bugs.launchpad.net/bugs/424159
You received this bug notification because you are subscribed to DOLFIN.

Status in DOLFIN: Fix Committed

Bug description:
[ Testing Launchpad's email interface [0]. ]

Hi,

There is a problem with demo/ode/reaction/cpp when GMP is enabled. I have the 
latest from HG of all FEniCS packages and this is the output I get when I run 
the demo:

$ ./demo 
Reaction ODE demo needs to be fixed.
Using 128 bits per digit, eps = 4.701977e-39
Creating ODE of size 3191.
Solving ODE over the time interval [0.0, 0.01]
  Solving primal problem
    *** Warning: PythonFile: Precision lost. Values will be saved with double 
precision
    Initializing continuous Galerkin method cG(1).
    Using multi-adaptive fixed-point solver.
    Using discrete tolerance tol = 1e-06....
    Computing transpose (inverse) of dependency pattern.
    Time-stepping over the time interval [0, 0.01]
      *** Warning: Time slab system did not converge.
      Direct fixed-point iteration does not converge.
      Trying diagonally damped fixed-point iteration.
      Rejecting time slab K = 1.000e-05, trying again.
      Rejecting time slab K = 8.205e-06, trying again.
      Rejecting time slab K = 6.317e-06, trying again.
      Rejecting time slab K = 4.628e-06, trying again.
demo: dolfin/ode/MultiAdaptiveTimeSlab.cpp:939: void 
dolfin::MultiAdaptiveTimeSlab::cg_feval(dolfin::real*, dolfin::uint, 
dolfin::uint, dolfin::uint, dolfin::real, dolfin::real, dolfin::real): 
Assertion `e1 != -1' failed.
[simula-x61:25117] *** Process received signal ***
[simula-x61:25117] Signal: Aborted (6)
[simula-x61:25117] Signal code:  (-6)
[simula-x61:25117] [ 0] [0xb7f8b440]
[simula-x61:25117] [ 1] /lib/tls/i686/cmov/libc.so.6(abort+0x101) [0xb5b82a01]
[simula-x61:25117] [ 2] /lib/tls/i686/cmov/libc.so.6(__assert_fail+0xee) 
[0xb5b7a10e]
[simula-x61:25117] [ 3] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin21MultiAdaptiveTimeSlab8cg_fevalEP10__gmp_exprIA1_12__mpf_structS3_EjjjS4_S4_S4_+0x133a)
 [0xb7e9216a]
[simula-x61:25117] [ 4] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin29MultiAdaptiveFixedPointSolver9iterationE10__gmp_exprIA1_12__mpf_structS3_EjS4_S4_+0xded)
 [0xb7eb3b8d]
[simula-x61:25117] [ 5] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin14TimeSlabSolver5solveEj+0x17b)
 [0xb7e896bb]
[simula-x61:25117] [ 6] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin14TimeSlabSolver5solveEv+0x42)
 [0xb7e89eb2]
[simula-x61:25117] [ 7] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin21MultiAdaptiveTimeSlab5solveEv+0x117)
 [0xb7e8f057]
[simula-x61:25117] [ 8] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin11TimeStepper4stepERNS_11ODESolutionE10__gmp_exprIA1_12__mpf_structS5_ES6_+0x204)
 [0xb7ea70c4]
[simula-x61:25117] [ 9] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin11TimeStepper4stepERNS_11ODESolutionE+0x84)
 [0xb7ea75c4]
[simula-x61:25117] [10] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin11TimeStepper5solveERNS_11ODESolutionE10__gmp_exprIA1_12__mpf_structS5_ES6_+0x149)
 [0xb7ea80d9]
[simula-x61:25117] [11] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin11TimeStepper5solveERNS_11ODESolutionE+0x66)
 [0xb7ea8426]
[simula-x61:25117] [12] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin9ODESolver12solve_primalERNS_11ODESolutionE+0x72)
 [0xb7ea54e2]
[simula-x61:25117] [13] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin9ODESolver5solveERNS_11ODESolutionE+0x95)
 [0xb7ea5635]
[simula-x61:25117] [14] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin9ODESolver5solveEv+0x4b)
 [0xb7ea5a1b]
[simula-x61:25117] [15] 
/home/johannr/src/hg/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin3ODE5solveEv+0x3e)
 [0xb7e9a51e]
[simula-x61:25117] [16] ./demo(main+0x454) [0x805a314]
[simula-x61:25117] [17] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0) 
[0xb5b6c450]
[simula-x61:25117] [18] 
./demo(_ZN6dolfin3ODE2JTEPK10__gmp_exprIA1_12__mpf_structS3_EPS4_S6_S4_+0x101) 
[0x8059d71]
[simula-x61:25117] *** End of error message ***
Aborted


Using gdb I get this:

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb57c36c0 (LWP 25525)]
0xb7f57410 in __kernel_vsyscall ()
(gdb) where
#0  0xb7f57410 in __kernel_vsyscall ()
#1  0xb5b4d085 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb5b4ea01 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb5b4610e in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#4  0xb7e5e16a in dolfin::MultiAdaptiveTimeSlab::cg_feval (this=0x8385ef8, 
f=0x841f344, s0=0, e0=3188, i0=3188, 
    a...@0xbf84d074, b...@0xbf84d064, k...@0xbf84d054) at 
dolfin/ode/MultiAdaptiveTimeSlab.cpp:939
#5  0xb7e7fb8d in dolfin::MultiAdaptiveFixedPointSolver::iteration 
(this=0x841f368, t...@0xbf84d22c, iter=0, 
    d...@0xbf84d21c, d...@0xbf84d20c) at 
dolfin/ode/MultiAdaptiveFixedPointSolver.cpp:151
#6  0xb7e556bb in dolfin::TimeSlabSolver::solve (this=0x841f368, attempt=0) at 
dolfin/ode/TimeSlabSolver.cpp:71
#7  0xb7e55eb2 in dolfin::TimeSlabSolver::solve (this=0x841f368) at 
dolfin/ode/TimeSlabSolver.cpp:51
#8  0xb7e5b057 in dolfin::MultiAdaptiveTimeSlab::solve (this=0x8385ef8) at 
dolfin/ode/MultiAdaptiveTimeSlab.cpp:118
#9  0xb7e730c4 in dolfin::TimeStepper::step (this=0xbf84d5cc, u...@0xbf84d6d0, 
t...@0xbf84d44c, t...@0xbf84d45c)
    at dolfin/ode/TimeStepper.cpp:96
#10 0xb7e735c4 in dolfin::TimeStepper::step (this=0xbf84d5cc, u...@0xbf84d6d0) 
at dolfin/ode/TimeStepper.cpp:78
#11 0xb7e740d9 in dolfin::TimeStepper::solve (this=0xbf84d5cc, u...@0xbf84d6d0, 
t...@0xbf84d57c, t...@0xbf84d58c)
    at dolfin/ode/TimeStepper.cpp:67
#12 0xb7e74426 in dolfin::TimeStepper::solve (this=0xbf84d5cc, u...@0xbf84d6d0) 
at dolfin/ode/TimeStepper.cpp:54
#13 0xb7e714e2 in dolfin::ODESolver::solve_primal (this=0xbf84d868, 
u...@0xbf84d6d0) at dolfin/ode/ODESolver.cpp:64
#14 0xb7e71635 in dolfin::ODESolver::solve (this=0xbf84d868, u...@0xbf84d6d0) 
at dolfin/ode/ODESolver.cpp:44
#15 0xb7e71a1b in dolfin::ODESolver::solve (this=0xbf84d868) at 
dolfin/ode/ODESolver.cpp:33
#16 0xb7e6651e in dolfin::ODE::solve (this=0xbf84d8a8) at dolfin/ode/ODE.cpp:230
#17 0x0805a314 in main () at main.cpp:106
(gdb) 


If I reduce the size of the variable N from 5000 to 3190, the demo runs fine.

diff -r 717eaa11d058 demo/ode/reaction/cpp/main.cpp
--- a/demo/ode/reaction/cpp/main.cpp    Thu Sep 03 11:10:26 2009 +0200
+++ b/demo/ode/reaction/cpp/main.cpp    Thu Sep 03 14:34:57 2009 +0200
@@ -89,7 +89,7 @@
   const real epsilon = 0.01;
   const real gamma = 1000.0;
   const real L = 1.0;
-  const unsigned int N = 5000;
+  const unsigned int N = 3190;
 
   // Create ODE
   Reaction ode(N, T, L, epsilon, gamma);

It only seems to affect 32 bits systems since both hardy-i386 [1] and mac-osx 
[2] buildbot slaves has this problem while the demo runs fine on jaunty-amd64 
and linux64-exp. 

The demo also runs fine when GMP is disabled.

[0] https://help.launchpad.net/Bugs/EmailInterface
[1] 
http://fenics.org:8080/builders/dolfin-hardy-i386/builds/770/steps/dolfin%20check/logs/demo.log
[2] 
http://fenics.org:8080/builders/dolfin-mac-osx/builds/719/steps/dolfin%20check/logs/demo.log

 affects dolfin
_______________________________________________
DOLFIN-dev mailing list
[email protected]
http://www.fenics.org/mailman/listinfo/dolfin-dev

Reply via email to