Interfacing SCALAPACK to C++ applications

Post here if you have a question about LAPACK or ScaLAPACK algorithm or data format

Interfacing SCALAPACK to C++ applications

Postby chemapps » Mon Dec 05, 2011 4:46 pm

Hi,

I wonder if anyone has the experience in to use SCALAPACK in C++ programs,
(or better, if you can provide a simple example, it will be greatly appreciated)

Thanks in advance,

Alvaro
chemapps
 
Posts: 2
Joined: Mon Dec 05, 2011 4:02 pm

Re: Interfacing SCALAPACK to C++ applications

Postby admin » Mon Dec 05, 2011 6:52 pm

Hi,
here is a timer for pdgesv (Solve Ax=B for General Matrix).
This is in C, and it calls directly the Fortran routine form the C code. You can do the same in C++ , You just have to put extern C for the routine headers.
Hope it helps.
Julie
Attachments
timer_pdgesv.c
ScaLAPACK C example: timer for psgesv
(58.09 KiB) Downloaded 329 times
admin
Site Admin
 
Posts: 501
Joined: Wed Dec 08, 2004 7:07 pm

Re: Interfacing SCALAPACK to C++ applications

Postby chemapps » Tue Dec 06, 2011 2:21 pm

Hi Julie,

Thanks for your prompt response!

I will try your suggestion,

Best wishes,
Alvaro
chemapps
 
Posts: 2
Joined: Mon Dec 05, 2011 4:02 pm

Re: Interfacing SCALAPACK to C++ applications

Postby jackpoulson » Thu Dec 08, 2011 6:13 pm

I don't normally find it kosher to advertise on forums, but it seems appropriate in this case. If you are interested in ScaLAPACK functionality in C++, you may want to consider Elemental, which can be found here: http://code.google.com/p/elemental.

I bring it up because I found the example Julie posted to be surprisingly verbose relative to the Elemental equivalent, which can be found here: http://code.google.com/p/elemental/sour ... nation.cpp

I should probably mentioned that I noticed a few bugs in the timer_pdgesv.c example code: it seems they are incorrectly computing the norms of the factored A rather than the original A, i.e., on lines 215, 244, 275, 350, 379, 410, 485, 514, 545, 620, 649, 680, 755, 784, 815, 890, 919, 950, 1025, 1054, 1085, 1160, 1189, 1220, 1295, 1324, 1355, 1430, 1459, 1490, 1565, 1594, and 1625.

Julie, perhaps I'm misunderstanding something, but it seems that the same code was copied and pasted several times in the main body in order to test the accuracy on several random matrices. Why not just do a for loop instead?

By the way, to be completely fair, I should mention that while Elemental has a large percentage of the functionality of ScaLAPACK, and some extra neat functions like Hermitian matrix functions, Hermitian pseudoinverses, and a skew-Hermitian eigensolver, it is currently lacking SVD, non-Hermitian eigensolves, and support for banded matrices.

Jack
jackpoulson
 
Posts: 2
Joined: Tue Feb 15, 2011 11:19 am

Re: Interfacing SCALAPACK to C++ applications

Postby admin » Thu Sep 27, 2012 11:06 am

Posting the file again, the file seems to have disappeared.
Attachments
timer_pdgesv.c.txt
(58.09 KiB) Downloaded 155 times
admin
Site Admin
 
Posts: 501
Joined: Wed Dec 08, 2004 7:07 pm


Return to Algorithm / Data

Who is online

Users browsing this forum: No registered users and 1 guest