[petsc-users] Question about KSPSolve for multiple rhs
Barry Smith
bsmith at mcs.anl.gov
Wed Oct 26 10:39:13 CDT 2011
On Oct 26, 2011, at 10:34 AM, Bogdan Dita wrote:
>
> Hello,
>
> First of all I'm new to PETSc so please be pacient with me.
> I'm trying to solve 2 linear systems with the same A matrix using
> superlu_dist, and so i'm using the same ksp context for both systems.
> The matrix is a square matrix of 84719 with 351289 nonzero elements.
> The time for the first call to KSPSolve is 66 sec and the second 0.14
> sec. I was expecting some difference but not that big. Is this
> difference normal for a linear system with two right hand sides? I
> really think that I'm doing something wrong, but I even checked the
> solution in Matlab and it seems fine to me.
This is completely normal. The sparse factorization is generally much much more time consuming than the triangular solves since it involves much more operations and memory motion. Hence when using direct solvers reusing a previous factorization is really beneficial.
Barry
>
> Thanks,
> Bogdan
>
> --------------------------------------
>
> Cosmin-Bogdan DITA, PhD Student
>
> "Politehnica" University of Bucharest
> Electrical Engineering Faculty
> Numerical Modelling Laboratory (EA-D07)
> Splaiul Independentei 313
> Bucharest, zip 060042
> Romania
>
> E-mail: bogdan at lmn.pub.ro
> bogdandita at gmail.com
>
>
More information about the petsc-users
mailing list