← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Filter out PETSc argument when parsing command-line parameters.

 

On Saturday 05 September 2009 23:40:50 DOLFIN wrote:
> One or more new changesets pushed to the primary dolfin repository.
> A short summary of the last three changesets is included below.
> 
> changeset:   6950:e685bced17258c83ec9c55badc4ce3adf991c1d8
> tag:         tip
> user:        Anders Logg <logg@xxxxxxxxx>
> date:        Sat Sep 05 23:40:39 2009 +0200
> files:       ChangeLog demo/parameters/cpp/main.cpp
>  dolfin/main/SubSystemsManager.cpp dolfin/main/SubSystemsManager.h
>  dolfin/parameter/GlobalParameters.cpp dolfin/parameter/GlobalParameters.h
>  dolfin/parameter/Parameters.cpp dolfin/parameter/Parameters.h description:
> Filter out PETSc argument when parsing command-line parameters.
> The following should now work:
> 
>   ./demo <other options> --petsc.foo bar <other options>
> 
> provided the program in question parses command-line arguments by
> 
>   parameters.parse(argc, argv).
> 
> All arguments starting with "--petsc." will be sent to PETSc. In the
> above example,
> 
>   -foo bar
> 
> will be sent to PETSc. (Note '-' instead of '--'.)
> 
> Other arguments will be parsed by the parameter set in question.
> 
> This only happens for the global DOLFIN parameter set (or any other
> parameter set named "dolfin").

It is a bit fragile to rely on the naming of a particular parameter.

Couldn't the petsc part be implemented in GlobalParameters::parse() instead, 
for example by letting 'parse' be a virtual function? 

Johan


> 
> changeset:   6949:e34f22563ad2f44e18211f278c4830777342651c
> user:        Anders Logg <logg@xxxxxxxxx>
> date:        Sat Sep 05 15:26:54 2009 +0200
> files:       demo/parameters/cpp/SConstruct demo/parameters/cpp/main.cpp
>  dolfin/mesh/Mesh.cpp dolfin/parameter/Parameters.cpp
>  sandbox/misc/cpp/main.cpp description:
> Add C++ demo of parameter system, will add Python version later.
> 
> 
> changeset:   6948:cb1e840d6a5544703357bbc2bd66bb61d32c4687
> user:        Anders Logg <logg@xxxxxxxxx>
> date:        Sat Sep 05 09:53:36 2009 +0200
> files:       dolfin/parameter/Parameters.cpp
> description:
> Indent fix in str() for Parameters
> 
> ----------------------------------------------------------------------
> For more details, visit http://www.fenics.org/hg/dolfin
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
> 


Follow ups

References