Hello,
While testing out MKL Lapack's dtpqrt and dtpmqrt routines, I've stumbled across a weird segfault. I replicated the error in this example (I should mention that I use Eigen just to make my life easier and that populateEigenMat is just creating a random matrix).
The problem is that for different value of the parameter m (the number of rows of the matrix B in Lapack's reference for dtpqrt and dtmqrt), the code either works (small values of m, and the result is correct) or it creates a segfault (larger values of m).
int main() { int m =150; int n = 5; int nb = 1; int l = 0; int info; MatrixXd a(n,n), b(m,n), t(nb, n); populateEigenMat(a), populateEigenMat(b); a = a.eval().triangularView<Eigen::Upper>(); info = LAPACKE_dtpqrt(LAPACK_COL_MAJOR, m, n, l, nb, a.data(), a.rows(), b.data(), b.rows(), t.data(), t.rows()); int k = n; MatrixXd cA(k,n), cB(m,n), c(k+m,n); populateEigenMat(cA), populateEigenMat(cB); c<<cA,cB; cout<<"Still ok!\n"; // cout<<endl<<cB<<endl<<endl<<c.block(k,0,m,n)<<endl<<endl; info = LAPACKE_dtpmqrt(LAPACK_COL_MAJOR, 'L', 'N', m, n, k, l, nb, b.data(), b.rows(), t.data(), t.rows(), c.data(), c.rows(), c.data()+k, c.rows()); }
I'm using version of Intel Composer: composer_xe_2013_sp1.2.144 and the following links -lmkl_intel_ilp64 -lmkl_core -lmkl_sequential -lpthread -std=c++11 -xAVX -DMKL_ILP64.
Could some please tell me where I've made a mistake?
Kind regards