<div dir="ltr">I switched the arguments to <div><br></div><div style>CALL MatXAIJSetPreallocation(Ap,1,0,dnnz,0,onnz,PETSC_NULL_OBJECT,PETSC_NULL_OBJECT,ierr)</div><div style><br></div><div style>but it doesn't seem to like that;</div>
<div style><br></div><div style><div>[0]PETSC ERROR: MatSetValues() line 1075 in /home/jmousel/NumericalLibraries/petsc-hg/src/mat/interface/matrix.c</div><div>[0]PETSC ERROR: --------------------- Error Message ------------------------------------</div>
<div>[0]PETSC ERROR: Object is in wrong state!</div><div>[0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()!</div><div><br></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Mar 29, 2013 at 10:42 AM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="im">On Fri, Mar 29, 2013 at 10:31 AM, John Mousel <span dir="ltr"><<a href="mailto:elafint.john@gmail.com" target="_blank">elafint.john@gmail.com</a>></span> wrote:<br></div><div class="gmail_extra">
<div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>So this </div><div><br></div><div>  Ap      => proj%A</div><div>  CALL MatCreate(solver%comm,Ap,ierr)</div>

<div>  CALL MatSetSizes(Ap,nlp,nlp,ngp,ngp,ierr)</div><div>  CALL MatSetType(Ap,MATMPIAIJ,ierr)</div>
<div>  CALL MatMPIAIJSetPreallocation(Ap,0,dnnz,0,onnz,ierr)</div><div><br></div><div>should go to this</div><div><br></div><div><div>  Ap      => proj%A</div><div>  CALL MatCreate(solver%comm,Ap,ierr)</div>
<div>  CALL MatSetSizes(Ap,nlp,nlp,ngp,ngp,ierr)</div><div>  CALL MatSetType(Ap,MATAIJ,ierr)</div></div></div></blockquote><div><br></div></div><div>Yes</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>  CALL MatXAIJSetPreallocation(Ap,0,dnnz,0,onnz,ierr)</div></div></div></blockquote><div><br></div><div>Almost, see the actual arguments to MatXAIJSetPreallocation.</div><div><div class="h5"><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>?</div><div><br></div>
<div><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Mar 29, 2013 at 10:25 AM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>On Fri, Mar 29, 2013 at 10:22 AM, John Mousel <span dir="ltr"><<a href="mailto:john.mousel@gmail.com" target="_blank">john.mousel@gmail.com</a>></span> wrote:<br>


</div><div class="gmail_extra"><div class="gmail_quote"><div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I get the following error when I try to use GAMG on 1 core. I just pulled dev and it still exists.</div>



</div></blockquote><div><br></div></div><div>Are you explicitly setting your matrix type to MPIAIJ? Can you use MATAIJ instead (it will choose the correct type based on size)?</div><div><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><br></div><div>John</div><div><br></div><div>[0]PETSC ERROR: --------------------- Error Message ------------------------------------</div>
<div>[0]PETSC ERROR: Arguments are incompatible!</div><div>[0]PETSC ERROR: MatMatMult requires A, mpiaij, to be compatible with B, seqaij!</div><div>[0]PETSC ERROR: ------------------------------------------------------------------------</div>




<div>[0]PETSC ERROR: Petsc Development GIT revision: unknown  GIT Date: unknown</div><div>[0]PETSC ERROR: See docs/changes/index.html for recent updates.</div><div>[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.</div>




<div>[0]PETSC ERROR: See docs/index.html for manual pages.</div><div>[0]PETSC ERROR: ------------------------------------------------------------------------</div><div>[0]PETSC ERROR: ../src/MUSSEL_exe on a intel-debug named <a href="http://wv.iihr.uiowa.edu" target="_blank">wv.iihr.uiowa.edu</a> by jmousel Fri Mar 29 10:19:44 2013</div>




<div>[0]PETSC ERROR: Libraries linked from /home/jmousel/NumericalLibraries/petsc-hg/intel-debug/lib</div><div>[0]PETSC ERROR: Configure run at Fri Mar 29 10:00:56 2013</div><div>[0]PETSC ERROR: Configure options --download-blacs=1 --download-metis=1 --download-ml=1 --download-mpich=1 --download-parmetis=/home/jmousel/NumericalLibraries/petsc-hg/parmetis-4.0.2-p3.tar.gz --download-f-blas-lapack=1 --with-cc=icc --download-cmake=1 --with-cxx=icpc --with-fc=ifort</div>




<div>[0]PETSC ERROR: ------------------------------------------------------------------------</div><div>[0]PETSC ERROR: MatMatMult() line 8567 in /home/jmousel/NumericalLibraries/petsc-hg/src/mat/interface/matrix.c</div>



<div>
[0]PETSC ERROR: PCGAMGOptprol_AGG() line 1335 in /home/jmousel/NumericalLibraries/petsc-hg/src/ksp/pc/impls/gamg/agg.c</div><div>[0]PETSC ERROR: PCSetUp_GAMG() line 680 in /home/jmousel/NumericalLibraries/petsc-hg/src/ksp/pc/impls/gamg/gamg.c</div>




<div>[0]PETSC ERROR: PCSetUp() line 890 in /home/jmousel/NumericalLibraries/petsc-hg/src/ksp/pc/interface/precon.c</div><div>[0]PETSC ERROR: KSPSetUp() line 278 in /home/jmousel/NumericalLibraries/petsc-hg/src/ksp/ksp/interface/itfunc.c</div>




<div>[0]PETSC ERROR: KSPSolve() line 399 in /home/jmousel/NumericalLibraries/petsc-hg/src/ksp/ksp/interface/itfunc.c</div><div><br></div></div>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>