<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 25, 2016 at 12:50 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> writes:<br>
<br>
> On Tue, Oct 25, 2016 at 12:19 PM, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com">stefano.zampini@gmail.com</a><br>
>> wrote:<br>
><br>
>> I have a working conversion from HypreParCSR to PETSc MPIAIJ format.<br>
>> I could add this code to PETSc, maybe in the contrib folder. Barry, what<br>
>> do you think?<br>
>><br>
><br>
> No, no one looks there. Add it to src/mat/utils and make an interface<br>
> function like MatCreateFromHypreParCSR().<br>
<br>
Note that mhyp.c contains code to convert AIJ matrices to ParCSR.  If we<br>
were to create a MatHypreParCSR implementation, we could use those<br>
functions for MatConvert_{Seq,MPI}AIJ_<wbr>HypreParCSR and use your function<br>
for the reverse.  That would be consistent with how external matrix<br>
formats are normally represented and may enable some new capability to<br>
mix PETSc and Hypre components in the future.  Here, I'm envisioning<br>
<br>
  PetscErrorCode MatCreateHypreParCSR(hyper_<wbr>ParCSRMatrix *A,Mat *B);<br>
<br>
This way, if a user chooses -pc_type hypre, there would be no copies for<br>
going through PETSc.  Similarly, if we implement<br>
MatSetValues_HypreParCSR, a pure PETSc application could use Hypre<br>
preconditioners with no copies.<br>
</blockquote></div><br>This is a better way, but I did not suggest it because it entails the extra work of implementing</div><div class="gmail_extra">the Mat methods for the new class. If Stefano has time for that, fantastic.</div><div class="gmail_extra"><br></div><div class="gmail_extra">  Matt<br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>