***[Possible UCE]*** Re: [SciPy-user] odeint -- segmentation fault

Travis E. Oliphant oliphant at ee.byu.edu
Tue Aug 31 18:19:42 EDT 2004


Giovanni Samaey wrote:
> Hi,
> 
> I have *much* more information now.
> A simple Python rhs function suffices to get the segmentation fault.
> A sample code that produces the segfault is attached:
> The function integrate calls odeint with the "equation being defined 
> through
> dydt.  This dydt initialized another integration, around each point x, 
> and calls
> a function step, which executes odeint with "equation" rhs.
> 
> The crucial point to get the segfault is that rhs has a different number 
> of odes than dydt.
> The sample code added here gives print statements that should help 
> understand execution,
> and a comment is added that would indicate the segfault.
> 
> I am working on linux with SciPy version '0.3.0_266.4239', Numeric 23.3 
> and python 2.3.4
> 
> 
> Robert Kern wrote:
> 

I think I've fixed this problem.  The problem seems to be that lsoda 
(written in Fortran) made heavy use of common blocks which made it 
difficult to use in a re-entrant fashion (your dydt function itself 
calls odeint).

ODEPACK provided a function to save and restore the common block which I 
  sprinkled throughout the original fortran code so that the functions 
called (and jacobians) could use odeint without ruining the needed 
common block for the rest of the algorithm.

Your test script now works on my system and the fixes are in CVS.

I hope this helps


-Travis




More information about the SciPy-User mailing list