Debugging within Octave's internal solvers for the ODE 15 {i,s} GSoC project

I have been working for the GSoC project to use custom implementations of datatypes and solvers in SUNDIALS for Octave’s Ode15{i,s} solvers. The work done so far is discussed over at the project topic, the code stored over at this repository and some public blogs written here.

I have been having discussion with @cdf about this till some time ago, and once the vector and matrix implementations were completed we planned to move forward to use the solve() method on the SparseMatrix and Matrix classes, and use that as the base linear solver for the IDA functions in SUNDIALS.

However, inspite of the initial wrapper created by me passing the required tests (more on that explained here, I have faced a few issues in running the example that I am currently stuck on. I have explained these issues in detail in this post and would greatly appreciate some help.

Apart from that, another thing I tried was integrating my code with the file and running the tests in the ode15i.m file. The tests failed, but the error message displayed was

!!!!! test failed
out of memory or dimension too large for Octave's index type

Which differs from the failed to factorize error shown while running an example directly using the solvers. So I am hoping to debug the tests in this m-file in more detail to be detail to be understand what is happening, and here is where I hope someone in the community can help.

I used the keyboard() command in the m-file to enter debug mode, and am able to use commands such as dbstep. However, when the code reaches this line of execution

[t, y, te, ye, ie] = __ode15__ (fcn, trange, y0, yp0, options, 3);

dbstep in no longer works to show the internal working of the function, which is crucial for me. I am familiar with gdb, but not so much with the Octave interpreter, and am hoping for some guidance to what I could do. I have also been unable to have contact with @cdf since the past two weeks as well.

Your current problem is that dbstep cannot step through ode15, correct? Can you insert print statements inside to give you that information?

octave’s editor and debugger can only step through mfiles. it can step over, but not inside, compiled functions,

inserting debug print statements is the best approach, as @arungiridhar suggested

IIUC, dld functions are exported with the prefix F from the libraries. So, it should be possible to add a breakpoint with gdb with something like b F__ode15__. Hopefully, you’ll be able to step through that function from there…

Thanks everyone for your suggestions. I’ll try the approach for basic debug print statements and see what result I am able to obtain.

If I need more clarity I’ll try the approach with gdb as well.

this is very likely due to conversion of a sparse matrix to full matrix, we can try to find out why this happens when we have our call

Thank you everyone, I have been able to effectively solve this error and use the N_VMakeOctave() function, to use a ColumnVector in a N_Vector.
I have also detailed some problems arising now in this post, and would be extremely grateful if someone could help point the direction I am going wrong in.