[petsc-dev] PetscOptionsTail

Peter Brune prbrune at gmail.com
Mon Apr 2 14:43:39 CDT 2012


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.

- Peter

On Mon, Apr 2, 2012 at 2:40 PM, Mark F. Adams <mark.adams at columbia.edu>wrote:

> I am getting strange behavior with PetscOptionsTail.  I have this code:
>
>  /* instantiate derived type */
>  ierr = PetscOptionsHead("GAMG options"); CHKERRQ(ierr);
>  {
>    char tname[256] = GAMGAGG;
>    ierr = PetscOptionsList("-pc_gamg_type","Type of GAMG
> method","PCGAMGSetType",
>                            GAMGList, tname, tname, sizeof(tname),
> PETSC_NULL );
>    CHKERRQ(ierr);
>    ierr = PCGAMGSetType( pc, tname ); CHKERRQ(ierr);
>  }
> PetscPrintf(wcomm,"******* [%d]%s 5555\n",0,__FUNCT__);
>  ierr = PetscOptionsTail();   CHKERRQ(ierr);
> PetscPrintf(wcomm,"******* [%d]%s 6666\n",0,__FUNCT__);
>
> 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.
>
> Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120402/1522981b/attachment.html>


More information about the petsc-dev mailing list