Mark,<br><br>The changes pulled through this morning. I&#39;ve run it with the options<br><br>-ksp_type bcgsl -pc_type gamg -pc_gamg_sym_graph -ksp_diagonal_scale -ksp_diagonal_scale_fix -pc_mg_levels 4 -mg_levels_ksp_type richardson -mg_levels_pc_type sor -mg_coarse_ksp_type preonly -mg_coarse_pc_type sor -mg_coarse_pc_sor_its 8<br>
<br>and it converges in the true residual, but it&#39;s not converging as fast as anticpated. The matrix arises from a non-symmetric discretization of the Poisson equation. The solve takes GAMG 114 iterations, whereas ML takes 24 iterations, BoomerAMG takes 22 iterations, and -ksp_type bcgsl -pc_type bjacobi -sub_pc_type ilu -sub_pc_factor_levels 4 takes around 170. I&#39;ve attached the -ksp_view results for ML,GAMG, and HYPRE. I&#39;ve attempted to make all the options the same on all levels for ML and GAMG. <br>
<br>Any thoughts?<br><br>John<br><br><br><div class="gmail_quote">On Wed, Mar 14, 2012 at 6:04 PM, Mark F. Adams <span dir="ltr">&lt;<a href="mailto:mark.adams@columbia.edu">mark.adams@columbia.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Humm, I see it with hg view (appended).  </div><div><br></div><div>Satish, my main repo looks hosed.  I see this:</div>
<div><br></div><div><div>~/Codes/petsc-dev&gt;hg update</div><div class="im"><div>abort: crosses branches (merge branches or use --clean to discard changes)</div></div><div>~/Codes/petsc-dev&gt;hg merge</div><div>abort: branch &#39;default&#39; has 3 heads - please merge with an explicit rev</div>
<div>(run &#39;hg heads .&#39; to see heads)</div><div>~/Codes/petsc-dev&gt;hg heads</div><div>changeset:   22496:8e2a98268179</div><div>tag:         tip</div><div>user:        Barry Smith &lt;<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>&gt;</div>
<div>date:        Wed Mar 14 16:42:25 2012 -0500</div><div>files:       src/vec/is/interface/f90-custom/zindexf90.c src/vec/vec/interface/f90-custom/zvectorf90.c</div><div>description:</div><div>undoing manually changes I put in because Satish had a better fix</div>
<div><br></div><div><br></div><div>changeset:   22492:bda4df63072d</div><div>user:        Mark F. Adams &lt;<a href="mailto:mark.adams@columbia.edu" target="_blank">mark.adams@columbia.edu</a>&gt;</div><div>date:        Wed Mar 14 17:39:52 2012 -0400</div>
<div>files:       src/ksp/pc/impls/gamg/tools.c</div><div>description:</div><div>fix for unsymmetric matrices.</div><div><br></div><div><br></div><div>changeset:   22469:b063baf366e4</div><div>user:        Mark F. Adams &lt;<a href="mailto:mark.adams@columbia.edu" target="_blank">mark.adams@columbia.edu</a>&gt;</div>
<div>date:        Wed Mar 14 14:22:28 2012 -0400</div><div>files:       src/ksp/pc/impls/gamg/tools.c</div><div>description:</div><div>added fix for preallocation for unsymetric matrices.</div><div><br></div></div><div>Mark</div>
<div><br></div><div>my &#39;hg view&#39; on my merge repo:</div><div><br></div><div>Revision: 22492</div><div>Branch: default</div><div>Author: Mark F. Adams &lt;<a href="mailto:mark.adams@columbia.edu" target="_blank">mark.adams@columbia.edu</a>&gt;  2012-03-14 17:39:52</div>
<div>Committer: Mark F. Adams &lt;<a href="mailto:mark.adams@columbia.edu" target="_blank">mark.adams@columbia.edu</a>&gt;  2012-03-14 17:39:52</div><div>Tags: tip</div><div>Parent: 22491:451bbbd291c2 (Small fixes to the BT linesearch)</div>
<div><br></div><div>    fix for unsymmetric matrices.</div><div><br></div><div><br></div><div>------------------------ src/ksp/pc/impls/gamg/tools.c ------------------------</div><div>@@ -103,7 +103,7 @@</div><div>   PetscErrorCode ierr;</div>
<div>   PetscInt       Istart,Iend,Ii,jj,ncols,nnz0,nnz1, NN, MM, nloc;</div><div>   PetscMPIInt    mype, npe;</div><div>-  Mat            Gmat = *a_Gmat, tGmat;</div><div>+  Mat            Gmat = *a_Gmat, tGmat, matTrans;</div>
<div>   MPI_Comm       wcomm = ((PetscObject)Gmat)-&gt;comm;</div><div>   const PetscScalar *vals;</div><div>   const PetscInt *idx;</div><div>@@ -127,6 +127,10 @@</div><div>   ierr = MatDiagonalScale( Gmat, diag, diag ); CHKERRQ(ierr);</div>
<div>   ierr = VecDestroy( &amp;diag );           CHKERRQ(ierr);</div><div> </div><div>+  if( symm ) {</div><div>+    ierr = MatTranspose( Gmat, MAT_INITIAL_MATRIX, &amp;matTrans );    CHKERRQ(ierr);</div><div>+  }</div><div>
+</div><div>   /* filter - dup zeros out matrix */</div><div>   ierr = PetscMalloc( nloc*sizeof(PetscInt), &amp;d_nnz ); CHKERRQ(ierr);</div><div>   ierr = PetscMalloc( nloc*sizeof(PetscInt), &amp;o_nnz ); CHKERRQ(ierr);</div>
<div>@@ -135,6 +139,12 @@</div><div>     d_nnz[jj] = ncols;</div><div>     o_nnz[jj] = ncols;</div><div>     ierr = MatRestoreRow(Gmat,Ii,&amp;ncols,PETSC_NULL,PETSC_NULL); CHKERRQ(ierr);</div><div>+    if( symm ) {</div>
<div>+      ierr = MatGetRow(matTrans,Ii,&amp;ncols,PETSC_NULL,PETSC_NULL); CHKERRQ(ierr);</div><div>+      d_nnz[jj] += ncols;</div><div>+      o_nnz[jj] += ncols;</div><div>+      ierr = MatRestoreRow(matTrans,Ii,&amp;ncols,PETSC_NULL,PETSC_NULL); CHKERRQ(ierr);</div>
<div>+    }</div><div>     if( d_nnz[jj] &gt; nloc ) d_nnz[jj] = nloc;</div><div>     if( o_nnz[jj] &gt; (MM-nloc) ) o_nnz[jj] = MM - nloc;</div><div>   }</div><div>@@ -142,6 +152,9 @@</div><div>   CHKERRQ(ierr);</div><div>
   ierr = PetscFree( d_nnz ); CHKERRQ(ierr); </div><div>   ierr = PetscFree( o_nnz ); CHKERRQ(ierr); </div><div>+  if( symm ) {</div><div>+    ierr = MatDestroy( &amp;matTrans );  CHKERRQ(ierr);</div><div>+  }</div><div><div class="h5">
<div> </div><div><br></div><div><br></div><div><br></div><div><div>On Mar 14, 2012, at 5:53 PM, John Mousel wrote:</div><br><blockquote type="cite">Mark,<br><br>No change. Can you give me the location that you patched so I can check to make sure it pulled?<br>
I don&#39;t see it on the petsc-dev change log.<br><br>John<br><br><div class="gmail_quote">On Wed, Mar 14, 2012 at 4:40 PM, Mark F. Adams <span dir="ltr">&lt;<a href="mailto:mark.adams@columbia.edu" target="_blank">mark.adams@columbia.edu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">John, I&#39;ve committed these changes, give a try.<br>
<span><font color="#888888"><br>
Mark<br>
</font></span><div><div><br>
On Mar 14, 2012, at 3:46 PM, Satish Balay wrote:<br>
<br>
&gt; This is the usual merge [with uncommited changes] issue.<br>
&gt;<br>
&gt; You could use &#39;hg shelf&#39; extension to shelve your local changes and<br>
&gt; then do a merge [as Sean would suggest] - or do the merge in a<br>
&gt; separate/clean clone [I normally do this..]<br>
&gt;<br>
&gt; i.e<br>
&gt; cd ~/Codes<br>
&gt; hg clone petsc-dev petsc-dev-merge<br>
&gt; cd petsc-dev-merge<br>
&gt; hg pull ssh://<a href="mailto:petsc@petsc.cs.iit.edu" target="_blank">petsc@petsc.cs.iit.edu</a>//hg/petsc/petsc-dev   #just to be sure, look for latest chagnes before merge..<br>
&gt; hg merge<br>
&gt; hg commit<br>
&gt; hg push ssh://<a href="mailto:petsc@petsc.cs.iit.edu" target="_blank">petsc@petsc.cs.iit.edu</a>//hg/petsc/petsc-dev<br>
&gt;<br>
&gt; [now update your petsc-dev to latest]<br>
&gt; cd ~/Codes/petsc-dev<br>
&gt; hg pull<br>
&gt; hg update<br>
&gt;<br>
&gt; Satish<br>
&gt;<br>
&gt; On Wed, 14 Mar 2012, Mark F. Adams wrote:<br>
&gt;<br>
&gt;&gt; Great, that seems to work.<br>
&gt;&gt;<br>
&gt;&gt; I did a &#39;hg commit tools.c&#39;<br>
&gt;&gt;<br>
&gt;&gt; and I want to push this file only.  I guess its the only thing in the change set so &#39;hg push&#39; should be fine.  But I see this:<br>
&gt;&gt;<br>
&gt;&gt; ~/Codes/petsc-dev/src/ksp/pc/impls/gamg&gt;hg update<br>
&gt;&gt; abort: crosses branches (merge branches or use --clean to discard changes)<br>
&gt;&gt; ~/Codes/petsc-dev/src/ksp/pc/impls/gamg&gt;hg merge<br>
&gt;&gt; abort: outstanding uncommitted changes (use &#39;hg status&#39; to list changes)<br>
&gt;&gt; ~/Codes/petsc-dev/src/ksp/pc/impls/gamg&gt;hg status<br>
&gt;&gt; M include/petscmat.h<br>
&gt;&gt; M include/private/matimpl.h<br>
&gt;&gt; M src/ksp/pc/impls/gamg/agg.c<br>
&gt;&gt; M src/ksp/pc/impls/gamg/gamg.c<br>
&gt;&gt; M src/ksp/pc/impls/gamg/gamg.h<br>
&gt;&gt; M src/ksp/pc/impls/gamg/geo.c<br>
&gt;&gt; M src/mat/coarsen/coarsen.c<br>
&gt;&gt; M src/mat/coarsen/impls/hem/hem.c<br>
&gt;&gt; M src/mat/coarsen/impls/mis/mis.c<br>
&gt;&gt;<br>
&gt;&gt; Am I ready to do a push?<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Mark<br>
&gt;&gt;<br>
&gt;&gt; On Mar 14, 2012, at 2:44 PM, Satish Balay wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; If commit is the last hg operation that you&#39;ve done - then &#39;hg rollback&#39; would undo this commit.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Satish<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Wed, 14 Mar 2012, Mark F. Adams wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Damn, I&#39;m not preallocating the graph perfectly for unsymmetric matrices and PETSc now dies on this.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I have a fix but I committed it with other changes that I do not want to commit.  The changes are all in one file so I should be able to just commit this file.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Anyone know how to delete a commit?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I&#39;ve tried:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; ~/Codes/petsc-dev/src/ksp/pc/impls/gamg&gt;hg strip 22487:26ffb9eef17f<br>
&gt;&gt;&gt;&gt; hg: unknown command &#39;strip&#39;<br>
&gt;&gt;&gt;&gt; &#39;strip&#39; is provided by the following extension:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;   mq  manage a stack of patches<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; use &quot;hg help extensions&quot; for information on enabling extensions<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; But have not figured out how to load extensions.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Mark<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Mar 14, 2012, at 12:54 PM, John Mousel wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Mark,<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; I have a non-symmetric matrix. I am running with the following options.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; -pc_type gamg -pc_gamg_sym_graph -ksp_monitor_true_residual<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; and with the inclusion of -pc_gamg_sym_graph, I get a new malloc error:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; 0]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: Argument out of range!<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: New nonzero at (5150,9319) caused a malloc!<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: ------------------------------------------------------------------------<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: Petsc Development HG revision: 587b25035091aaa309c87c90ac64c13408ecf34e  HG Date: Wed Mar 14 09:22:54 2012 -0500<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: See docs/index.html for manual pages.<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: ------------------------------------------------------------------------<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: ../JohnRepo/VFOLD_exe on a linux-deb named <a href="http://wv.iihr.uiowa.edu/" target="_blank">wv.iihr.uiowa.edu</a> by jmousel Wed Mar 14 11:51:35 2012<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: Libraries linked from /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/linux-debug/lib<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: Configure run at Wed Mar 14 09:46:39 2012<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: Configure options --download-blacs=1 --download-hypre=1 --download-metis=1 --download-ml=1 --download-mpich=1 --download-parmetis=1 --download-scalapack=1 --with-blas-lapack-dir=/opt/intel11/mkl/lib/em64t --with-cc=gcc --with-cmake=/usr/local/bin/cmake --with-cxx=g++ --with-fc=ifort PETSC_ARCH=linux-debug<br>


&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: ------------------------------------------------------------------------<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: MatSetValues_MPIAIJ() line 506 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/mat/impls/aij/mpi/mpiaij.c<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: MatSetValues() line 1141 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/mat/interface/matrix.c<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: scaleFilterGraph() line 155 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/ksp/pc/impls/gamg/tools.c<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: PCGAMGgraph_AGG() line 865 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/ksp/pc/impls/gamg/agg.c<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: PCSetUp_GAMG() line 516 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/ksp/pc/impls/gamg/gamg.c<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: PCSetUp() line 832 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/ksp/pc/interface/precon.c<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: KSPSetUp() line 261 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/ksp/ksp/interface/itfunc.c<br>
&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: KSPSolve() line 385 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/ksp/ksp/interface/itfunc.c<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; John<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On Wed, Mar 14, 2012 at 11:27 AM, Mark F. Adams &lt;<a href="mailto:mark.adams@columbia.edu" target="_blank">mark.adams@columbia.edu</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On Mar 14, 2012, at 11:56 AM, John Mousel wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Mark,<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; The matrix is asymmetric. Does this require the setting of an option?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Yes:  -pc_gamg_sym_graph<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Mark<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; I pulled petsc-dev this morning, so I should have (at least close to) the latest code.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; John<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; On Wed, Mar 14, 2012 at 10:54 AM, Mark F. Adams &lt;<a href="mailto:mark.adams@columbia.edu" target="_blank">mark.adams@columbia.edu</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; On Mar 14, 2012, at 11:08 AM, John Mousel wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; I&#39;m getting the following error when using GAMG.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; petsc-dev/src/ksp/pc/impls/gamg/agg.c:508: smoothAggs: Assertion `sgid==-1&#39; failed.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Is it possible that your matrix is structurally asymmetric?<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; This code is evolving fast and so you will need to move to the dev version if you are not already using it. (I think I fixed a bug that hit this assert).<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; When I try to alter the type of aggregation at the command line using -pc_gamg_type pa, I&#39;m getting<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; [0]PETSC ERROR: [1]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; [1]PETSC ERROR: Unknown type. Check for miss-spelling or missing external package needed for type:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; see <a href="http://www.mcs.anl.gov/petsc/documentation/installation.html#external" target="_blank">http://www.mcs.anl.gov/petsc/documentation/installation.html#external</a>!<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; [1]PETSC ERROR: Unknown GAMG type pa given!<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Has there been a change in the aggregation options? I just pulled petsc-dev this morning.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Yes, this option is gone now.  You can use -pc_gamg_type agg for now.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Mark<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; John<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>
</blockquote></div><br></div></div></div></blockquote></div><br>