Page 1 of 1

Interfacing SCALAPACK to C++ applications

PostPosted: Mon Dec 05, 2011 4:46 pm
by chemapps
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

Re: Interfacing SCALAPACK to C++ applications

PostPosted: Mon Dec 05, 2011 6:52 pm
by admin
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

Re: Interfacing SCALAPACK to C++ applications

PostPosted: Tue Dec 06, 2011 2:21 pm
by chemapps
Hi Julie,

Thanks for your prompt response!

I will try your suggestion,

Best wishes,
Alvaro

Re: Interfacing SCALAPACK to C++ applications

PostPosted: Thu Dec 08, 2011 6:13 pm
by jackpoulson
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

Re: Interfacing SCALAPACK to C++ applications

PostPosted: Thu Sep 27, 2012 11:06 am
by admin
Posting the file again, the file seems to have disappeared.