-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Bug in UMFPack Interface #149
Comments
Link to google groups discussion: https://groups.google.com/forum/#!topic/julia-users/_3PLfz3vMZk |
Oops, sorry @andreasnoack - Assigned to you by mistake while trying to set the label. The github android interface is not the greatest... |
andreasnoack, linear algebra, same thing |
@cortner Is it possible for you to provide a reproducible code example for this problem? It makes it much easier to fix. |
This is from a little FEM code I wrote - I will reduce it to a bare minimum and make it available as a notebook. |
@andreasnoack I uploaded a notebook with the code on my homepage: The second cell are the matrix assembly routines. Then in the subsequent cells I have some examples that work and one that does not. I hope this help. |
The "THIS DOES NOT WORK" part works for me. What is your |
Julia Version 0.3.2 Strange, I definitely updated to 0.3.3 - I will check to see what is going on and then post again. |
After updating IJulia to 3.3, it now does indeed work. I am very sorry for having wasted your time. (In my defense - a few days ago it was still a bug.) Out of curiosity: what changed between versions? Christoph |
No problem. It didn't take long time to check your example. Actually, I don't know which change that you have affected this. |
@ivarne That is pretty cool. Didn't know about that. |
So I ran into the problem again. I updated the notebook with a reproducible example: I did not get the problem when the system matrix was symmetric, but I did get it when it was non-symmetric. So I suspect that Julia v.3.3 checks for symmetry and then uses a different solver. @andreasnoack would you be willing to double-check this, and I would also be interested if there is a temporary workaround? Thanks, Christoph |
@andreasnoack How about tests? cc: @JuliaBackports |
Already backported apparently 6c995fedefea316d94f630c622e3d990dfe49355 Tests would be a very good idea |
Thanks for the julia> using Base.LinAlg.UMFPACK.increment!
julia> A = sparse(increment!([0,4,1,1,2,2,0,1,2,3,4,4]),
increment!([0,4,0,2,1,2,1,4,3,2,1,2]),
[2.,1.,3.,4.,-1.,-3.,3.,6.,2.,1.,4.,2.], 5, 5)
5x5 sparse matrix with 12 Float64 entries:
[1, 1] = 2.0
[2, 1] = 3.0
[1, 2] = 3.0
[3, 2] = -1.0
[5, 2] = 4.0
[2, 3] = 4.0
[3, 3] = -3.0
[4, 3] = 1.0
[5, 3] = 2.0
[3, 4] = 2.0
[2, 5] = 6.0
[5, 5] = 1.0
julia> lufact(convert(SparseMatrixCSC{Float64,Int32}, A))
UMFPACK LU Factorization of a 5-by-5 sparse matrix
Ptr{Void} @0x00007fcccf99def0
julia> gc()
julia> gc()
julia(39834,0x7fff7a133300) malloc: *** error for object 0x2: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
signal (6): Abort trap: 6
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Abort trap: 6 |
My goodness. Nope. Sort of like JuliaLang/julia#9185 in that it appears to have something to do with the umfpack finalizers? |
I had some unexplained
\
behaviour that is, according to Ivar Nesje, a bug in/base/linalg/umfpack.jl#L18
Here is a short code snippet that works ok. I get the correct solution from it. Primarily the last line is relevant. ( I can produce the complete code on request. )
If I replace the last line with
then I get the following error message:
umferror
has no method matching umferror(::Int32)while loading In[112], in expression starting on line 3
in umfpack_symbolic! at linalg/umfpack.jl:155
in umfpack_numeric! at linalg/umfpack.jl:176
in lufact at linalg/umfpack.jl:118
in A_ldiv_B! at linalg/sparse.jl:210
in \ at linalg/generic.jl:233
Same happens with
lufact
. I also tried copying B = copy(A[Ifree,Ifree]) first. Same result.I have used UMFPack successfully in other cases. E.g.,
works fine.
I copy Ivar Nesje's comment from Google Groups:
This is at least one bug.
In /base/linalg/umfpack.jl#L18, we have a convenience function to lookup the status code, seems to be restricted to Int64, even though it is called with Int32 on some occations. If you compile yourself, or know how to regenerate the system image, it is pretty easy to change Int to Integer on that line. A real fix for this would require someone to actually check the return types of the C functions called, and include some more tests to ensure that all code paths are followed in the test suite.
The text was updated successfully, but these errors were encountered: