I am currently developping a code that requires the inversion of a matrix. I use the Lapack function DGETRF to compute LU decomposition of the matrix.
I am experiencing a segmentation fault as the execution reach this function:
forrtl: severe(174): SIGSEGV, segmentation fault occured
and the terminal crashes (even CTRL+C doesn't work, I am forced to quit the terminal...).
Obviously, this is not due to DGETRF itself. And, I am using it the same way it was done in the code it is based on, so that I don't think it is due to a bad use of the function. Added to that, I asssume that uncorrect input parameters should lead to an error, not a crash. I have tested to reduce the size of the matrix which had no effect. So it is not due to a limit of memory.
I read somewhere that it could be due to a "corrupted stack", or something that I don't really understand. What I understood is that it could be due to a bad construction of my matrix. In the previous code, it was built using one general loop. In my version, I build it using several steps, by initializing it to 0 and filling in it with my values. The matrix is allocatable, and defined in a global way.
Have you any idea of what happen ? What could I do to find the issue ?
Please let me know if you need more information.
Thanks for helping me.
PhD Student in Biomechanics