problem linking with MKL

Issue #90 wontfix
marital_weeping created an issue
int main() {
    std::random_device rnd_device;
    std::mt19937 mersenne_engine(rnd_device());
    std::uniform_real_distribution<double> dist(0.,1.);
    auto gen = std::bind(dist, mersenne_engine);
    const auto N = 10;
    std::vector<double> m(N);
    std::vector<double> a(N);
    std::generate(m.begin(), m.end(), gen);
    std::generate(a.begin(), a.end(), gen);
    blaze::DynamicMatrix<double> X(N,2);
    for (auto i = 0 ; i != N ; ++i) {
        X(i,0) = 1.0;
        X(i,1) = m[i];
    }
    blaze::DynamicVector<double> y(N);
    for (auto i = 0 ; i != N ; ++i) {
        y[i] = a[i];
    }
    blaze::DynamicMatrix<double> Q;
    blaze::DynamicMatrix<double> R;
    qr( X, Q, R );

    return 0;
}

I am getting the following error from the above code:

g++-6 -o blazeLm blazeLm.cpp -O3 -DMKL_ILP64 -m64 -L${MKLROOT}/lib -Wl,-rpath,${MKLROOT}/lib -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl ; ./blazeLm

Intel MKL ERROR: Parameter 4 was incorrect on entry to DGELQF.

Intel MKL ERROR: Parameter 2 was incorrect on entry to DORGLQ.

I apologise if this is not the right forum for asking such a question, but can you point out what I might be getting wrong here?

Comments (8)

  1. Klaus Iglberger

    Hi!

    Could you please provide us with the information with version of Blaze you are using (3.0, 3.1, fresh clone from the repository, ...)? In case you are using Blaze 3.0, could you please update to 3.1 and try again?

    Best regards,

    Klaus!

  2. marital_weeping reporter

    Hi Klaus,

    It's a fresh clone from the repository: cloned yesterday, and once earlier today. Each time I get the same error message.

    My machine is a MacBook Pro (late 2014) with a Haswell quad core processor and 16GB RAM, running MacOS Sierra.

    Thanks for this fantastic library!

    mw

  3. Klaus Iglberger

    Hi mw!

    Thanks for the quick reply. It looks like you are doing everything right. I have tried to get to the bottom of the problem, but unfortunately couldn't come up with a quick solution. A first test with ATLAS and OpenBLAS does not show the same problem, it seems to be an MKL-specific problem. I will try to find a solution as quickly as possible and apologize for the inconvenience.

    Best regards,

    Klaus!

  4. Klaus Iglberger

    Hi mw!

    Sorry for the long waiting time. Usually we try to fix problems within the first two days after the issue has been created. In this case, however, in order to reproduce the problem, we run tests for some days with several LAPACK libraries and several version of the MKL. Unfortunately we were not able to reproduce it: Tests with Atlas, OpenBLAS, MKL 11.3.3, 14.0.2, and 15.0.0 did not show the mentioned problem. From this we have to conclude that it is not an issue within the Blaze library.

    We have one more idea how to fix the problem on your side. Please try to use columnMajor matrices instead of rowMajor matrices. In this case the dgeqrf() function is called instead of dgelqf(), which might not suffer from the same problem. Hopefully this helps to circumvent the problem.

    Best regards,

    Klaus!

  5. marital_weeping reporter

    Hi Klaus,

    Thanks for looking into it. I will experiment with your suggestion and let you know. Thanks again for the fantastic library!

    -mw

  6. Daniel Baker

    I’m able to reproduce this on OSX with MKL version 20190001, and blaze-lib`v3.5-752-gcc8016b5c`, but it may likely be an interfacing problem with MKL rather than a fundamental problem, as there’s no such issue with openblas.

  7. Klaus Iglberger

    Hi Daniel!

    Thanks for the information. Since we are continuously running tests with ATLAS, OpenBLAS and the MKL and don’t experience this issue, it appears to be a special case with the MKL. In case you happen to understand which combination of parameters triggers this effect, we would be grateful for an explanation. In order to circumvent the issue, please try to use columnMajor matrices instead of rowMajor matrices. Thanks,

    Best regards,

    Klaus!

  8. Log in to comment