I was working on solving a tri-diagonal system with Math.Net. I've installed the MKL (x86) and the OpenBLAS extension, but apparently when I see the CPU usage I only see one core is working. This is the code
MathNet.Numerics.Control.UseNativeMKL();
MathNet.Numerics.Control.UseMultiThreading();
Matrix<double> A;
Vector<double> x;
Vector<double> b;
// *** FILL A and B ***
for (int n = 0; n < 50000; n++)
x = A.Solve(b);
This is of course a much simplified version of the actual code, but nothing helps in using more than 1 CPU.
The code is compiled in Release with optimizations enabled, and I tried both "Any CPUs" and "x64".
Am I doing something wrong?
[EDIT] Forgot to mention but A and b might change during the for loop, ergo, I can't parallelise the for loop. This question is more orientated on "How can I force Math.Net to use the multithreaded wrapper of its LA provider?"