On 3 Nov 2015, at 11:56, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:
Hi Justin,
On 3 Nov 2015, at 06:59, Justin Chang <jychang48@gmail.com> wrote:
Lawrence,
So I have implemented PETSc into the PYOP2 kernel, but I am sometimes getting strange errors.
Attached is the working code plus the reactions kernel file.
Run the code by typing "python 1D_analytical_ADR_ex1.py <seed> <0/1> <0/1>". The last option is for using either Newtons Method (0) or Variational Inequality (1).
I note as well that if I remove the bad par_loop code and run with PETSc in debug mode, I get the following error (running with options 5 1 1): Time = 0.010000 Traceback (most recent call last): File "1D_analytical_ADR_ex1.py", line 187, in <module> u0 = ADsolve(solver_D,u0) File "1D_analytical_ADR_ex1.py", line 171, in ADsolve solver_O.solve(u0_O,b) File "/Users/lmitche1/Documents/work/mapdes/firedrake/firedrake/linear_solver.py", line 138, in solve self.ksp.solve(rhs, solution) File "PETSc/KSP.pyx", line 363, in petsc4py.PETSc.KSP.solve (src/petsc4py.PETSc.c:152597) petsc4py.PETSc.Error: error code 77 [0] KSPSolve() line 527 in /Users/lmitche1/Documents/work/mapdes/petsc/src/ksp/ksp/interface/itfunc.c [0] KSPSetUp() line 332 in /Users/lmitche1/Documents/work/mapdes/petsc/src/ksp/ksp/interface/itfunc.c [0] PCSetUp() line 984 in /Users/lmitche1/Documents/work/mapdes/petsc/src/ksp/pc/interface/precon.c [0] PCSetUp_GAMG() line 566 in /Users/lmitche1/Documents/work/mapdes/petsc/src/ksp/pc/impls/gamg/gamg.c [0] PCGAMGCoarsen_AGG() line 997 in /Users/lmitche1/Documents/work/mapdes/petsc/src/ksp/pc/impls/gamg/agg.c [0] smoothAggs() line 353 in /Users/lmitche1/Documents/work/mapdes/petsc/src/ksp/pc/impls/gamg/agg.c [0] Petsc has generated inconsistent data [0] !(matA_1 && !matA_1->compressedrow.use) ***[0]PCReset_GAMG this should not happen, cleaned up in SetUp Lawrence