[Trilinos-Users] Teuchos::ParameterList: Control over order of entries?

Bartlett, Roscoe A rabartl at sandia.gov
Mon Mar 8 07:58:49 MST 2010


Nico,

The Teuchos::ParameterList and Teuchos::XMLObject need to be modified to maintain the original order of the parameters and sublists which they don't right now.  The XML standard actually requires that in reading and writing XML that you must maintain the ordering of the elements and the ordering of the elements is part of the content.  There are already several use cases in Trilinos were we really need to maintain the parameter ordering (if for nothing else than for keeping common parameters together in the documentation printouts).

It has been on the todo list for at least four years to modify Teuchos::ParameterList and Teuchos::XMLObject to maintain the original parameter ordering but we don't have any programmers that can do this except for PhD researchers.  This is something that I could do in a few days perhaps but I am not sure.  I know Teuchos::ParamaterList very well and have made many modifications to that class but I did not write any part of Teuchos::XMLObject so that would be harder for me to modify that class.

- Ross


> -----Original Message-----
> From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-
> users-bounces at software.sandia.gov] On Behalf Of Nico Schlömer
> Sent: Monday, March 08, 2010 5:27 AM
> To: trilinos-users at software.sandia.gov
> Subject: [Trilinos-Users] Teuchos::ParameterList: Control over order of
> entries?
> 
> Hi all,
> 
> I'm using a Trilinos::ParameterList to some (double,int,unsigned int)
> data which gets updated during runtime, and the contents of the list
> are
> written to a file in a form like
> 
> =================== *snip* ===================
> # paramA paramB specialParam ...
>     0.1         12.1       -4
>     0.2         12.1       -5
> [...]
> =================== *snap* ===================
> 
> For this, I loop through the ParameterList as
> 
> =================== *snip* ===================
> for ( k=p.begin(); k!=p.end(); ++k )
> {
>      # print value to file
> }
> =================== *snap* ===================
> 
> Now, apparently loops through the list in alphabetical order of the
> entry names. I'd like to have more control over the order of the column
> in the file, e.g., by checking which of the entries got added first or
> similar. Would it be correct to say that Teuchos::ParameterList's don't
> have any such functionality at the moment?
> 
> Are there alternatives? I've looked into LOCA::ParameterVectors (which
> really act like vectors, with each entry having an index), but they
> don't seem to support heterogeneous content types.
> 
> Cheers,
> Nico
> 
> 
> 
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users



More information about the Trilinos-Users mailing list