Registered Member
|
Hello,
I am using Eigen 3.1.0-alpha1 Using the code below I am able to cause an infinite loop in general_matrix_matrix_product. JacN is 2x3 fixed size JacD is 2x2 dynamic size JacND(2, JacN.cols()+JacD.cols()-2) is 2x3 dynamic size
Note: - The infinite loop is triggered only in rare situation (e.g. in 1 out of 10 runs) - The code itself is executed in a loop parallelized using OpenMP - EIGEN_HAS_OPENMP is not defined - Compiler used is Visual Studio 2010 The infinite loop is caused in GeneralMatrixMatrix.h row 188 for(Index i2=0; i2<rows; i2+=mc) because mc = 0 (!), rows = 2 In line 81 Index mc is calculated as follows Index mc = (std::min)(rows,blocking.mc()); level3_blocking<LhsScalar,RhsScalar>& blocking has members {m_blockA=0x0000000000000000 m_blockB=0x0000000000000000 m_blockW=0x0000000000000000 m_mc=0 m_nc=3 m_kc=2} The question is if I am doing something wrong here or if this is a bug? I also tried:
But it had no effect. Regards Call stack is if that is of use
|
Registered Member
|
Note, I am able to reproduce this using the following code. Then in about 1 of 10 execution the code blocks.
The code works well if not run in parallel (i.e. without OpenMP). So I guess something is not completely thread safe in this configuration of the matrix product (maybe because block() is used). |
Moderator
|
I remember I fixed a similar issue not long ago. Perhaps you re-try with alpha2? Also you might want to disable Eigen's own parallelization using either -DEIGEN_DONT_PARALLELIZE, or at runtime: Eigen::setNbThreads(1); If alpha-2 does not work, can you try to perform a dummy product before the openmp part:
MatrixXf a(1,1); a << 1; a = a*a; |
Registered Member
|
Thx for the answer,
I see in the changelog of alpha-2 that bug #406 was fixed, which is explained here: http://stackoverflow.com/questions/8828 ... ck/8840839 I looks exactly like what I discovered. I will try alpha-2 and if that does not work post again. Thx for the help! |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]