Hi, all !
I just met a strange bus error while using Pardiso. The following is the detailed information.
First, the purpose of my code: As I study finite element method (FEM), I would like to use Pardiso to solve my equations. Since the right hand side changes at each time step but the matrix keeps the same, I want to factorize the matrix once and reuse it for many times. I wrote three subroutines, each of which contains different stages of Pardiso (1. Reordering&factorization; 2. back substitution; 3. release of memory), and linked them with the pointer array pt.
Second, the problem: I put the three subroutines (solver_pardiso_factor/bsubst/termin) in the module (Solver.f90) and call them in the main program (solvercheck.f90). Everything is ok unless the last step of the memory release. The second call of solver_pardiso_termin of matrix 2 returns the bus error.
Third, what's strange: If I put solver_pardiso_termin at the beginning of the module, followed by solver_pardiso_factor and solver_pardiso_bsubst , the code runs in a good condition.
I'm confused about the problem. If anyone can help me, I would be very rateful.
My platform is CentOS 6.9, the version of the ifort is 13.1.1, the version of MKL is 11.0.5. Attached is my code.
If your a.out is 64-bit, you should declare the pt, pt_1 and pt1_2 array variables as INTEGER*8. Even for 32-bit, you can play it safe and use INTEGER*8 for just those arrays. The compiler would have caught this error in your code if you had declared the type of these arrays as MKL_PARDISO_HANDLE (and had provided an include file or module file with a definition of that type, see the MKL documentation).
If your a.out is 64-bit, you should declare the pt, pt_1 and pt1_2 as INTEGER*8. Even for 32-bit, you can play it safe and use INTEGER*8 for just those arrays.
It really works! Thanks a lot :).