This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1154 - openMP static scheduling on Sparse*Dense product is suboptimal
Summary: openMP static scheduling on Sparse*Dense product is suboptimal
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-26 10:24 UTC by fabien chêne
Modified: 2019-12-04 15:22 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.
Comment 2 Nobody 2019-12-04 15:22:36 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1154.

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