This forum has been archived. All content is frozen. Please use KDE Discuss instead.

exploit openmp parallelisation for this sparse solver setup

Tags: None
(comma "," separated)
pamparana
Registered Member
Posts
18
Karma
0
I am using `Eigen 3.3.7` and using it to solve a linear system and am using the sparse matrix and solver facilities within Eigen.

So, I have openMP enabled and querying the number of threads returns the number of threads I have setup using openMP.

Now, the setup is as follows:

Code: Select all
Eigen::SparseMatrix<double> A;
// Fill the matrix
A.setFromTriplets(tripletList.begin(), tripletList.end());

vector_t b_vec;
// fill the vector
Eigen::ConjugateGradient<Eigen::SparseMatrix<double> > cg;
cg.setMaxIterations(256);
cg.setTolerance(0.001);
cg.compute(A);
x = cg.solve(b_vec);


I am not seeing anything in terms of computation time with OpenMP and I was wondering if I need to do anything else or if it is even possible to gain some speedup through parallel computation with this solver?
jensw
Registered Member
Posts
8
Karma
0
according to https://eigen.tuxfamily.org/dox/classEi ... dient.html

you have to set the _UpLo template parameter, because the default is that the triangular part that will be used for the computations. It can be Lower, Upper, or Lower|Upper in which the full matrix entries will be considered. Default is Lower, best performance is Lower|Upper.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]