-
Notifications
You must be signed in to change notification settings - Fork 1.6k
dgesv produces incorrect answer when compiling the library using CMake with USE_OPENMP=1 #2396
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
Comments
What processor? Which OpenBLAS version? |
Both my zen and kabylake processors will have the same issue. I use OpenBLAS version 0.3.7 for testing. Yep, directly compile with |
Probably this report will keep experimental label for another release or two. |
my cmake version is 3.16, gnu make version is 4.1 and gcc version is 7.3.0. I test the code on Ubuntu 18.04 and 19.04. I will try cmake on other platforms to see whether similar problem will occur. |
If you say |
Update: I test that if I perform a normal compiling with cmake on unix system using pthread instead of omp, The for cmake (under a build directory):
for make (under
|
How big are exact parameters? http://www.netlib.org/lapack/lapack-3.1.1/html/dgesv.f.html |
On my device, when n=100, the |
Does it correct itself id you make N divisible by 16? i.e if some asm kernel misfires down the hood? |
@brada4 stop please - we know already that it does work correctly when built with gmake, so the error must be somewhere in the cmake rules rather than the actual code. |
@heilokchow |
@marxin the problem is completely reproducible (with or without USE_OPENMP) with just plain |
All right! What we can do is to compare assemblies and see where's a difference. |
I was missing some system header files. Now I can link it against a statically build library. |
At least part of the problem seems to be getrf_single getting built without the |
When I use OpenBLAS to do solve some high dimensional linear equations using
LAPACKE_dgesv
, I use CMake to compile the OpenBLAS librarylibopenblas.a
with-DUSE_OPENMP=1
since my program itself uses OpenMP for parallelism. My CMake build command is (unix system):The computing process doesn't generate any warning or bugs. First, I get vector b by b = A*x, then, I solve x by using dgesv function with parameter A and b. If I compare the original x and solved x, when dimension is low, it works fine with no error. However, when dimension is high, lets say n = 100, the solved x is inconsistent with original x and the error is very large. If I use
make USE_OPENMP=1
to recompilelibopenblas.a
using original (not CMake generated)Makefile
and link my program with this library, the result of dgesv function is always correct. My testing code is shown below:The text was updated successfully, but these errors were encountered: