programmmatic access to commandline variables

Satish Balay balay at mcs.anl.gov
Tue Aug 15 11:40:06 CDT 2006


You might want to check the code of PetscOptionsLeft(),
PetscOptionsAllUsed() and reimplement the desired functionality.

The above routines are in src/sys/objects/options.c

Note - you'll have to do the check only after the options get used -
this means ksp options can be checked only after kspsolve etc.. [so
doing this just before PetscFinalize() would capture all options
usage]

Satish

On Tue, 15 Aug 2006, Yaron Kretchmer wrote:

> Hi Satish
> This would print out the options that were not used.
> What I'm looking for is a way of accessing them inside the program (as in
> going through an array of unused options or something similar)
> 
> Thanks
> Yaron
> 
> 
> 
> On 8/15/06, Satish Balay <balay at mcs.anl.gov> wrote:
> > 
> > On Tue, 15 Aug 2006, Yaron Kretchmer wrote:
> > 
> > > Hi All
> > > Is there a way of determining programatically which commandline options
> > are
> > > used/not used within petsc?
> > 
> > You can run the code with the additional option '-options_left'
> > 
> > or add the following line of code - after PetscInitialize()
> > 
> > ierr = PetscOptionsSetValue("-options_left",PETSC_NULL);CHKERRQ(ierr);
> > 
> > > Alternatively, is there a file which contains all legal commandline
> > options?
> > > If so, what is it and what is the format?
> > 
> > The options are distributed all over the code. The best way to get
> > them is to run the appliation code with '-help' option - and it prints
> > all the relavent options to that code run.
> > 
> > Satish
> > 
> > 
> 




More information about the petsc-users mailing list