Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Intel ode Solvers Hang? lock?

billiskatz
Beginner
963 Views
Hey Intel developers...

I use intel fortran compiler for a while now. I have to say i am very pleased with its performance, especially the mkl threaded routines are pretty good .
For the last 2 months i am trying to solve a system of 2 ordinary differential equations for my Msc thesis (yeah 8 hours every day...). I have used many routines from simple runge kutta to more sophisticated ode packs likedlsoda from Odepack (Livermoore University) and ofc intel ode solvers. The main problem of my equations is that they are non-linear and stiff (super stiff i may say). I realised that my best shot was to stick with the intel ode solvers.
Equations to be solved {
dAA/dt= R1(CA-AA)^2 -R2 AA+R3 BB (eq 1)
dBB/dt= R4(CB-BB)^2 -R5 BB+R6 AA (eq 2)
} Where AA,BB uknown Variables ,R1-R5 ,CA,CB known coefficients .
Now the problems with intel ode solvers that arise are :
1) The ierr flag is supposed to take values either "0" or "negative" thats what the maunal says .
But that isnt my case. Usually the ierr returns the value "4294967296" and when i break with the debugger the ierr="8589834593" (not so frequently though the last one...). I have to assume that is because i am using the 64 version of the fortran compiler and 64 version of intel odesolvers... Am i correct?
(but if i use "integer*4 ierr" ,ierr nicely returns "0" ....)
2) My second problem which is the most important, is that while everything works well thedodesol subroutine hangs...it doesnt produce anything, it stops calling functions to numerically calculate the jacobi matrix (stiff problem => implicit method) and with other words none of my written code is executed again. Two cores of my i7 processor have 70% load average...and even after of 24 hours no result no nothing. My system doesnt freeze during the hungup nor i get any issues with the ssd hard disc. Also my ram usage is pretty low 4g out of 12 gb available (considering that for my program i use a lot of ram for storing large vectors...).
The funny thing is that while dodesol doesnt hang, its very effective. I am calculating concetrations on varius sequential points of an aquifer. Dodesolneeds for each point like 0.5 secs to complete... everything is very fast and then at a random point ..... it hangs.... Points are very close to each other and thus coefficient values and everything should be pretty much similar....
After of some time i found out that if i reducetr from tr=1.D-20 to tr=1.D-50 the points of previous hanging seem to go away but new points come to the surface which didnt exist when tr=1.D-20. All this leads me to stability problems. While dodesol is hanged i break All with the debugger and the ierr has value either "-9999" or either"8589834593" (depenting if i use integer*4 or simple integer)
What i wanted to ask is there anyway to break free from the hang take again execution control and get a chance to try with new values?.... Is there any possibility that the dodesol cant handle Nan values and falls into infinity loops? ( I ve set my system to break when ever a nan value is found)
Thanks in advance for any assistance that you may provide....
Plz dont hesitate to ask me anything that might help...
P.S System spec
Intel I7 (975 extreme)
12 g ram
80 gb ssd hard disc
Windows 7 64bit
Visual studio 2008
Fortran compiler 11.1
Intel ode solver w_ode_a_1.0.0.006
Thanks again....!!!!
Billis
0 Kudos
6 Replies
mecej4
Honored Contributor III
963 Views
Your description is incomplete (for example, what are CA, CB?), but it seems that the problem is simple enough that the source code to solve a pair of ODEs would be rather short. If you provide that code and specify how to run it to see the problem, it would help.

If you are passing arguments of the wrong type (e.g., integer*4 instead of integer*8 or vice versa), or looking at the value of ierr before it has been defined in the ODE solver, what you see is not worth discussing.
0 Kudos
billiskatz
Beginner
963 Views
Thanks for looking into,mecej4.
I have updated correctly my description. Ca,Cb Known constants.
As for ierr i use everywhere the same type "integer ierr". But when the ode solver returns i get ierr="4294967296". Normally as the manual describes i should get either ierr="0" or negative in case of error.
I assume this happens because the manual refers somehow to 32bit version while i use 64.
My problem is that the ode solver hangs... I wish it would return even with an error. I still havent understand what happens when for the requested accuracy i.e. ep=1.d-5 the minimum step hm i provided is not enough. Shouldnt i get an error in return?
I tried giving a big step not enough for the ode solver work properly. And instead of returning with bad results or an error it hangs again....
Anyways like i told in the begging because of the stiffness the above system cant be soled easily.... I tried mathematica and simple methods and all failed.... I am working on this system for 2 months.... Its not easy believe me...
If you really need a sample of my code i ll try to provide one.... But plz focus on the hang... and keep in mind 64bits ode solver....
Thanks really for your timemecej4

With honor
Billis
0 Kudos
mecej4
Honored Contributor III
963 Views
I'll wait for you to post the code, but in the meantime let me remark that ierr=4294967296_10 is 100000000_16 = 4G. That is why I wondered whether you had errors related to integer length.
0 Kudos
billiskatz
Beginner
963 Views
I ll try to do my best to strip down the code and let only the neccessary to be seen (,its not easy though).
But before that isnt there any error to be thrown whenever the hm is not small enough to solve the problemwith the requested accuraccy ep , or something like that?
Thanks in advance,
Billis
0 Kudos
mecej4
Honored Contributor III
963 Views
>But before that isnt there any error to be thrown whenever the hm is not small enough to solve the problemwith the requested accuraccy ep , or something like that?

That kind of error estimation usually pertains to local, rather than global error. In the presence of stiffness, local error control is probably not going to suffice.
0 Kudos
billiskatz
Beginner
963 Views
So there arent any errors to be thrown in case something goes wrong and the intel ode solver cant produce the required results? Like infinity loops or nan values or anything abnormal?
The only errors i found are these, which check only the input values.

ierr = -100 Error occurred: the number of equations n is less than zero.
ierr = -201 Error occurred: the initial value of t is greater than the end of integration interval t_end.
ierr = -202 Error occurred: the initial step size h or minimal step size hm is non-positive.
ierr = -203 Error occurred: the relative error tolerance ep is non-positive.
ierr = -204 Error occurred: the threshold for control of the relative error is non-positive.
Right?
Thanks in advance,
Billis
0 Kudos
Reply