Does PCGAMGSetType() call PetscOptionsHead() from KSP/PCSetFromOptions on some subsolver? I had a similar issue recently with FAS. The fix is to move other function calls that might do this out of your PetscOptionsHead/Tail() pair.<br>
<br>- Peter<br><br><div class="gmail_quote">On Mon, Apr 2, 2012 at 2:40 PM, Mark F. Adams <span dir="ltr"><<a href="mailto:mark.adams@columbia.edu">mark.adams@columbia.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am getting strange behavior with PetscOptionsTail. I have this code:<br>
<br>
/* instantiate derived type */<br>
ierr = PetscOptionsHead("GAMG options"); CHKERRQ(ierr);<br>
{<br>
char tname[256] = GAMGAGG;<br>
ierr = PetscOptionsList("-pc_gamg_type","Type of GAMG method","PCGAMGSetType",<br>
GAMGList, tname, tname, sizeof(tname), PETSC_NULL );<br>
CHKERRQ(ierr);<br>
ierr = PCGAMGSetType( pc, tname ); CHKERRQ(ierr);<br>
}<br>
PetscPrintf(wcomm,"******* [%d]%s 5555\n",0,__FUNCT__);<br>
ierr = PetscOptionsTail(); CHKERRQ(ierr);<br>
PetscPrintf(wcomm,"******* [%d]%s 6666\n",0,__FUNCT__);<br>
<br>
and this last line does not get executed. It is as if CHKERRQ is silently returning. I see the usage in KSPSetFromOptions_GMRES has this code (PetscOptionsTail) at the very end and so this behavior would not be noticed.<br>
<span class="HOEnZb"><font color="#888888"><br>
Mark</font></span></blockquote></div><br>