I'm using Pardiso to solve a large number of linear systems, and its using quite a lot of memory. My program takes the following steps
The amount of memory used by this function steadily increases. By the end of the program, the program is using a lot of memory, almost all of which came from calls to pardiso with phase=33. I don't see why pardiso needs to use so much memory, and I assume I am failing to deallocate something. I don't call pardiso with phase=0 until the end of the program, which I think is because pardiso needs the memory where the LU decomposition is stored all the way to the end. (I tried calling pardiso with phase=0 at the start of step 5, this segfaults). I call mkl_free_buffers_() at the start of step 5, this does not solve the problem.
Any help would be greatly appreciated. I'm using the version of MKL which ships with intel composer 2013 sp1
Two things about this:
calling pardiso with phase=-1 causes a segfault no matter where it is called. I do not understand why this is.
Am I correct in thinking that a call with phase=-1 does everything that phase=0 does, plus more? I can try calling with phase=0 after step 4, this also causes a segfault the next time I call with phase=22. I think this is because every time I call with phase=22 I am using the memory allocated to store the LU matrices. If I free this memory before the last call to phase=22 is done, then the code should segfault