Re: [petsc-users] Code performance for solving multiple RHS

2016-08-24 Thread Barry Smith
> On Aug 24, 2016, at 8:07 PM, Harshad Ranadive > wrote: > > Thanks a lot Barry for your help. I have resolved the issue of slow linear > solver for excessively large RHS vectors to some degree. > > To summarize: > > 1) In my case, I wanted to solve the same linear system a large number of

Re: [petsc-users] Code performance for solving multiple RHS

2016-08-24 Thread Harshad Ranadive
Thanks a lot Barry for your help. I have resolved the issue of slow linear solver for excessively large RHS vectors to some degree. *To summarize:* 1) In my case, I wanted to solve the *same linear system a large number of times for different RHS vectors*. Previously I was using the iterative sol

Re: [petsc-users] Code performance for solving multiple RHS

2016-08-11 Thread Barry Smith
> On Aug 11, 2016, at 10:14 PM, Harshad Ranadive > wrote: > > Hi Barry, > > Thanks for this recommendation. > > As you mention, the matrix factorization should be on a single processor. > If the factored matrix A is available on all processors can I then use > MatMatSolve(A,B,X) in paralle

Re: [petsc-users] Code performance for solving multiple RHS

2016-08-11 Thread Harshad Ranadive
Hi Barry, Thanks for this recommendation. As you mention, the matrix factorization should be on a single processor. If the factored matrix A is available on all processors can I then use MatMatSolve(A,B,X) in parallel? That is could the RHS block matrix 'B' and solution matrix 'X' be distributed

Re: [petsc-users] Code performance for solving multiple RHS

2016-08-11 Thread Barry Smith
If it is sequential, which it probably should be, then you can you MatLUFactorSymbolic(), MatLUFactorNumeric() and MatMatSolve() where you put a bunch of your right hand side vectors into a dense array; not all million of them but maybe 10 to 100 at a time. Barry > On Aug 10, 2016, at

Re: [petsc-users] Code performance for solving multiple RHS

2016-08-10 Thread Barry Smith
Effectively utilizing multiple right hand sides with the same system can result in roughly 2 or at absolute most 3 times improvement in solve time. A great improvement but when you have a million right hand sides not a giant improvement. The first step is to get the best (most efficient

Re: [petsc-users] Code performance for solving multiple RHS

2016-08-10 Thread Matthew Knepley
On Wed, Aug 10, 2016 at 9:54 PM, Harshad Ranadive wrote: > Hi All, > > I have currently added the PETSc library with our CFD solver. > > In this I need to use KSPSolve(...) multiple time for the same matrix A. I > have read that PETSc does not support passing multiple RHS vectors in the > form of

[petsc-users] Code performance for solving multiple RHS

2016-08-10 Thread Harshad Ranadive
Hi All, I have currently added the PETSc library with our CFD solver. In this I need to use KSPSolve(...) multiple time for the same matrix A. I have read that PETSc does not support passing multiple RHS vectors in the form of a matrix and the only solution to this is calling KSPSolve multiple ti