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

Sparse non Hermitian Matrix--> what solver should I use?

Tags: None
(comma "," separated)
Akkawe
Registered Member
Posts
35
Karma
0
OS
As subject,
I have a nxn non hermitian complex<double> sparse Matrix, what kind of solver should I use?
Thank you
medic123
Registered Member
Posts
25
Karma
0
OS
Hi!

I would recommend the superLU-solver. It should deal with your Matrix, it is easy to install and link on Windows compared to UMF-Pack and the Eigen-wrapper works quite nicely. Just go to http://crd-legacy.lbl.gov/~xiaoye/SuperLU/, read the FAQ about installing on Windows, get a working Blas like it is also said in the FAQ and link your project with Eigen and SuperLU (there is also a not compiled Blas-version included in the Eigen-folder) and you are good to go. I use the newest version of superLU, a developmentversion of Eigen and the Eigen-implementation of Blas and everything works fine.

Greeting medic
Akkawe
Registered Member
Posts
35
Karma
0
OS
medic123 wrote:Hi!

I would recommend the superLU-solver. It should deal with your Matrix, it is easy to install and link on Windows compared to UMF-Pack and the Eigen-wrapper works quite nicely. Just go to http://crd-legacy.lbl.gov/~xiaoye/SuperLU/, read the FAQ about installing on Windows, get a working Blas like it is also said in the FAQ and link your project with Eigen and SuperLU (there is also a not compiled Blas-version included in the Eigen-folder) and you are good to go. I use the newest version of superLU, a developmentversion of Eigen and the Eigen-implementation of Blas and everything works fine.

Greeting medic

Thank you medic,
I am not sure if I've done everything right.
Now I have these errors during compiling:
"unresolved external symbol _set_default_options"
and other three unresolved external symbol ...

I used in my code:
#define EIGEN_SUPERLU_SUPPORT
#include <Eigen\SuperLUSupport>

any ideas?
manuels
Registered Member
Posts
47
Karma
0
you probably forgot to link in the superlu library
Akkawe
Registered Member
Posts
35
Karma
0
OS
manuels wrote:you probably forgot to link in the superlu library

now i guess i can add a library in visual c++ 2008
It seems to compile correctly up to I use:
Code: Select all
SuperLU <SparseMatrix<complex<double> > > solver;
solver.compute(Kred);

as matter of fact:
WARNING!
unsolved external symbol _zaxpy_ ... _zcopy_ ....

so, I'm wondering if I have to compile also the Blas folder (of eigen) as a static library .lib and link it to the compiler...is it ?

thank you very much
Andre
Registered Member
Posts
90
Karma
1
Yes. You can also use any other BLAS implementation, such as the prebuilt binaries on the Lapack for Windows page: http://icl.cs.utk.edu/lapack-for-windows/


'And all those exclamation marks, you notice? Five? A sure sign of someone who wears his underpants on his head.' ~Terry Pratchett

'It's funny. All you have to do is say something nobody understands and they'll do practically anything you want them to.' ~J.D. Salinger
Akkawe
Registered Member
Posts
35
Karma
0
OS
Andre wrote:Yes. You can also use any other BLAS implementation, such as the prebuilt binaries on the Lapack for Windows page: http://icl.cs.utk.edu/lapack-for-windows/


So, Do I need a Fortran compiler if I want compile those included in eigen's folder or in your link?

EDIT:
I downloaded a reference blas compiled : http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.2.1/win32/BLAS.lib in this page: http://icl.cs.utk.edu/lapack-for-windows/scalapack/.
I liked it following these instructions:
"Add the the BLAS and LAPACK libraries to the Visual Studio project settings,
under Linker -> General -> Additional Library Directories: the directory where your ....lib is.
under Linker -> Input -> Additional Dependencies: ..."

anyway, when I try to compile:
Code: Select all
SuperLU <SparseMatrix<complex<double> > > solver;
solver.compute(K);

I obtained:
WARNING!
1>superlu.lib(zgsrfs.obj) : error LNK2001: Unresolved external symbol" _zaxpy_
1>superlu.lib(zgsrfs.obj) : error LNK2001: Unresolved external symbol _zcopy_
1>superlu.lib(zlacon.obj) : error LNK2001: Unresolved external symbol _zcopy_
1>superlu.lib(zsp_blas2.obj) : error LNK2001: Unresolved external symbol _ztrsv_

Last edited by Akkawe on Wed May 09, 2012 11:13 am, edited 1 time in total.
Andre
Registered Member
Posts
90
Karma
1
No, you don't need a fortran compiler for my link. It offers ready-to-use libraries: http://icl.cs.utk.edu/lapack-for-window ... #libraries
Note that this is reference BLAS only, which means it won't give you top-notch performance. You could e.g. also use ACML, which contains BLAS as well. For Windows, you'd use the PGI package available here: http://developer.amd.com/libraries/acml ... fault.aspx


'And all those exclamation marks, you notice? Five? A sure sign of someone who wears his underpants on his head.' ~Terry Pratchett

'It's funny. All you have to do is say something nobody understands and they'll do practically anything you want them to.' ~J.D. Salinger
Akkawe
Registered Member
Posts
35
Karma
0
OS
Thanks,
I have just edited my last post before seeing your reply.
you can see it because my problem is not solved
thanks again
medic123
Registered Member
Posts
25
Karma
0
OS
Yes it looks like the linker is missing the Blas-library.

The easy way to fix this should be:
Yes. You can also use any other BLAS implementation, such as the prebuilt binaries on the Lapack for Windows page: http://icl.cs.utk.edu/lapack-for-windows/
You shoud use the prebuild blas libraries first to get your project running. On the site are also examples in MVS wich show you the used libraries and the linkage in Visual Studio.

For more performance: You can build the Eigen implementation of Blas e.g. with CMake wich creates a Eigen-build-directory with makefiles in it and then use MinGW wich has all compiler you need. With MinGW console you go to the created Eigen-build-directory and use "mingw32-make blas" -some options you want.

Maybe you are also interested in the topic I just started:
viewtopic.php?f=74&t=102031

greets
Akkawe
Registered Member
Posts
35
Karma
0
OS
medic123 wrote:Yes it looks like the linker is missing the Blas-library.

The easy way to fix this should be:
Yes. You can also use any other BLAS implementation, such as the prebuilt binaries on the Lapack for Windows page: http://icl.cs.utk.edu/lapack-for-windows/
You shoud use the prebuild blas libraries first to get your project running. On the site are also examples in MVS wich show you the used libraries and the linkage in Visual Studio.

For more performance: You can build the Eigen implementation of Blas e.g. with CMake wich creates a Eigen-build-directory with makefiles in it and then use MinGW wich has all compiler you need. With MinGW console you go to the created Eigen-build-directory and use "mingw32-make blas" -some options you want.

Maybe you are also interested in the topic I just started:
viewtopic.php?f=74&t=102031

greets


It was extremely hard for me.
I compiled the blas library found in clapack and they work well.
Then I had to compile superlu but:
1) I have to compile superlu linking blas and instead i was linking blas.lib and superlu.libin my project as two separated library
2) I have to insert the preprocessor definition (before compiling superlu) : USE_VENDOR_BLAS

then I obtained superlu.lib and now it seems work. I have to verify the result.
See you soon
: )
P.S.
Yes, i am interested, i'll follow your discussion
medic123
Registered Member
Posts
25
Karma
0
OS
Hmm does SuperLU work now without linking your project against a blas library?
I'm asking because as far as I understand your last post, you compiled SuperLU like it is intended for Linux with the makefiles?!

I did like it is said in the SuperLU FAQ. Just build a .lib file with the .c and the .h files in the SuperLU/src, which should be possible without having any BLAS and then somehow getting a BLAS library and also link it with my project in order to have the calls to the BLAS-functions pointed to a valid function.
This worked very well and I schould now be able to pimp my performance by linking to a faster BLAS-library without having to recompile the whole SuperLU.

But I'm pretty new to this stuff, so not sure if I did it right. Maybe some "Pro" can join in and point us in the right direction?!

greetings, medic
Akkawe
Registered Member
Posts
35
Karma
0
OS
medic123 wrote:Hmm does SuperLU work now without linking your project against a blas library?
I'm asking because as far as I understand your last post, you compiled SuperLU like it is intended for Linux with the makefiles?!


Yes, i did it
But i prefer your way since I could change another Blas library in the future but I can't understand why this way didn't work.
Maybe it was a problem of the prebuilt blas. Now I am using a self-compiled cblas found in the site you linked to me.

But as you, I am looking forward a reply from expert user.

Thanks
greetings


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]