***[Possible UCE]*** Re: [SciPy-user] odeint -- segmentation fault
Travis E. Oliphant
oliphant at ee.byu.edu
Tue Aug 31 17:19:42 CDT 2004
Giovanni Samaey wrote:
> 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
> 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
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
More information about the SciPy-user