Is there a command which reveals which implementation of BLAS and LAPACK are used in Mathematica's matrix operations such as Eigensystem? I asked a related question on StackOverflow and one user mentioned that in Julia, the BLAS/LAPACK implementation can be found by executing versioninfo(). Several users who tried my code there had varying results, with some observing Mathematica to execute faster, and others observing Julia executing faster.
In my case, my Julia installation appears to make use of the OpenBLAS implementation, and it runs between 3 to 6 times slower than Mathematica's Eigensystem for randomly-generated arrays of size $1000\times1000$ to $2000\times2000$.
In the Mathematica documentation's tutorial/SomeNotesOnInternalImplementation, it mentions "For dense arrays, LAPACK algorithms extended for arbitrary precision are used when appropriate" and "BLAS technology is used to optimize for particular machine architectures", but nothing more.
EDIT: So in response to Kuba's comment, apparently one of the Julia devs noted that there is anomalous behavior in Julia with regards to eigenvector computation speed as a function of BLAS thread number. In short, using more threads in Julia's use of OpenBLAS appears to slow things down considerably. For reference, in Mathematica:
SetSystemOptions["MKLThreads" -> 1];
First@Timing@Eigensystem[RandomReal[{-500, 500}, {1000, 1000}]]
SetSystemOptions["MKLThreads" -> 2];
First@Timing@Eigensystem[RandomReal[{-500, 500}, {1000, 1000}]]
SetSystemOptions["MKLThreads" -> 3];
First@Timing@Eigensystem[RandomReal[{-500, 500}, {1000, 1000}]]
SetSystemOptions["MKLThreads" -> 4];
First@Timing@Eigensystem[RandomReal[{-500, 500}, {1000, 1000}]]
(*Out:*)
1.747211
1.466409
1.341609
1.357209
So I guess there's nothing wrong with Mathematica's implementation.
CCompilers[]; is there any equivalent for determining BLAS architecture? – DumpsterDoofus Feb 08 '14 at 19:28Eigenvaluesand then useSetSystemOptions["MKLThreads" -> 1], check the timing again. – Kuba Feb 08 '14 at 22:29Wolfram/Mathematica/10.0/SystemFiles/Libraries/Linux-x86-64/libmkl_*.soso it is also MKL. If you look at the binary, towards the end of the file, you can see all the functions names defined in the library. Maybe you can reverse engineer the version number. For example compile and link a program to that library and ask for theget_versionfunction. It is likely that such internals are completely inaccesible from Mathematica but can be accessed from C. Didn't try myself. – alfC Oct 24 '14 at 05:54