Closed aueelis closed 8 years ago
I think there are two issues here. The issue that triggers the segfault is that fa
is moved from one process to another and this won't work because a sparse QR object is just a pointer to C struct handled by SPQR.
When using @spawn
, there is an ambiguity about which process to use when executing fetch(fa) \ fetch(b)
when fa
and b
are on two different processes. From the RemoteRef
s, you can see that fa
is on process 2 and b
and c
are on process 3. If you create c
with
julia> c = @spawnat fa.where fetch(fa) \ fetch(b)
Future(2,1,10,Nullable{Any}())
julia> fetch(c)
5x5 Array{Float64,2}:
5.74502 -8.21385 -2.35193 1.60267 -1.30705
4.95325 -4.9708 -1.94713 -1.55292 1.59012
-5.9495 7.69385 3.70573 -1.63633 1.22123
-1.39242 1.21979 -0.656823 1.70116 -0.257719
-2.34509 4.46599 0.60584 0.78298 -1.03139
it works. This is tricky to fix because the @spawn
macro doesn't know if an object can be moved or not. However, you should have received a normal error instead of a segfault.
The question is then why it segfaults instead of giving an error. This also happens on 0.5. @amitmurthy @yuyichao any ideas?
I've figured out what is happening here. It's \
on the the SPQR
object when the pointer has been zeroed because of the serialization. We'll probably have to check the pointer on entry for all exported functions in SuiteSparse.
I was comparing LU- and QR-Factorization and wanted to implement parallelism. I noticed that fetching the QR-factorized matrix
fa
at the same time as the identity matrixb
results in a segmentation fault, while the same works fine withlufact
. Additionally, serial code works, too.Error: