[petsc-users] fieldsplit: Unhandled case, must have at least two fields, not 1!

Mark Adams mfadams at lbl.gov
Sun Dec 1 10:32:49 CST 2013


Perhaps this will help. The code is straight forward but prefixes are used.
 I've appended the code and a stack trace for the error.

  ! create KSP
  call KSPCreate(solver%comm,solver%ksp,ierr)
  CHKERRQ(ierr)
  if (solver%prefix.eq.2) then ! turb
     call KSPSetOptionsPrefix(solver%ksp,'s2_',ierr)
     if (sml_mype/sml_pe_per_plane .gt. 0) then ! not first, no monitor
        call PetscOptionsClearValue('-s2_ksp_monitor',ierr)
        call PetscOptionsClearValue('-s2_ksp_converged_reason',ierr)
     endif
  else ! 1 field 00 solver, no prefix
     call PetscOptionsClearValue('-ksp_monitor',ierr)
     call PetscOptionsClearValue('-ksp_converged_reason',ierr)
  end if
  call KSPSetFromOptions(solver%ksp,ierr)
  CHKERRQ(ierr)

  call KSPSetOperators(solver%ksp,  solver%Amat,  solver%Amat,
SAME_NONZERO_PATTERN, ierr )
  CHKERRQ(ierr)

  ! setup solver now that matrix is complete
  call KSPSetUp( solver%ksp, ierr )  !!! poisson.F90:213


#10 xgc1_3 () at /global/u2/m/madams/epsi/XGC1_3/main.F90:98 (at
0x00000000004b8ed6)
#9 setup (grid=..., psn=..., spall=???) at
/global/u2/m/madams/epsi/XGC1_3/setup.F90:123 (at 0x00000000004dd3b0)
#8 init_poisson (grid=..., psn=..., iflag_dummy=3) at
/global/u2/m/madams/epsi/XGC1_3/poisson.F90:36 (at 0x00000000005b06af)
#7 init_poisson_solver (grid=..., psn=..., iflag_dummy=3) at
/global/u2/m/madams/epsi/XGC1_3/poisson.F90:163 (at 0x00000000005b1f17)
#6 init_1field_solver (grid=..., psn=..., solver=...) at
/global/u2/m/madams/epsi/XGC1_3/poisson.F90:213 (at 0x00000000005b2862)
#5 kspsetup_ (ksp=0x34c7950, __ierr=0x7fffffff5290) at
/global/u2/m/madams/petsc_private/src/ksp/ksp/interface/ftn-auto/itfuncf.c:215
(at 0x0000000000a47965)
#4 KSPSetUp (ksp=0xb4e4190) at
/global/u2/m/madams/petsc_private/src/ksp/ksp/interface/itfunc.c:278 (at
0x00000000015e1c95)
#3 PCSetUp (pc=0xb4ea8d0) at
/global/u2/m/madams/petsc_private/src/ksp/pc/interface/precon.c:888 (at
0x00000000015a64ec)
#2 PCSetUp_FieldSplit (pc=0xb4ea8d0) at
/global/u2/m/madams/petsc_private/src/ksp/pc/impls/fieldsplit/fieldsplit.c:458
(at 0x0000000001b97d69)
#1 PCFieldSplitSetDefaults (pc=0xb4ea8d0) at
/global/u2/m/madams/petsc_private/src/ksp/pc/impls/fieldsplit/fieldsplit.c:440
(at 0x0000000001b979bc)
#0  PetscError (comm=-1006632952, line=440, func=0x2ea40c6
"PCFieldSplitSetDefaults", file=0x2ea3a08
"src/ksp/pc/impls/fieldsplit/fieldsplit.c", n=77, p=PETSC_ERROR_INITIAL,
mess=0x2ea4090 "Unhandled case, must have at least two fields, not %d") at
/global/u2/m/madams/petsc_private/src/sys/error/err.c:353



On Sat, Nov 30, 2013 at 6:33 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> Mark Adams <mfadams at lbl.gov> writes:
>
> > I tried putting what I thought was the problem in ex54 and you are
> correct
> > it did not cause a problem.
>
> Okay.
>
> > I've attached a good and bad "petsc.rc" file from my app and an output
> file
> > with this error.  Perhaps you can see how this broke.
>
> I don't have your app so I don't know what that code looks like.  The
> two options files are very different.  Presumably you can run on one
> process and use a debugger to see what happens in
> PCFieldSplitSetDefaults.  If you think PETSc is mishandling this, please
> add a test to PETSc (perhaps a small addition to an existing test) to
> demonstrate the issue.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131201/bc5bfa4e/attachment.html>


More information about the petsc-users mailing list