New user self-registration is currently disabled. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Bug 1154 - openMP static scheduling on Sparse*Dense product is suboptimal
openMP static scheduling on Sparse*Dense product is suboptimal
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Sparse
3.3 (current stable)
All All
: Normal Unknown
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-26 10:24 UTC by fabien chêne
Modified: 2016-01-27 17:06 UTC (History)
2 users (show)



Attachments

Description fabien chêne 2016-01-26 10:24:11 UTC
Noticed by using a solver ConjugateGradient<SparseMatrix<double>, Lower|Upper>.
Calling the method solve is slow for me using the static scheduling (in SparseDenseProduct.h). There is comment saying the tuning has been done on a Poisson 2D/3D. If I'm not mistaken, this is case where all lines of the sparse matrix have the same non-zero count, which is probably best handled by the static scheduler. However, with a matrix not banded, with irregular patterns (my case), the dynamic and guided scheduler perform much better (20-30% better in my case).

How about using the guided scheduler here ? Or provide a way to use it ? Or determine to use it automatically if the non-zero count per line is too much irregular ?

What do you think ?
Comment 1 Gael Guennebaud 2016-01-27 17:06:27 UTC
Good point, I've found the following compromise:

  schedule(dynamic,(n+threads*4-1)/(threads*4))

which creates 4 times more chunks than threads. Should be enough to balance the work.

https://bitbucket.org/eigen/eigen/commits/4d6a8a423e98/
Summary:     Bug 1154: move to dynamic scheduling for spmv products.

Note You need to log in before you can comment on or make changes to this bug.