Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the use of YAML in Albany #21

Closed
jtostie opened this issue Aug 19, 2016 · 15 comments
Closed

Enable the use of YAML in Albany #21

jtostie opened this issue Aug 19, 2016 · 15 comments

Comments

@jtostie
Copy link
Contributor

jtostie commented Aug 19, 2016

Dave and Coleman has done some work for the crystal plasticity model, Chris S. has also worked on YAML.

@lxmota lxmota self-assigned this Feb 2, 2017
@lxmota
Copy link
Contributor

lxmota commented Feb 2, 2017

Yes, I should research this YAML issue. I'm told that you can enable a YAML parser for Teuchos.

@ibaned
Copy link
Contributor

ibaned commented Feb 2, 2017

If we find that YAML is a viable input option, one thing that will be especially useful will be an XML to YAML converter.

@bgranzow
Copy link
Contributor

bgranzow commented Feb 2, 2017

The Teuchos YAML parser function defined here in Trilinos

Seems to mirror the function used here in Albany:

I've used the Teuchos YAML parser before and it is quite nice. Some things to consider:

  • Using this parser requires an extra TPL dependency on yaml-cpp
  • I don't know for sure, but I don't think that the YAML parser has support for populating a Teuchos::TwoDArray parameter from the YAML input file. This type of parameter is used in several places (e.g. Neumann boundary in Albany.

@lxmota
Copy link
Contributor

lxmota commented Mar 8, 2017

@ibaned regarding https://github.com/gahansen/Albany/issues/21#issuecomment-276855421, I have investigated this issue. I tried to create a converter. The Teuchos ParameterList class has readers for both XML and YAML. There is a writer for XML but not for YAML (I was fooled by seeing that there is a declaration for the YAML writer but there is no implementation!).

Not sure at this point what is the best way to proceed. Since the structure of the input files is very well defined and doesn't require all the syntax elements of either XML or YAML, I toyed with the idea of creating a simple parser to write a converter. But I just don't have time right now to play with this.

@lxmota
Copy link
Contributor

lxmota commented Mar 8, 2017

@ibaned
Copy link
Contributor

ibaned commented Mar 8, 2017

@lxmota @bgranzow I've recently done a lot of work to make YAML support complete enough for Albany's use cases. The result is pull request trilinos/Trilinos#1112. This adds support for TwoDArray input and output, and improve the API so that it can operate on any C++ stream. There was a YAML writer, I just made it more general and added TwoDArray support. There is also a function convertXmlToYaml, which looks like exactly what we need to carry out the replacement. All we have to do is turn that function into an executable.

So, once trilinos/Trilinos#1112 gets accepted and we agree to depend on yaml-cpp, we should be ready to begin really switching lots of things over to YAML.

@lxmota
Copy link
Contributor

lxmota commented Mar 8, 2017

@ibaned @bgranzow https://github.com/gahansen/Albany/issues/21#issuecomment-285140886
This is great! I can hardly wait to convert files. I'll take a look at that convertXmlToYaml function and see if there is the corresponding convertYamlToXml for folks that don't want to depend on yaml-cpp. Although we can all agree to depend on it. I vote yes.

@ibaned
Copy link
Contributor

ibaned commented Mar 8, 2017

The reverse conversion should be trivial to implement, both formats have read and write implemented.

@bgranzow
Copy link
Contributor

bgranzow commented Mar 8, 2017

@lxmota @ibaned I'm on board with making yaml-cpp a required dependency (or at least required for many tests). yaml-cpp seems to be a popular, pretty well-developed small package that's been easy to install on all systems I've worked on. Thanks for the extensions @ibaned!

@lxmota
Copy link
Contributor

lxmota commented Mar 9, 2017

@ibaned @bgranzow Let us then rise the issue of making yaml-cpp a dependency at the next Albany teleconference.

@ibaned ibaned self-assigned this Mar 12, 2017
@lxmota
Copy link
Contributor

lxmota commented Mar 12, 2017

@ibaned Ha! I just logged in to give it a try to write the converters and I see this commit!

Thanks!

lxmota added a commit that referenced this issue Mar 16, 2017
yaml-cpp, git and cmake in preparation for switching LCM
to YAML input.

[#21, #22]
lxmota added a commit that referenced this issue Mar 17, 2017
conflicts on the SEMS environment when YAML is specified.
Boost is loaded automatically as it is a dependency.

[#21, #22]
@ibaned
Copy link
Contributor

ibaned commented Mar 22, 2017

Everything else is in place, waiting on Trilinos develop->master.

@lxmota
Copy link
Contributor

lxmota commented Mar 22, 2017

@ibaned Thanks for your hard work on this. This is a big usability improvement.

Who would be in charge of merging Trilinos develop to master? Maybe we can give them a nudge.

@ibaned
Copy link
Contributor

ibaned commented Mar 22, 2017

I believe the current lag may be due to the Trilinos framework team working on trilinos/Trilinos#1154, which I think is great because once the system is automated we should see much more frequent merges from develop to master, and less frequent merges that break master. I would contact the people mentioned in that issue for updates.

ibaned added a commit that referenced this issue Mar 23, 2017
@ibaned ibaned changed the title Improve usability by building input files Enable the use of YAML in Albany Mar 23, 2017
@ibaned
Copy link
Contributor

ibaned commented Mar 23, 2017

The Trilinos merge has happened ! I've enabled the YAML converters, we are free to move forward here. I recommend we close this issue as it represents putting in place the machinery necessary to use YAML. We can create other issues to track progress in converting test problems over to YAML, or for accepting YAML as a required dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants