> El 1 mar 2022, a las 18:06, Lucas Banting <[email protected]> escribió:
>
> Thanks everyone, QR makes the most sense for my application.
>
> Jose,
> Once I get R from BVOrthogonalize, how I should I solve the upper triangular
> system?
> Is the returned Mat R setup to be used in MatBackwardSolve?
MatBackwardSolve() would be the operation to use, but unfortunately it seems to
be implemented only for SBAIJ matrices, not for dense matrices.
You will have to get the array with MatDenseGetArray()/MatDenseRestoreArray()
and then call BLAStrsm_
The KSP/PC interface is more convenient.
Jose
>
> Pierre,
> I can reuse A for many iterations, but I cannot do a matmatsolve as I need
> the resulting solution to produce the next right hand side vector.
>
> Thanks again,
> Lucas
> From: Jose E. Roman <[email protected]>
> Sent: Tuesday, March 1, 2022 4:49 AM
> To: Pierre Jolivet <[email protected]>
> Cc: Lucas Banting <[email protected]>; [email protected]
> <[email protected]>
> Subject: Re: [petsc-users] Preconditioner for LSQR
>
> Caution: This message was sent from outside the University of Manitoba.
>
>
> To use SLEPc's TSQR one would do something like this:
>
> ierr = BVCreateFromMat(A,&X);CHKERRQ(ierr);
> ierr = BVSetFromOptions(X);CHKERRQ(ierr);
> ierr =
> BVSetOrthogonalization(X,BV_ORTHOG_CGS,BV_ORTHOG_REFINE_IFNEEDED,PETSC_DEFAULT,BV_ORTHOG_BLOCK_TSQR);CHKERRQ(ierr);
> ierr = BVOrthogonalize(X,R);CHKERRQ(ierr);
>
> But then one would have to use BVDotVec() to obtain Q'*b and finally solve a
> triangular system with R.
> Jose
>
> > El 1 mar 2022, a las 8:36, Pierre Jolivet <[email protected]> escribió:
> >
> > Hello Lucas,
> > In your sequence of systems, is A changing?
> > Are all right-hand sides available from the get-go?
> > In that case, you can solve everything in a block fashion and that’s how
> > you could get real improvements.
> > Also, instead of PCCHOLESKY on A^T * A + KSPCG, you could use PCQR on A +
> > KSPPREONLY, but this may not be needed, cf. Jed’s answer.
> >
> > Thanks,
> > Pierre
> >
> >> On 1 Mar 2022, at 12:54 AM, Lucas Banting <[email protected]> wrote:
> >>
> >> Hello,
> >>
> >> I have an MPIDENSE matrix of size about 200,000 x 200, using KSPLSQR on my
> >> machine a solution takes about 15 s. I typically run with six to eight
> >> processors.
> >> I have to solve the system several times, typically 4-30, and was looking
> >> for recommendations on reusable preconditioners to use with KSPLSQR to
> >> increase speed.
> >>
> >> Would it make the most sense to use PCCHOLESKY on the smaller system A^T *
> >> A?
> >>
> >> Thanks,
> >> Lucas
> >