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

MUMPs seg faults #21

Closed
ohinder opened this issue May 1, 2017 · 8 comments
Closed

MUMPs seg faults #21

ohinder opened this issue May 1, 2017 · 8 comments

Comments

@ohinder
Copy link

ohinder commented May 1, 2017

When I solve multiple linear systems with mumps I often get seg faults. However, I cannot seem to produce a minimal example.

The error occurs after I call solve.

signal (11): Segmentation fault: 11
while loading no file, in expression starting on line 0
dmumps_sol_x_ at /usr/local/Cellar/mumps/5.0.1_1/lib/libdmumps.dylib (unknown line)
dmumps_solve_driver_ at /usr/local/Cellar/mumps/5.0.1_1/lib/libdmumps.dylib (unknown line)
dmumps_ at /usr/local/Cellar/mumps/5.0.1_1/lib/libdmumps.dylib (unknown line)
dmumps_f77_ at /usr/local/Cellar/mumps/5.0.1_1/lib/libdmumps.dylib (unknown line)
Allocations: 33963192 (Pool: 32887682; Big: 1075510); GC: 707
[DN0a22b403:03259] *** Process received signal ***
[DN0a22b403:03259] Signal: Segmentation fault: 11 (11)
[DN0a22b403:03259] Signal code: Address not mapped (1)
[DN0a22b403:03259] Failing at address: 0x7fd8ee45b048
[DN0a22b403:03259] [ 0] 0   libsystem_platform.dylib            0x00007fff85ce252a _sigtramp + 26
[DN0a22b403:03259] [ 1] 0   libdmumps.dylib                     0x00000003145a97cf dmumps_sol_c_ + 13665
[DN0a22b403:03259] *** End of error message ***

signal (11): Segmentation fault: 11
while loading no file, in expression starting on line 0
dmumps_sol_x_ at /usr/local/Cellar/mumps/5.0.1_1/lib/libdmumps.dylib (unknown line)
dmumps_solve_driver_ at /usr/local/Cellar/mumps/5.0.1_1/lib/libdmumps.dylib (unknown line)
dmumps_ at /usr/local/Cellar/mumps/5.0.1_1/lib/libdmumps.dylib (unknown line)
dmumps_f77_ at /usr/local/Cellar/mumps/5.0.1_1/lib/libdmumps.dylib (unknown line)
Allocations: 33963192 (Pool: 32887682; Big: 1075510); GC: 707
@dpo
Copy link
Member

dpo commented May 2, 2017

Thanks for the report. What version of OSX and Julia are you using? If I understand well, you're able to use MUMPS.jl but it occasionally crashes when doing multiple solves with the same factorization?

The latest bottle in Homebrew is for MUMPS 5.0.2 (you're using 5.0.1). Version 5.1.1 is out but I've seen reports of it having issues on the mailing list. If crashes keep happening with the 5.0.2 bottle, could you try and build it from source (brew install -s mumps)?

@ohinder
Copy link
Author

ohinder commented May 3, 2017

Thanks for the suggestions. But after installing MUMPS 5.0.2 and building from source I still have the same problems.

OSX 10.11.5.
julia-0.5.0

@dpo
Copy link
Member

dpo commented May 3, 2017

Thanks for confirming. Without an example, it's going to be difficult for me to help... If I try

using MUMPS
using MPI

MPI.Init()

icntl = get_icntl(verbose=false)

A = sprand(10, 10, .2) + speye(10)
mumps = Mumps{Float64}(mumps_unsymmetric, icntl, default_cntl64)
associate_matrix!(mumps, A)
factorize!(mumps)

for _ = 1:10
  rhs = rand(10)
  associate_rhs!(mumps, rhs)
  solve!(mumps)
  x = get_solution(mumps)
  println(norm(x - A \ rhs) / norm(x))
end

finalize(mumps)
MPI.Finalize()

all seems well:

$ julia test_mumps.jl 
7.441601001671933e-16
4.408406524106888e-16
1.0455306578334694e-15
4.827030402425366e-16
2.1326517097978232e-16
6.578177351526716e-16
1.984242639750494e-16
3.264980923287881e-16
7.176209026781589e-16
6.112115643898685e-16

@ohinder
Copy link
Author

ohinder commented May 3, 2017

yeah. I have struggled to create a simple example. also the segfaults are not deterministic (but my algorithm is). I will try some more ...

@dpo
Copy link
Member

dpo commented May 4, 2017

Do you have a program I could run to see if I also experience the segfaults?

@pablosanjose
Copy link

pablosanjose commented Nov 12, 2018

The following misuse of MUMPS.jl seems to segfault reliably:

using LinearAlgebra
using MPI
using MUMPS
using SparseArrays

root = 0

MPI.Init()
comm = MPI.COMM_WORLD

icntl = default_icntl[:];
icntl[1] = 0;
icntl[2] = 0;
icntl[3] = 0;
icntl[4] = 0;
tol = sqrt(eps(Float64))

mumps3 = Mumps{ComplexF64}(mumps_unsymmetric, icntl, default_cntl64);
A = sprand(10^5, 10^5, 0.00001);
factorize!(mumps3, A);
rhs = rand(10^5)
x = solve(mumps3, rhs);
finalize(mumps3);
MPI.Barrier(comm);

factorize!(mumps3, A);

I assume the problem is trying to use mumps3 after it's been finalized. A segfault should never happen through. No idea if this is related to the OP's issue or not.

@dpo
Copy link
Member

dpo commented Nov 12, 2018

Thank you. I agree that segfaults shouldn't happen. This needs to be fixed.

@dpo
Copy link
Member

dpo commented Aug 24, 2022

Closing this as MUMPS evolved significantly since this issue was open and the segfault doesn't seem to happen any more. Thank you for the reports!

@dpo dpo closed this as completed Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants