<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 4, 2018 at 3:01 AM Richard Tran Mills <<a href="mailto:rtmills@anl.gov">rtmills@anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Mark,</div><div><br></div><div>I'd never looked at the code for MatCreateMPIAIJWithSeqAIJ(), but it looks like if you are using MPIAIJ matrices but you've set "-mat_seqaij_type seqaijmkl", </div></div></blockquote><div><br></div><div>No, I am using -mat_type aijmkl</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>then the "diagonal" portion of the MPIAIJ matrix ends up as a SEQAIJMKL instance, but the off-diagonal portion ends up as a plain SEQAIJ when it is created with MatCreateSeqAIJWithArrays(). (I have not stepped through this with a debugger to verify that this is actually what happens.) So, if we want the off-diagonal matrix to also be a SEQAIJMKL, then we either need to add some logic after the MatCreateSeqAIJWithArrays() call to check to see if a different subtype of SEQAIJ is being used and then convert it to the correct type, or we need a variant of MatCreateSeqAIJWithArrays() that will honor the subtype of SEQAIJ that we are using. Barry, since you added the concept of subtyping for SEQAIJ, what do you prefer?<br></div><div><br></div></div></blockquote><div>No preference.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div><div>I note that in some (most?) cases, I think we are OK or even better off with the off-diagonal matrix in the MPIAIJ not being a SEQAIJMKL one, because the PETSc routines can used the "compressed row" stuff to speed up handling the many zero rows that often end up in the off-diagonal, whereas the MKL routines cannot.</div><div><br></div></div></blockquote><div><br></div><div>OK , I'll keep that in mind. I pushed a branch with fixes to get my gamg tests working (ksp ex56 primarily). I'm going to make a new branch and try <span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">"-mat_seqaij_type seqaijmkl".</span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Thanks,</span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Mark</span></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div><div>--Richard<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 3, 2018 at 4:31 PM, Mark Adams <span dir="ltr"><<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div>
<div dir="ltr">I have having to fix AIJ methods that don't get the type from the args to set created matrix type, so as to keep the MKL typing.
<div><br>
</div>
<div>I am not sure how to fix this because I don't know to say 'make MPI from SEQ' in this method</div>
<div><br>
</div>
<div>
<div>PetscErrorCode MatCreateMPIAIJWithSeqAIJ(MPI_Comm comm,Mat A,Mat B,const PetscInt garray[],Mat *mat)</div>
<div>{</div>
<div> ....  </div>
<div>  ierr = MatCreate(comm,mat);CHKERRQ(ierr);</div>
<div>  ierr = MatGetSize(A,&m,&n);CHKERRQ(ierr);</div>
<div>.... </div>
<div>  ierr = MatSetSizes(*mat,m,n,PETSC_DECIDE,N);CHKERRQ(ierr);</div>
<div>  ierr = MatSetType(*mat,MATMPIAIJ);CHKERRQ(ierr);</div>
</div>
<div><br>
</div>
<div>How should I do this?  Other places in the code I get the type from input (MPI) args and set created matrix types accordingly. I could just put a switch with an error for any new types that might come along in the future ...</div><span class="m_-7845906587026107739HOEnZb"><font color="#888888">
<div><br>
</div>
<div>Mark</div>
</font></span></div>
</div>

</blockquote></div><br></div>
</blockquote></div></div>