[petsc-dev] getting parts of a field split PC at setup time

Mark F. Adams mfadams at lbl.gov
Sun Sep 1 18:31:14 CDT 2013


I have a code that has several concurrent solves (with their own communicators) and I want to turn off monitors for all but one.  My setup code looks something like this:

  call DMSetFromOptions(solver%dalam,ierr)
  call DMCompositeAddDM(solver%da,solver%dalam,ierr)
  call DMSetFromOptions(solver%da,ierr)
  call DMSetUp(solver%da,ierr)
  call SNESCreate(comm,solver%snes,ierr)
  call SNESSetDM(solver%snes,solver%da,ierr)
  call SNESSetFromOptions(solver%snes,ierr)

  if (sml_mype/sml_pe_per_plane .gt. 0) then ! not first, no monitor
     call SNESMonitorCancel(solver%snes,ierr)
     CHKERRQ(ierr)
     call SNESGetKSP(solver%snes,ksp,ierr)
     CHKERRQ(ierr)
     call KSPMonitorCancel(ksp,ierr)
     CHKERRQ(ierr)
  endif

First, a quick question: do I want to call DMSetFromOptions here (first line)?

I want to get the two KSP solvers inside of what I know is a fieldsplit PC but when I get the PC in the above code and try to get the KSPs I get a segv.  I thought I might call SNESSetUp to get the KSPs created, etc, but got this error:


[33]PETSC ERROR: --------------------- Error Message ------------------------------------
[33]PETSC ERROR: Argument aliasing not permitted!
[33]PETSC ERROR: Solution vector cannot be right hand side vector!
[33]PETSC ERROR: ------------------------------------------------------------------------
[33]PETSC ERROR: Petsc Development GIT revision: d40a587a06aadd7edf3aa830331a2de63b9eb164  GIT Date: 2013-08-31 15:18:06 -0500
[33]PETSC ERROR: See docs/changes/index.html for recent updates.
[33]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[33]PETSC ERROR: See docs/index.html for manual pages.
[33]PETSC ERROR: ------------------------------------------------------------------------
[33]PETSC ERROR: ../xgc2 on a arch-sith-opt named sith2 by adams Sun Sep  1 19:12:19 2013
[33]PETSC ERROR: Libraries linked from /autofs/na3_home1/adams/petsc/arch-sith-opt/lib
[33]PETSC ERROR: Configure run at Sun Sep  1 18:04:43 2013
[33]PETSC ERROR: Configure options --known-level1-dcache-size=65536 --known-level1-dcache-linesize=64 --known-level1-dcache-assoc=2 --known-memcmp-ok=1 --known-sizeof-size_t=8 --known-bits-per-byte=8 --known-sizeof-MPI_Comm=8 --known-sizeof-MPI_Fint=4 --known-mpi-long-double=1 --known-mpi-c-double-complex=0 --with-batch=1 --with-shared-libraries=0 --with-memcmp-ok --with-debugging=0 --known-sizeof-char=1 --known-sizeof-void-p=8 --known-sizeof-short=2 --known-sizeof-int=4 --known-sizeof-long=8 --known-sizeof-long-long=8 --known-sizeof-float=4 --known-sizeof-double=8 --known-sizeof-size-t=8 --bits-per-byte=8 --known-sizeof-MPI-Comm=8 --known-sizeof-MPI-Fint=4 --have-mpi-long-double=1 --with-x=0 --with-mpi-dir=/sw/redhat6/openmpi/1.6.3/rhel6_pgi12.8/ --with-mpi-shared=1 --known-mpi-shared-libraries=1 --download-blacs --download-hypre --download-metis=1 --download-parmetis --download-f-blas-lapack PETSC_ARCH=arch-sith-opt
[33]PETSC ERROR: ------------------------------------------------------------------------
[33]PETSC ERROR: SNESSetUp() line 2580 in src/snes/interface/snes.c


Any ideas?




More information about the petsc-dev mailing list