-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using JuMP causes Pardiso crash #88
Comments
Could it be related to #73? |
If I replace It seems like the root cause may well be the same though. |
It would be good to try to minimize the problem a bit. For example, is it required to load the full JuMP package or is it enough to load one of the dependencies for it to occur? |
I will look into it and see what I can find. It's pretty clear that there is a type error of some kind when making a |
As suggested in #73, the issue appears to be here. Specifically, the call to This causes the same failure: using MKL_jll
ccall((:MKL_Set_Interface_Layer, MKL_jll.libmkl_rt), Cint, (Cint,), 1)
using Pardiso
A = sparse(I(1)*1.)
b = ones(1)
ps = MKLPardisoSolver()
Pardiso.solve(ps, A, b) It's not clear to me how to fix it though. It seems like it should be possible to just set the interface layer back to 0 (presumably 32 bit), but that doesn't work. In other words, this still fails : using MKL_jll
ccall((:MKL_Set_Interface_Layer, MKL_jll.libmkl_rt), Cint, (Cint,), 1)
ccall((:MKL_Set_Interface_Layer, MKL_jll.libmkl_rt), Cint, (Cint,), 0) #<-- no effect?
using Pardiso
A = sparse(I(1)*1.)
b = ones(1)
ps = MKLPardisoSolver()
Pardiso.solve(ps, A, b) It seems as if the setting from the first call to Even if the value were resettable, there is no obvious way of just fetching the current interface layer setting as far as I can tell. Otherwise a possible solution might just to store the value, make mklstate = ccall((:MKL_Set_Interface_Layer, MKL_jll.libmkl_rt), Cint, (Cint,), -1)
<pardiso calls>
ccall((:MKL_Set_Interface_Layer, MKL_jll.libmkl_rt), Cint, (Cint,), mklstate) That's as far as I could get with this. |
I think you need to set the interface layer before calling any other MKL functions. |
It seems like part of the issue is that Pardiso is defaulting to use A fix that seems to work on my system is changing that line to this: if (LinearAlgebra.BLAS.vendor() ∈ (:mkl,:openblas64) && LinearAlgebra.BlasInt == Int64)
const MklInt = Int64
const PARDISO_FUNC = :pardiso_64
else
const MklInt = Int32
const PARDISO_FUNC = :pardiso
end I can make a PR with that change if it makes sense, but I suspect that I may be fixing the problem by accident rather than addressing the root cause. |
Is this still an issue? The reordering problem in #90 seems to be fixed, so maybe it is also fixed here? |
I'm afraid I can't say other way since MKL is not supported on Mac anymore, so no way for me to test. If the examples above work for you know then I'm happy to close it. |
I am unfortunately in the same situation (i.e. no MKL on mac) so I can not try it out using MKL. I've tried using Panua-Pardiso for which the example seem to run fine. |
I am getting a Pardiso crash if I use JuMP at the same time, but it seems to depend on the order of package inclusion. Example is below. If I do
using JuMP
beforeusing Pardiso
, I get a crash, but if I reverse the order there is no crash. This is all from a fresh Julia session, i.e. I haven't used JuMP for anything, just included it.The Pardiso output in the case of a crash is something like this:
Note the huge number of non-zeros in
L
. In this example it reports "Reordering problem", but I also see "out of memory" errors on occasion when doing something similar. It seems like including JuMP first somehow causes a memory leak in Pardiso, but I don't understand how that is possible.The text was updated successfully, but these errors were encountered: