Skip to content
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

Bugs in A_mul_Bc for CholmodSparse #9160

Closed
acroy opened this issue Nov 26, 2014 · 1 comment
Closed

Bugs in A_mul_Bc for CholmodSparse #9160

acroy opened this issue Nov 26, 2014 · 1 comment
Labels
sparse Sparse arrays

Comments

@acroy
Copy link
Contributor

acroy commented Nov 26, 2014

I just noticed some issues with A_mul_Bc and Ac_mul_B in CHOLMOD. If

A = sprand(10, 10, 0.1);
cmA = Base.LinAlg.CHOLMOD.CholmodSparse(A)

B = sprand(10, 10, 0.1);
cmB = Base.LinAlg.CHOLMOD.CholmodSparse(B)

then cmA*cmB' and cmA'*cmB segfault. The reason is that the ccall of cholmod_transpose in
cholmod.jl#L507-L510 and cholmod.jl#L540-L543 misses the second argument which should be 1 in this case (see code for transpose).

There is also a return missing in cholmod.jl#L500.

Another issue arises if A is symmetric. Then only the upper part is stored, but cholmod_aat needs both parts for some reason. Although the error seems to be detected, there is still a segfault.

julia> A = sprand(10, 10, 0.1); A = 0.5*(A + A');
julia> cmA = Base.LinAlg.CHOLMOD.CholmodSparse(A)
CHOLMOD sparse:  :  10-by-10, nz 7, upper.
  nzmax 7, sorted, packed, 
  scalar types: SuiteSparse_long, real, double
  col 0: nz 0 start 0 end 0:
  col 1: nz 0 start 0 end 0:
  col 2: nz 0 start 0 end 0:
  col 3: nz 0 start 0 end 0:
  col 4: nz 0 start 0 end 0:
  col 5: nz 0 start 0 end 0:
  col 6: nz 2 start 0 end 2:
         2: 0.11708
    ...
  col 9: nz 1 start 6 end 7:
         8: 0.3815
  nnz on diagonal: 0
  OK

julia> cmA*cmA'
CHOLMOD error: matrix cannot be symmetric
CHOLMOD error: argument missing

signal (11): Segmentation fault
A_mul_Bc at linalg/cholmod.jl:520
@ViralBShah ViralBShah added the sparse Sparse arrays label Nov 26, 2014
acroy added a commit to acroy/julia that referenced this issue Nov 28, 2014
acroy added a commit to acroy/julia that referenced this issue Dec 1, 2014
acroy added a commit to acroy/julia that referenced this issue Dec 7, 2014
… Remove support for single precision types and ssmult for matrices with complex entries. Added tests for Cholmod issue JuliaLang#9160.
tkelman added a commit that referenced this issue Dec 12, 2014
Fix issues with A_mul_Bc and Ac_mul_B for CholmodSparse (#9160).
@tkelman
Copy link
Contributor

tkelman commented Dec 12, 2014

Closed by #9189?

@tkelman tkelman closed this as completed Dec 12, 2014
tkelman pushed a commit that referenced this issue Dec 15, 2014
… Remove support for single precision types and ssmult for matrices with complex entries. Added tests for Cholmod issue #9160.

(cherry picked from commit 877a29c)

Conflicts:
	base/linalg/cholmod.jl
	test/runtests.jl
tkelman pushed a commit that referenced this issue Dec 15, 2014
… Remove support for single precision types and ssmult for matrices with complex entries. Added tests for Cholmod issue #9160.

(cherry picked from commit 877a29c)

Conflicts:
	base/linalg/cholmod.jl
	test/runtests.jl

Add jl_cholmod_sizeof_long to SuiteSparse_wrapper. Select supported index types based on size of SuitSparse_long. Test adjusted.

(cherry picked from commit 5f333b1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sparse Sparse arrays
Projects
None yet
Development

No branches or pull requests

3 participants