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

Strange Behavior on Linux vs macos #243

Closed
iliailmer opened this issue Dec 13, 2022 · 1 comment
Closed

Strange Behavior on Linux vs macos #243

iliailmer opened this issue Dec 13, 2022 · 1 comment

Comments

@iliailmer
Copy link

I have been working on some code that uses LinearSolve and I ran into a strange behavior depending on OS.

using LinearSolve
using DelimitedFiles

A = readdlm("A.txt")
b = readdlm("b.txt")

prob = LinearSolve.LinearProblem(A, b)
c = LinearSolve.solve(prob)

A has a determinant -2.4703845333287813e-50. On macos, the code above produces an answer, on a Linux machine I get a singularity error. Why is the behavior so different?

The input files are here:
A.txt
b.txt

@ChrisRackauckas
Copy link
Member

That's not strange. Different BLAS implementations, which will change depending on the OS, will use different SIMD vector lengths and summation orders. Changes to multithreading will also change multithreading. Because floating point arithmetic is not associative, that will lead to differences (based on the condition number of the matrix). -2.4703845333287813e-50 is just indiscernibly close to zero with 64-bit floating points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants