scipy / scipy

SciPy library main repository
https://scipy.org
BSD 3-Clause "New" or "Revised" License
12.97k stars 5.16k forks source link

Adjustment to data types in VODE Fortran code to address limitations in scipy integration functionality #12820

Open JustinS6626 opened 4 years ago

JustinS6626 commented 4 years ago

Is your feature request related to a problem? Please describe. It looks like I managed to break scipy when using its integration functionality through the qutip module for a quantum mechanics calculation. I can't share the details of the project, but I got the following exception:

raise Exception("ODE integration error: Try to increase " Exception: ODE integration error: Try to increase the allowed number of substeps by increasing the nsteps parameter in the Options class.

Describe the solution you'd like I think that it would be a good idea to improve on the Fortran code for the ODE solvers, given that, from what I can see, the code hasn't been changed since about 1989. In particular, the declaration of the number of steps as an INTEGER limits the value of the number of steps to 2147483647. In my code, the nsteps parameter was set to 2147483617 when the error occurred. This limitation, and several others, could be addressed if INTEGER variables in the Fortran code were changed to INTEGER8, DOUBLE PRECISION to REAL16, and DOUBLE COMPLEX to COMPLEX*32. I have already started working on these modifications, but the place where I am stuck is in getting the code to compile properly with these modifications, so I was hoping that someone who is more familiar with the scipy compilation ecosystem might be willing to help me with that part.

Describe alternatives you've considered I will continue to experiment with other parameters of the Options class to see if there are any adjustments at the python level that might work.

Additional context (e.g. screenshots)

rgommers commented 2 years ago

I'm not sure that there's anything that can be done here, the report is too vague. @DarthMalloc if you have trouble building SciPy, please open a new issue with detailed steps taken, so someone can help you.