@Stefano Zampini:

I am planning to do two things. One is to directly use Krylov solvers and preconditioners available to PETSc to try out some stuff and make some matrix manipulations like symmetric diagonal scaling or getting a submatrix. If that works I will implement few things (preconditioners or other krylov solvers) using PETSc and try them out. So what you did is like a blessing for me (basically because I was working on the very same thing for days now) and thank you for that.


@Mark and Jed

These are great ideas and I believe a lot of users like me will be grateful if these are available.

On 2016-10-25 01:50 PM, Jed Brown wrote:
Matthew Knepley <[email protected]> writes:

On Tue, Oct 25, 2016 at 12:19 PM, Stefano Zampini <[email protected]
wrote:
I have a working conversion from HypreParCSR to PETSc MPIAIJ format.
I could add this code to PETSc, maybe in the contrib folder. Barry, what
do you think?

No, no one looks there. Add it to src/mat/utils and make an interface
function like MatCreateFromHypreParCSR().
Note that mhyp.c contains code to convert AIJ matrices to ParCSR.  If we
were to create a MatHypreParCSR implementation, we could use those
functions for MatConvert_{Seq,MPI}AIJ_HypreParCSR and use your function
for the reverse.  That would be consistent with how external matrix
formats are normally represented and may enable some new capability to
mix PETSc and Hypre components in the future.  Here, I'm envisioning

   PetscErrorCode MatCreateHypreParCSR(hyper_ParCSRMatrix *A,Mat *B);

This way, if a user chooses -pc_type hypre, there would be no copies for
going through PETSc.  Similarly, if we implement
MatSetValues_HypreParCSR, a pure PETSc application could use Hypre
preconditioners with no copies.

Reply via email to