haskell-numerics / hmatrix

Linear algebra and numerical computation
379 stars 105 forks source link

Is hmatrix thread safe? #212

Open XinhuaZhang opened 7 years ago

XinhuaZhang commented 7 years ago

Hi,

I wonder if I could run parMap with +RTS -N option to use hmatrix correctly now? I remember that when I tried this a long time ago, it gave me weird results. Since hmatrix uses external library, I guess that it was not thread safe.

albertoruiz commented 7 years ago

Yes, hmatrix-base is thread safe (assuming no bugs). It only uses blas-lapack and custom C code without state. We had some problems in the past with random numbers, https://github.com/albertoruiz/hmatrix/issues/97, but I hope this is now solved. If you find something strange please make a bug report.