[petsc-users] read argument from an XML file
Barry Smith
bsmith at petsc.dev
Thu Aug 20 23:59:44 CDT 2020
Alex,
If you are ok with plan text you can also put all your "command line arguments" in a text file (using # for comment lines) like
-ksp_rtol 1.e-3
# very tight tolerance for SNES
-snes_rtol 1.e-12
and provide the file to PETSc via
the command line argument :-) -options_file filename
a file with a standard name petscrc in the running directory or
PetscOptionsInsertFile() https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsInsertFile.html <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsInsertFile.html>
Barry
> On Aug 20, 2020, at 11:44 PM, Alex Fleeter <luis.saturday at gmail.com> wrote:
>
> Thanks, we will try that. I have never used YAML before.
>
> Anyway, we feel using command line arguments is a bit old fashioned. It can be quite desirable to set parameters from a human-readable file.
>
> On Thu, Aug 20, 2020 at 9:38 PM Jed Brown <jed at jedbrown.org <mailto:jed at jedbrown.org>> wrote:
> You can read from a YAML file with -options_file_yaml file.yaml or via
>
> https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Sys/PetscOptionsInsertFileYAML.html <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Sys/PetscOptionsInsertFileYAML.html>
>
> Would this work for you or do you really want XML?
>
> Alex Fleeter <luis.saturday at gmail.com <mailto:luis.saturday at gmail.com>> writes:
>
> > Hi:
> >
> > Does PETSc have or plan to enable reading arguments from an XML file?
> > Something like the Teuchos package in Trilinos.
> >
> > Thanks,
> >
> > AF
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200820/782148cd/attachment.html>
More information about the petsc-users
mailing list