[petsc-users] GAMG issue

Mark F. Adams mark.adams at columbia.edu
Wed Mar 14 18:04:08 CDT 2012


Humm, I see it with hg view (appended).  

Satish, my main repo looks hosed.  I see this:

~/Codes/petsc-dev>hg update
abort: crosses branches (merge branches or use --clean to discard changes)
~/Codes/petsc-dev>hg merge
abort: branch 'default' has 3 heads - please merge with an explicit rev
(run 'hg heads .' to see heads)
~/Codes/petsc-dev>hg heads
changeset:   22496:8e2a98268179
tag:         tip
user:        Barry Smith <bsmith at mcs.anl.gov>
date:        Wed Mar 14 16:42:25 2012 -0500
files:       src/vec/is/interface/f90-custom/zindexf90.c src/vec/vec/interface/f90-custom/zvectorf90.c
description:
undoing manually changes I put in because Satish had a better fix


changeset:   22492:bda4df63072d
user:        Mark F. Adams <mark.adams at columbia.edu>
date:        Wed Mar 14 17:39:52 2012 -0400
files:       src/ksp/pc/impls/gamg/tools.c
description:
fix for unsymmetric matrices.


changeset:   22469:b063baf366e4
user:        Mark F. Adams <mark.adams at columbia.edu>
date:        Wed Mar 14 14:22:28 2012 -0400
files:       src/ksp/pc/impls/gamg/tools.c
description:
added fix for preallocation for unsymetric matrices.

Mark

my 'hg view' on my merge repo:

Revision: 22492
Branch: default
Author: Mark F. Adams <mark.adams at columbia.edu>  2012-03-14 17:39:52
Committer: Mark F. Adams <mark.adams at columbia.edu>  2012-03-14 17:39:52
Tags: tip
Parent: 22491:451bbbd291c2 (Small fixes to the BT linesearch)

    fix for unsymmetric matrices.


------------------------ src/ksp/pc/impls/gamg/tools.c ------------------------
@@ -103,7 +103,7 @@
   PetscErrorCode ierr;
   PetscInt       Istart,Iend,Ii,jj,ncols,nnz0,nnz1, NN, MM, nloc;
   PetscMPIInt    mype, npe;
-  Mat            Gmat = *a_Gmat, tGmat;
+  Mat            Gmat = *a_Gmat, tGmat, matTrans;
   MPI_Comm       wcomm = ((PetscObject)Gmat)->comm;
   const PetscScalar *vals;
   const PetscInt *idx;
@@ -127,6 +127,10 @@
   ierr = MatDiagonalScale( Gmat, diag, diag ); CHKERRQ(ierr);
   ierr = VecDestroy( &diag );           CHKERRQ(ierr);
 
+  if( symm ) {
+    ierr = MatTranspose( Gmat, MAT_INITIAL_MATRIX, &matTrans );    CHKERRQ(ierr);
+  }
+
   /* filter - dup zeros out matrix */
   ierr = PetscMalloc( nloc*sizeof(PetscInt), &d_nnz ); CHKERRQ(ierr);
   ierr = PetscMalloc( nloc*sizeof(PetscInt), &o_nnz ); CHKERRQ(ierr);
@@ -135,6 +139,12 @@
     d_nnz[jj] = ncols;
     o_nnz[jj] = ncols;
     ierr = MatRestoreRow(Gmat,Ii,&ncols,PETSC_NULL,PETSC_NULL); CHKERRQ(ierr);
+    if( symm ) {
+      ierr = MatGetRow(matTrans,Ii,&ncols,PETSC_NULL,PETSC_NULL); CHKERRQ(ierr);
+      d_nnz[jj] += ncols;
+      o_nnz[jj] += ncols;
+      ierr = MatRestoreRow(matTrans,Ii,&ncols,PETSC_NULL,PETSC_NULL); CHKERRQ(ierr);
+    }
     if( d_nnz[jj] > nloc ) d_nnz[jj] = nloc;
     if( o_nnz[jj] > (MM-nloc) ) o_nnz[jj] = MM - nloc;
   }
@@ -142,6 +152,9 @@
   CHKERRQ(ierr);
   ierr = PetscFree( d_nnz ); CHKERRQ(ierr); 
   ierr = PetscFree( o_nnz ); CHKERRQ(ierr); 
+  if( symm ) {
+    ierr = MatDestroy( &matTrans );  CHKERRQ(ierr);
+  }
 



On Mar 14, 2012, at 5:53 PM, John Mousel wrote:

> Mark,
> 
> No change. Can you give me the location that you patched so I can check to make sure it pulled?
> I don't see it on the petsc-dev change log.
> 
> John
> 
> On Wed, Mar 14, 2012 at 4:40 PM, Mark F. Adams <mark.adams at columbia.edu> wrote:
> John, I've committed these changes, give a try.
> 
> Mark
> 
> On Mar 14, 2012, at 3:46 PM, Satish Balay wrote:
> 
> > This is the usual merge [with uncommited changes] issue.
> >
> > You could use 'hg shelf' extension to shelve your local changes and
> > then do a merge [as Sean would suggest] - or do the merge in a
> > separate/clean clone [I normally do this..]
> >
> > i.e
> > cd ~/Codes
> > hg clone petsc-dev petsc-dev-merge
> > cd petsc-dev-merge
> > hg pull ssh://petsc@petsc.cs.iit.edu//hg/petsc/petsc-dev   #just to be sure, look for latest chagnes before merge..
> > hg merge
> > hg commit
> > hg push ssh://petsc@petsc.cs.iit.edu//hg/petsc/petsc-dev
> >
> > [now update your petsc-dev to latest]
> > cd ~/Codes/petsc-dev
> > hg pull
> > hg update
> >
> > Satish
> >
> > On Wed, 14 Mar 2012, Mark F. Adams wrote:
> >
> >> Great, that seems to work.
> >>
> >> I did a 'hg commit tools.c'
> >>
> >> and I want to push this file only.  I guess its the only thing in the change set so 'hg push' should be fine.  But I see this:
> >>
> >> ~/Codes/petsc-dev/src/ksp/pc/impls/gamg>hg update
> >> abort: crosses branches (merge branches or use --clean to discard changes)
> >> ~/Codes/petsc-dev/src/ksp/pc/impls/gamg>hg merge
> >> abort: outstanding uncommitted changes (use 'hg status' to list changes)
> >> ~/Codes/petsc-dev/src/ksp/pc/impls/gamg>hg status
> >> M include/petscmat.h
> >> M include/private/matimpl.h
> >> M src/ksp/pc/impls/gamg/agg.c
> >> M src/ksp/pc/impls/gamg/gamg.c
> >> M src/ksp/pc/impls/gamg/gamg.h
> >> M src/ksp/pc/impls/gamg/geo.c
> >> M src/mat/coarsen/coarsen.c
> >> M src/mat/coarsen/impls/hem/hem.c
> >> M src/mat/coarsen/impls/mis/mis.c
> >>
> >> Am I ready to do a push?
> >>
> >> Thanks,
> >> Mark
> >>
> >> On Mar 14, 2012, at 2:44 PM, Satish Balay wrote:
> >>
> >>> If commit is the last hg operation that you've done - then 'hg rollback' would undo this commit.
> >>>
> >>> Satish
> >>>
> >>> On Wed, 14 Mar 2012, Mark F. Adams wrote:
> >>>
> >>>> Damn, I'm not preallocating the graph perfectly for unsymmetric matrices and PETSc now dies on this.
> >>>>
> >>>> 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.
> >>>>
> >>>> Anyone know how to delete a commit?
> >>>>
> >>>> I've tried:
> >>>>
> >>>> ~/Codes/petsc-dev/src/ksp/pc/impls/gamg>hg strip 22487:26ffb9eef17f
> >>>> hg: unknown command 'strip'
> >>>> 'strip' is provided by the following extension:
> >>>>
> >>>>   mq  manage a stack of patches
> >>>>
> >>>> use "hg help extensions" for information on enabling extensions
> >>>>
> >>>> But have not figured out how to load extensions.
> >>>>
> >>>> Mark
> >>>>
> >>>> On Mar 14, 2012, at 12:54 PM, John Mousel wrote:
> >>>>
> >>>>> Mark,
> >>>>>
> >>>>> I have a non-symmetric matrix. I am running with the following options.
> >>>>>
> >>>>> -pc_type gamg -pc_gamg_sym_graph -ksp_monitor_true_residual
> >>>>>
> >>>>> and with the inclusion of -pc_gamg_sym_graph, I get a new malloc error:
> >>>>>
> >>>>>
> >>>>> 0]PETSC ERROR: --------------------- Error Message ------------------------------------
> >>>>> [0]PETSC ERROR: Argument out of range!
> >>>>> [0]PETSC ERROR: New nonzero at (5150,9319) caused a malloc!
> >>>>> [0]PETSC ERROR: ------------------------------------------------------------------------
> >>>>> [0]PETSC ERROR: Petsc Development HG revision: 587b25035091aaa309c87c90ac64c13408ecf34e  HG Date: Wed Mar 14 09:22:54 2012 -0500
> >>>>> [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> >>>>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> >>>>> [0]PETSC ERROR: See docs/index.html for manual pages.
> >>>>> [0]PETSC ERROR: ------------------------------------------------------------------------
> >>>>> [0]PETSC ERROR: ../JohnRepo/VFOLD_exe on a linux-deb named wv.iihr.uiowa.edu by jmousel Wed Mar 14 11:51:35 2012
> >>>>> [0]PETSC ERROR: Libraries linked from /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/linux-debug/lib
> >>>>> [0]PETSC ERROR: Configure run at Wed Mar 14 09:46:39 2012
> >>>>> [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
> >>>>> [0]PETSC ERROR: ------------------------------------------------------------------------
> >>>>> [0]PETSC ERROR: MatSetValues_MPIAIJ() line 506 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/mat/impls/aij/mpi/mpiaij.c
> >>>>> [0]PETSC ERROR: MatSetValues() line 1141 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/mat/interface/matrix.c
> >>>>> [0]PETSC ERROR: scaleFilterGraph() line 155 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/ksp/pc/impls/gamg/tools.c
> >>>>> [0]PETSC ERROR: PCGAMGgraph_AGG() line 865 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/ksp/pc/impls/gamg/agg.c
> >>>>> [0]PETSC ERROR: PCSetUp_GAMG() line 516 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/ksp/pc/impls/gamg/gamg.c
> >>>>> [0]PETSC ERROR: PCSetUp() line 832 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/ksp/pc/interface/precon.c
> >>>>> [0]PETSC ERROR: KSPSetUp() line 261 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/ksp/ksp/interface/itfunc.c
> >>>>> [0]PETSC ERROR: KSPSolve() line 385 in /home/jmousel/NumericalLibraries/petsc-hg/petsc-dev/src/ksp/ksp/interface/itfunc.c
> >>>>>
> >>>>>
> >>>>> John
> >>>>>
> >>>>>
> >>>>> On Wed, Mar 14, 2012 at 11:27 AM, Mark F. Adams <mark.adams at columbia.edu> wrote:
> >>>>>
> >>>>> On Mar 14, 2012, at 11:56 AM, John Mousel wrote:
> >>>>>
> >>>>>> Mark,
> >>>>>>
> >>>>>> The matrix is asymmetric. Does this require the setting of an option?
> >>>>>
> >>>>> Yes:  -pc_gamg_sym_graph
> >>>>>
> >>>>> Mark
> >>>>>
> >>>>>> I pulled petsc-dev this morning, so I should have (at least close to) the latest code.
> >>>>>>
> >>>>>> John
> >>>>>>
> >>>>>> On Wed, Mar 14, 2012 at 10:54 AM, Mark F. Adams <mark.adams at columbia.edu> wrote:
> >>>>>>
> >>>>>> On Mar 14, 2012, at 11:08 AM, John Mousel wrote:
> >>>>>>
> >>>>>>> I'm getting the following error when using GAMG.
> >>>>>>>
> >>>>>>> petsc-dev/src/ksp/pc/impls/gamg/agg.c:508: smoothAggs: Assertion `sgid==-1' failed.
> >>>>>>
> >>>>>> Is it possible that your matrix is structurally asymmetric?
> >>>>>>
> >>>>>> 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).
> >>>>>>
> >>>>>>>
> >>>>>>> When I try to alter the type of aggregation at the command line using -pc_gamg_type pa, I'm getting
> >>>>>>>
> >>>>>>> [0]PETSC ERROR: [1]PETSC ERROR: --------------------- Error Message ------------------------------------
> >>>>>>> [1]PETSC ERROR: Unknown type. Check for miss-spelling or missing external package needed for type:
> >>>>>>> see http://www.mcs.anl.gov/petsc/documentation/installation.html#external!
> >>>>>>> [1]PETSC ERROR: Unknown GAMG type pa given!
> >>>>>>>
> >>>>>>> Has there been a change in the aggregation options? I just pulled petsc-dev this morning.
> >>>>>>>
> >>>>>>
> >>>>>> Yes, this option is gone now.  You can use -pc_gamg_type agg for now.
> >>>>>>
> >>>>>> Mark
> >>>>>>
> >>>>>>> John
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>
> >>>
> >>
> >>
> >
> >
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120314/7d99360e/attachment.htm>


More information about the petsc-users mailing list