[petsc-users] Not displaying petsc options with -help

Jacob Faibussowitsch jacob.fai at gmail.com
Mon Jan 11 18:02:24 CST 2021


Not directly, but you can use PetscOptionsHasHelp() to query whether the user runs with “-help”, print all of your available options and exit early. So you might do:

PetscOptionsBegin();
< your options list here >
PetscOptionsEnd();
PetscOptionsHasHelp(NULL, &set);
If (set) PetscFinalize();

You’ll still get the header with the basic PetscOptions but it shouldn’t print all the other options. 

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)
Cell: +1 (312) 694-3391

> On Jan 11, 2021, at 17:36, Mark Adams <mfadams at lbl.gov> wrote:
> 
> 
> I don't think so. I use grep.
> 
>> On Mon, Jan 11, 2021 at 5:53 PM Abhyankar, Shrirang G via petsc-users <petsc-users at mcs.anl.gov> wrote:
>> I have an application where I set a bunch of application-specific options in PetscOptionsBegin/End and it uses the default PetscOptions database. When running the application with “-help” option all the application and PETSc options get displayed. Is there a way to suppress displaying PETSc options, but only display the application options.
>> 
>>  
>> 
>> Thanks,
>> 
>> Shri
>> 
>>  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210111/74102cf8/attachment.html>


More information about the petsc-users mailing list