<div dir="ltr">On Sun, Sep 1, 2013 at 6:31 PM, Mark F. Adams <span dir="ltr"><<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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:<br>
<br>
  call DMSetFromOptions(solver%dalam,ierr)<br>
  call DMCompositeAddDM(solver%da,solver%dalam,ierr)<br>
  call DMSetFromOptions(solver%da,ierr)<br>
  call DMSetUp(solver%da,ierr)<br>
  call SNESCreate(comm,solver%snes,ierr)<br>
  call SNESSetDM(solver%snes,solver%da,ierr)<br>
  call SNESSetFromOptions(solver%snes,ierr)<br>
<br>
  if (sml_mype/sml_pe_per_plane .gt. 0) then ! not first, no monitor<br>
     call SNESMonitorCancel(solver%snes,ierr)<br>
     CHKERRQ(ierr)<br>
     call SNESGetKSP(solver%snes,ksp,ierr)<br>
     CHKERRQ(ierr)<br>
     call KSPMonitorCancel(ksp,ierr)<br>
     CHKERRQ(ierr)<br>
  endif<br>
<br>
First, a quick question: do I want to call DMSetFromOptions here (first line)?<br></blockquote><div><br></div><div>Almost certainly.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
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 </blockquote><div><br></div><div>Why not just give different options prefixes and do it from the command line?</div>
<div><br></div><div>   MAtt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">SNESSetUp to get the KSPs created, etc, but got this error:<br>
<br>
<br>
[33]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
[33]PETSC ERROR: Argument aliasing not permitted!<br>
[33]PETSC ERROR: Solution vector cannot be right hand side vector!<br>
[33]PETSC ERROR: ------------------------------------------------------------------------<br>
[33]PETSC ERROR: Petsc Development GIT revision: d40a587a06aadd7edf3aa830331a2de63b9eb164  GIT Date: 2013-08-31 15:18:06 -0500<br>
[33]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
[33]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
[33]PETSC ERROR: See docs/index.html for manual pages.<br>
[33]PETSC ERROR: ------------------------------------------------------------------------<br>
[33]PETSC ERROR: ../xgc2 on a arch-sith-opt named sith2 by adams Sun Sep  1 19:12:19 2013<br>
[33]PETSC ERROR: Libraries linked from /autofs/na3_home1/adams/petsc/arch-sith-opt/lib<br>
[33]PETSC ERROR: Configure run at Sun Sep  1 18:04:43 2013<br>
[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<br>

[33]PETSC ERROR: ------------------------------------------------------------------------<br>
[33]PETSC ERROR: SNESSetUp() line 2580 in src/snes/interface/snes.c<br>
<br>
<br>
Any ideas?<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>