Registered Member
|
Hi all !
I have used BiCGSTAB solver for my sparse matrix algebra to solve computer vision problem, X = A \ B. matrix A size is 24000 x 24000 (it varies depends on number of 3D points). as you see, its size is too big. so, I had to use sparse matrix instead of dense matrix. so far, so good. BiCGSTAB was a very reliable solution. however, only one problem is remained, speed. it consumes 400-500 ms for solving my matrices. however I need less than 200 ms. thus, I planned to test UmfPack because I believed it was well-known and fast, and it can be easily compiled on windows. (BTW, UmfPack is really faster than BiCGSTAB ?) but, I encountered a runtime error. experts! please check the following code.
in order to know the exact line that causes error, I changed the above command "solver.compute(AA)" like as follows based on UmfPackSupport.h.
so, finally I was able to know which line causes the error. the criminal was umfpack_numeric function ! however I still don't know why. is there a mistake ? or is the matrix too big ? I need your help to solve this problem. Thanks in advance. Best Regards, Yeonchool. p.s. FYI, I'm attaching simple test code. the following code was successfully performed.
|
Moderator
|
Maybe your matrix is nearly singular? Have you tried the IncompleteLUT preconditioner for the BiCGSTAB? If not I recommend you to try it. I'm pretty sure you'll manage to fall below the 200ms. It has two threshold parameters to adjust it to your needs.
|
Registered Member
|
Thanks ggael for your guidance and quick reply !
Based on your comment, I set two parameters, setMaxIterations(1000) and setTolerance(1e-03). so now I got less than 100 ms performance. however, it was only when I used DiagonalPreconditioner instead of IncompleteLUT. On the contrary, I got more than 60 seconds when I used IncompleteLUT. Regarding this problem, I have three questions.. First, could you guess what was the problem ? Second, what's the difference between DiagonalPreconditioner and IncompleteLUT ? Lastly, is direct solver generally faster than iterative solver ? For other members, I'm attaching my code as follows.
sorry for many questions. thanks in advance and have a good day. Yeonchool |
Registered Member
|
Regarding question 1, I found how to set the two parameters you said as follows. solver.preconditioner().setDroptol(0.1); solver.preconditioner().setFillfactor(5); by the way, how to choose optimal parameters ? hmm... that would be fourth question.. |
Registered Member
|
I'm back..
I found a good information in terms of comparison between direct and iterative solvers. http://www.mathworks.com/matlabcentral/newsreader/view_thread/299821 According to the comments on the site, direct solver is generally faster than iterative solvers. however, direct solver has one big drawback. it is memory limitation. so, I think if there are not many zeros and one doesn't use 64 bit machine, iterative solver is better than directive. ggael, is this correct ? do you agree ?
Last edited by fearhope on Thu Jul 26, 2012 7:02 am, edited 1 time in total.
|
Moderator
|
regarding IncompleteLUT, it is usually better to set a large fill-factor (100), and play with the drop-tolerance. In most cases, for BiCGSTAB the IncompleteLUT outperform the DiagonalPreconditioner. You could also decompose the call to compute(A) into a call to analyzePattern(A) followed by factorize(A) and track the time of each step. For BiCGSTAB, the analyzePattern step consist in computing the preconditioner. It it takes too long, increase the droptol.
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot]