Merge lp:~albertog/siesta/4.1-yaml into lp:siesta/4.1
- 4.1-yaml
- Merge into rel-4.1
Status: | Merged |
---|---|
Merged at revision: | 921 |
Proposed branch: | lp:~albertog/siesta/4.1-yaml |
Merge into: | lp:siesta/4.1 |
Diff against target: |
1791 lines (+1671/-5) 16 files modified
Docs/YAML.README (+13/-0) Docs/yaml_tests/Makefile (+216/-0) Docs/yaml_tests/README (+5/-0) Docs/yaml_tests/analysis.rst (+137/-0) Docs/yaml_tests/conf.py (+290/-0) Docs/yaml_tests/implementation.rst (+65/-0) Docs/yaml_tests/index.rst (+22/-0) Src/Makefile (+5/-4) Src/m_io_yaml.F90 (+215/-0) Src/siesta.F (+3/-0) Tests/Scripts/yaml_compare.py (+303/-0) Tests/YAML_Refs/benzene.yml (+45/-0) Tests/YAML_Refs/h2o.yml (+45/-0) Tests/YAML_Refs/mno_ldau.yml (+45/-0) Tests/siesta-testsuite.yml (+258/-0) version.info (+4/-1) |
To merge this branch: | bzr merge lp:~albertog/siesta/4.1-yaml |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Yann Pouillon (community) | Approve | ||
Review via email: mp+347034@code.launchpad.net |
Commit message
YAML infrastructure for output testing
(By Yann Pouillon)
The implementation consists of:
* A simple hook in siesta.F to call the siesta_write_yaml routine
in module Src/m_io_yaml.F90.
* A YAML reference directory: Tests/YAML_Refs/
(currently populated by just three token examples)
* A post-processing script: Tests/Scripts/
* A configuration file Tests/siesta-
See Docs/yaml_
Notes
- Only energies are processed in this initial implementation.
- The post-processing script depends on ruamel.yaml (pip install [--local] ruamel.yaml)
- SIESTA does not require LibYAML to emit YAML files
Description of the change
Yann Pouillon (pouillon) wrote : | # |
- 922. By Alberto Garcia
-
Remove _build/html files in Docs/yaml_tests
Alberto Garcia (albertog) wrote : | # |
OK. Removed the _build/html directory.
Yann Pouillon (pouillon) wrote : | # |
Then you're good to go. Thanks!
Nick Papior (nickpapior) wrote : | # |
Great job! I have two changes.
The transiesta flag in 4.1 is now intrinsic. So no need to do pre-processor statement checks there.
- 923. By Alberto Garcia
-
Remove Transiesta pre-processed items
Preview Diff
1 | === added file 'Docs/YAML.README' |
2 | --- Docs/YAML.README 1970-01-01 00:00:00 +0000 |
3 | +++ Docs/YAML.README 2018-05-30 08:59:05 +0000 |
4 | @@ -0,0 +1,13 @@ |
5 | +One YAML Format Version: 1.2 |
6 | +One Fortran module: Src/m_io_yaml.F90 |
7 | +One I/O routine: siesta_write_yaml (no arguments) |
8 | +One call from the main SIESTA routine: Src/siesta.F:104 |
9 | +One YAML reference directory: Tests/YAML_Refs/ |
10 | +One post-processing script: Tests/Scripts/yaml_compare.py |
11 | +One global report with detailed info: Tests/tests-report.yml |
12 | + |
13 | +Notes |
14 | + |
15 | +The post-processing script depends on ruamel.yaml pip install [--local] ruamel.yaml |
16 | + |
17 | +SIESTA does not require LibYAML to emit YAML files |
18 | |
19 | === added directory 'Docs/yaml_tests' |
20 | === added file 'Docs/yaml_tests/Makefile' |
21 | --- Docs/yaml_tests/Makefile 1970-01-01 00:00:00 +0000 |
22 | +++ Docs/yaml_tests/Makefile 2018-05-30 08:59:05 +0000 |
23 | @@ -0,0 +1,216 @@ |
24 | +# Makefile for Sphinx documentation |
25 | +# |
26 | + |
27 | +# You can set these variables from the command line. |
28 | +SPHINXOPTS = |
29 | +SPHINXBUILD = sphinx-build |
30 | +PAPER = |
31 | +BUILDDIR = _build |
32 | + |
33 | +# User-friendly check for sphinx-build |
34 | +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) |
35 | +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) |
36 | +endif |
37 | + |
38 | +# Internal variables. |
39 | +PAPEROPT_a4 = -D latex_paper_size=a4 |
40 | +PAPEROPT_letter = -D latex_paper_size=letter |
41 | +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . |
42 | +# the i18n builder cannot share the environment and doctrees with the others |
43 | +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . |
44 | + |
45 | +.PHONY: help |
46 | +help: |
47 | + @echo "Please use \`make <target>' where <target> is one of" |
48 | + @echo " html to make standalone HTML files" |
49 | + @echo " dirhtml to make HTML files named index.html in directories" |
50 | + @echo " singlehtml to make a single large HTML file" |
51 | + @echo " pickle to make pickle files" |
52 | + @echo " json to make JSON files" |
53 | + @echo " htmlhelp to make HTML files and a HTML help project" |
54 | + @echo " qthelp to make HTML files and a qthelp project" |
55 | + @echo " applehelp to make an Apple Help Book" |
56 | + @echo " devhelp to make HTML files and a Devhelp project" |
57 | + @echo " epub to make an epub" |
58 | + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" |
59 | + @echo " latexpdf to make LaTeX files and run them through pdflatex" |
60 | + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" |
61 | + @echo " text to make text files" |
62 | + @echo " man to make manual pages" |
63 | + @echo " texinfo to make Texinfo files" |
64 | + @echo " info to make Texinfo files and run them through makeinfo" |
65 | + @echo " gettext to make PO message catalogs" |
66 | + @echo " changes to make an overview of all changed/added/deprecated items" |
67 | + @echo " xml to make Docutils-native XML files" |
68 | + @echo " pseudoxml to make pseudoxml-XML files for display purposes" |
69 | + @echo " linkcheck to check all external links for integrity" |
70 | + @echo " doctest to run all doctests embedded in the documentation (if enabled)" |
71 | + @echo " coverage to run coverage check of the documentation (if enabled)" |
72 | + |
73 | +.PHONY: clean |
74 | +clean: |
75 | + rm -rf $(BUILDDIR)/* |
76 | + |
77 | +.PHONY: html |
78 | +html: |
79 | + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html |
80 | + @echo |
81 | + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." |
82 | + |
83 | +.PHONY: dirhtml |
84 | +dirhtml: |
85 | + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml |
86 | + @echo |
87 | + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." |
88 | + |
89 | +.PHONY: singlehtml |
90 | +singlehtml: |
91 | + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml |
92 | + @echo |
93 | + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." |
94 | + |
95 | +.PHONY: pickle |
96 | +pickle: |
97 | + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle |
98 | + @echo |
99 | + @echo "Build finished; now you can process the pickle files." |
100 | + |
101 | +.PHONY: json |
102 | +json: |
103 | + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json |
104 | + @echo |
105 | + @echo "Build finished; now you can process the JSON files." |
106 | + |
107 | +.PHONY: htmlhelp |
108 | +htmlhelp: |
109 | + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp |
110 | + @echo |
111 | + @echo "Build finished; now you can run HTML Help Workshop with the" \ |
112 | + ".hhp project file in $(BUILDDIR)/htmlhelp." |
113 | + |
114 | +.PHONY: qthelp |
115 | +qthelp: |
116 | + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp |
117 | + @echo |
118 | + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ |
119 | + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" |
120 | + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/YAMLTestsinSIESTA.qhcp" |
121 | + @echo "To view the help file:" |
122 | + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/YAMLTestsinSIESTA.qhc" |
123 | + |
124 | +.PHONY: applehelp |
125 | +applehelp: |
126 | + $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp |
127 | + @echo |
128 | + @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." |
129 | + @echo "N.B. You won't be able to view it unless you put it in" \ |
130 | + "~/Library/Documentation/Help or install it in your application" \ |
131 | + "bundle." |
132 | + |
133 | +.PHONY: devhelp |
134 | +devhelp: |
135 | + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp |
136 | + @echo |
137 | + @echo "Build finished." |
138 | + @echo "To view the help file:" |
139 | + @echo "# mkdir -p $$HOME/.local/share/devhelp/YAMLTestsinSIESTA" |
140 | + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/YAMLTestsinSIESTA" |
141 | + @echo "# devhelp" |
142 | + |
143 | +.PHONY: epub |
144 | +epub: |
145 | + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub |
146 | + @echo |
147 | + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." |
148 | + |
149 | +.PHONY: latex |
150 | +latex: |
151 | + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex |
152 | + @echo |
153 | + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." |
154 | + @echo "Run \`make' in that directory to run these through (pdf)latex" \ |
155 | + "(use \`make latexpdf' here to do that automatically)." |
156 | + |
157 | +.PHONY: latexpdf |
158 | +latexpdf: |
159 | + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex |
160 | + @echo "Running LaTeX files through pdflatex..." |
161 | + $(MAKE) -C $(BUILDDIR)/latex all-pdf |
162 | + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." |
163 | + |
164 | +.PHONY: latexpdfja |
165 | +latexpdfja: |
166 | + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex |
167 | + @echo "Running LaTeX files through platex and dvipdfmx..." |
168 | + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja |
169 | + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." |
170 | + |
171 | +.PHONY: text |
172 | +text: |
173 | + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text |
174 | + @echo |
175 | + @echo "Build finished. The text files are in $(BUILDDIR)/text." |
176 | + |
177 | +.PHONY: man |
178 | +man: |
179 | + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man |
180 | + @echo |
181 | + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." |
182 | + |
183 | +.PHONY: texinfo |
184 | +texinfo: |
185 | + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo |
186 | + @echo |
187 | + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." |
188 | + @echo "Run \`make' in that directory to run these through makeinfo" \ |
189 | + "(use \`make info' here to do that automatically)." |
190 | + |
191 | +.PHONY: info |
192 | +info: |
193 | + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo |
194 | + @echo "Running Texinfo files through makeinfo..." |
195 | + make -C $(BUILDDIR)/texinfo info |
196 | + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." |
197 | + |
198 | +.PHONY: gettext |
199 | +gettext: |
200 | + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale |
201 | + @echo |
202 | + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." |
203 | + |
204 | +.PHONY: changes |
205 | +changes: |
206 | + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes |
207 | + @echo |
208 | + @echo "The overview file is in $(BUILDDIR)/changes." |
209 | + |
210 | +.PHONY: linkcheck |
211 | +linkcheck: |
212 | + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck |
213 | + @echo |
214 | + @echo "Link check complete; look for any errors in the above output " \ |
215 | + "or in $(BUILDDIR)/linkcheck/output.txt." |
216 | + |
217 | +.PHONY: doctest |
218 | +doctest: |
219 | + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest |
220 | + @echo "Testing of doctests in the sources finished, look at the " \ |
221 | + "results in $(BUILDDIR)/doctest/output.txt." |
222 | + |
223 | +.PHONY: coverage |
224 | +coverage: |
225 | + $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage |
226 | + @echo "Testing of coverage in the sources finished, look at the " \ |
227 | + "results in $(BUILDDIR)/coverage/python.txt." |
228 | + |
229 | +.PHONY: xml |
230 | +xml: |
231 | + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml |
232 | + @echo |
233 | + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." |
234 | + |
235 | +.PHONY: pseudoxml |
236 | +pseudoxml: |
237 | + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml |
238 | + @echo |
239 | + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." |
240 | |
241 | === added file 'Docs/yaml_tests/README' |
242 | --- Docs/yaml_tests/README 1970-01-01 00:00:00 +0000 |
243 | +++ Docs/yaml_tests/README 2018-05-30 08:59:05 +0000 |
244 | @@ -0,0 +1,5 @@ |
245 | +You need sphinx to re-create the documentation in html or other formats. |
246 | +(Type 'make help' for the various options) |
247 | + |
248 | +The source .rst files themselves are quite readable. |
249 | + |
250 | |
251 | === added directory 'Docs/yaml_tests/_static' |
252 | === added file 'Docs/yaml_tests/analysis.rst' |
253 | --- Docs/yaml_tests/analysis.rst 1970-01-01 00:00:00 +0000 |
254 | +++ Docs/yaml_tests/analysis.rst 2018-05-30 08:59:05 +0000 |
255 | @@ -0,0 +1,137 @@ |
256 | +=============================================== |
257 | +Analyzing tests using the YAML output of SIESTA |
258 | +=============================================== |
259 | + |
260 | +Minimum requirements |
261 | +-------------------- |
262 | + |
263 | +Performing the analysis of the YAML data produced by SIESTA requires the |
264 | +following packages: |
265 | + |
266 | +- Python 3.4 or later; |
267 | +- The *ruamel.yaml* Python package. |
268 | + |
269 | +Optionally, the *termcolor* Python package can be installed to provide |
270 | +colorized on-screen output (recommended). |
271 | + |
272 | +To install Python, please refer to the documentation of your system |
273 | +distribution. Once Python is installed, you can install in turn the additional |
274 | +Python packages using PIP: |
275 | + |
276 | +.. code:: |
277 | + |
278 | + pip install ruamel.yaml termcolor |
279 | + |
280 | +Depending on how you have installed Python, the PIP executable may have a |
281 | +different name, e.g. *pip3* or *pip3.6*. |
282 | + |
283 | + |
284 | +Data workflow |
285 | +------------- |
286 | + |
287 | +The data of every test case goes through two steps: generation by a SIESTA |
288 | +executable and post-processing by a Python script. The workflow is open to |
289 | +further post-processing thanks to the generation of a YAML report of the |
290 | +analysis. |
291 | + |
292 | +The following diagram illustrates how the data is processed when running a |
293 | +YAML-enabled SIESTA executable: |
294 | + |
295 | +.. graphviz:: |
296 | + |
297 | + digraph yaml_workflow { |
298 | + |
299 | + graph [fontname="Helvetica"]; |
300 | + node [fontname="Helvetica"]; |
301 | + edge [fontname="Helvetica"]; |
302 | + |
303 | + node [shape="box", style="filled", fillcolor="skyblue"]; |
304 | + siesta [label="SIESTA"]; |
305 | + yaml_cmp [label="yaml_compare.py"]; |
306 | + |
307 | + node [shape="oval", style="filled", fillcolor="gold"]; |
308 | + config [label="siesta-testsuite.yml"]; |
309 | + input [label="Input file", fillcolor="mistyrose"]; |
310 | + outvars [label="OUTVARS.yml"]; |
311 | + refs [label="YAML_Refs/"]; |
312 | + report [label="tests-report.yml"]; |
313 | + |
314 | + node [shape="octagon", style="filled", fillcolor="white"]; |
315 | + summary [label="Screen summary"]; |
316 | + |
317 | + input -> siesta; |
318 | + siesta -> outvars; |
319 | + config -> yaml_cmp; |
320 | + outvars -> yaml_cmp; |
321 | + refs -> yaml_cmp; |
322 | + yaml_cmp -> report; |
323 | + yaml_cmp -> summary; |
324 | + } |
325 | + |
326 | +At the end of the calculation, SIESTA writes down a file named *OUTVARS.yml*, |
327 | +which contains information about both the build parameters of SIESTA and the |
328 | +values of selected variables (energies for the moment). The *yaml_compare.py* |
329 | +script then analyzes the content of *OUTVARS.yml* for each test case and |
330 | +compares it to the corresponding reference file located in the |
331 | +*Tests/YAML_Refs/* directory. The behaviour of the script can be tuned by |
332 | +editing the *siesta-testuite.yml* configuration file, which contains the full |
333 | +specifications of the SIESTA Test Suite, including fine-grained tolerances for |
334 | +the comparisons. Once the output of all tests has been processed, the |
335 | +*yaml_compare.py* script generates a detailed report in YAML format, |
336 | +*tests-report.yml*, as well as a condensed summary on the terminal. |
337 | + |
338 | +The YAML report can be read by humans but is optimized for further automated |
339 | +analysis and problem diagnosis, while the on-screen summary is intended |
340 | +primarily for the user and can be colorized if the terminal allows it (see the |
341 | +*--fancy* option of *yaml_compare.py*). |
342 | + |
343 | + |
344 | +How to use yaml_compare.py |
345 | +-------------------------- |
346 | + |
347 | +The *yaml_compare.py* script is loacted in *Tests/Scripts/* and expected to |
348 | +run from the top directory of the SIESTA Test Suite (*Tests/*), through the |
349 | +following command: *./Scripts/yaml_compare.py [options]*. It goes through all |
350 | +test cases described in *siesta-testsuite.yml* and follows the specifications |
351 | +available therein. |
352 | + |
353 | +Several parameters of the scripts can be tuned through command-line options. |
354 | +For detailed information about them, just run: |
355 | + |
356 | +.. code:: |
357 | + |
358 | + ./Scripts/yaml_compare.py --help |
359 | + |
360 | +The *termcolor* Python package is necessary to get fancy colorized output |
361 | +through the *--fancy* option, which will simply be ignored otherwise. If this |
362 | +option is not used, the on-screen summary displayed by *yaml_compare.py* is |
363 | +valid RestructuredText and can be further processed to produce HTML and/or PDF |
364 | +summaries. |
365 | + |
366 | + |
367 | +Configuring the tests |
368 | +--------------------- |
369 | + |
370 | +All configuration parameters related to the processing of the tests are stored |
371 | +in the self-documented *Tests/siesta-testsuite.yml* file. All information on |
372 | +how to tune the various parameters can thus be found in the file itself. |
373 | + |
374 | + |
375 | +Generating new references |
376 | +------------------------- |
377 | + |
378 | +The procedure to generate new references is the following: |
379 | + |
380 | +#. Build SIESTA using the reference configuration specifications. |
381 | +#. Run the test case and carefully check the output, both on screen and in |
382 | + *OUTVARS.yml*. |
383 | +#. Copy *OUTVARS.yml* to *~siesta/Tests/YAML_Refs/test_name.yml*, where you |
384 | + replace *test_name* by the actual name of the test. |
385 | +#. Add the test case specifications into *~siesta/Tests/siesta-testsuite.yml*. |
386 | +#. Run *yaml_compare.py* and check that the reference passes the test against |
387 | + itself. |
388 | + |
389 | +.. note:: |
390 | + |
391 | + TODO: Define the reference specifications for the build of SIESTA. |
392 | + |
393 | |
394 | === added file 'Docs/yaml_tests/conf.py' |
395 | --- Docs/yaml_tests/conf.py 1970-01-01 00:00:00 +0000 |
396 | +++ Docs/yaml_tests/conf.py 2018-05-30 08:59:05 +0000 |
397 | @@ -0,0 +1,290 @@ |
398 | +#!/usr/bin/env python3 |
399 | +# -*- coding: utf-8 -*- |
400 | +# |
401 | +# YAML Tests in SIESTA documentation build configuration file, created by |
402 | +# sphinx-quickstart on Thu Jan 18 15:13:04 2018. |
403 | +# |
404 | +# This file is execfile()d with the current directory set to its |
405 | +# containing dir. |
406 | +# |
407 | +# Note that not all possible configuration values are present in this |
408 | +# autogenerated file. |
409 | +# |
410 | +# All configuration values have a default; values that are commented out |
411 | +# serve to show the default. |
412 | + |
413 | +import sys |
414 | +import os |
415 | + |
416 | +# If extensions (or modules to document with autodoc) are in another directory, |
417 | +# add these directories to sys.path here. If the directory is relative to the |
418 | +# documentation root, use os.path.abspath to make it absolute, like shown here. |
419 | +#sys.path.insert(0, os.path.abspath('.')) |
420 | + |
421 | +# -- General configuration ------------------------------------------------ |
422 | + |
423 | +# If your documentation needs a minimal Sphinx version, state it here. |
424 | +#needs_sphinx = '1.0' |
425 | + |
426 | +# Add any Sphinx extension module names here, as strings. They can be |
427 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
428 | +# ones. |
429 | +extensions = [ |
430 | + 'sphinx.ext.graphviz', |
431 | + 'sphinx.ext.mathjax', |
432 | +] |
433 | + |
434 | +# Add any paths that contain templates here, relative to this directory. |
435 | +templates_path = ['_templates'] |
436 | + |
437 | +# The suffix(es) of source filenames. |
438 | +# You can specify multiple suffix as a list of string: |
439 | +# source_suffix = ['.rst', '.md'] |
440 | +source_suffix = '.rst' |
441 | + |
442 | +# The encoding of source files. |
443 | +#source_encoding = 'utf-8-sig' |
444 | + |
445 | +# The master toctree document. |
446 | +master_doc = 'index' |
447 | + |
448 | +# General information about the project. |
449 | +project = 'YAML Tests in SIESTA' |
450 | +copyright = '2018, Yann Pouillon' |
451 | +author = 'Yann Pouillon' |
452 | + |
453 | +# The version info for the project you're documenting, acts as replacement for |
454 | +# |version| and |release|, also used in various other places throughout the |
455 | +# built documents. |
456 | +# |
457 | +# The short X.Y version. |
458 | +version = '0.1' |
459 | +# The full version, including alpha/beta/rc tags. |
460 | +release = '0.1.0' |
461 | + |
462 | +# The language for content autogenerated by Sphinx. Refer to documentation |
463 | +# for a list of supported languages. |
464 | +# |
465 | +# This is also used if you do content translation via gettext catalogs. |
466 | +# Usually you set "language" from the command line for these cases. |
467 | +language = None |
468 | + |
469 | +# There are two options for replacing |today|: either, you set today to some |
470 | +# non-false value, then it is used: |
471 | +#today = '' |
472 | +# Else, today_fmt is used as the format for a strftime call. |
473 | +#today_fmt = '%B %d, %Y' |
474 | + |
475 | +# List of patterns, relative to source directory, that match files and |
476 | +# directories to ignore when looking for source files. |
477 | +exclude_patterns = ['_build'] |
478 | + |
479 | +# The reST default role (used for this markup: `text`) to use for all |
480 | +# documents. |
481 | +#default_role = None |
482 | + |
483 | +# If true, '()' will be appended to :func: etc. cross-reference text. |
484 | +#add_function_parentheses = True |
485 | + |
486 | +# If true, the current module name will be prepended to all description |
487 | +# unit titles (such as .. function::). |
488 | +#add_module_names = True |
489 | + |
490 | +# If true, sectionauthor and moduleauthor directives will be shown in the |
491 | +# output. They are ignored by default. |
492 | +#show_authors = False |
493 | + |
494 | +# The name of the Pygments (syntax highlighting) style to use. |
495 | +pygments_style = 'sphinx' |
496 | + |
497 | +# A list of ignored prefixes for module index sorting. |
498 | +#modindex_common_prefix = [] |
499 | + |
500 | +# If true, keep warnings as "system message" paragraphs in the built documents. |
501 | +#keep_warnings = False |
502 | + |
503 | +# If true, `todo` and `todoList` produce output, else they produce nothing. |
504 | +todo_include_todos = False |
505 | + |
506 | + |
507 | +# -- Options for HTML output ---------------------------------------------- |
508 | + |
509 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
510 | +# a list of builtin themes. |
511 | +html_theme = 'alabaster' |
512 | + |
513 | +# Theme options are theme-specific and customize the look and feel of a theme |
514 | +# further. For a list of options available for each theme, see the |
515 | +# documentation. |
516 | +#html_theme_options = {} |
517 | + |
518 | +# Add any paths that contain custom themes here, relative to this directory. |
519 | +#html_theme_path = [] |
520 | + |
521 | +# The name for this set of Sphinx documents. If None, it defaults to |
522 | +# "<project> v<release> documentation". |
523 | +#html_title = None |
524 | + |
525 | +# A shorter title for the navigation bar. Default is the same as html_title. |
526 | +#html_short_title = None |
527 | + |
528 | +# The name of an image file (relative to this directory) to place at the top |
529 | +# of the sidebar. |
530 | +#html_logo = None |
531 | + |
532 | +# The name of an image file (relative to this directory) to use as a favicon of |
533 | +# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
534 | +# pixels large. |
535 | +#html_favicon = None |
536 | + |
537 | +# Add any paths that contain custom static files (such as style sheets) here, |
538 | +# relative to this directory. They are copied after the builtin static files, |
539 | +# so a file named "default.css" will overwrite the builtin "default.css". |
540 | +html_static_path = ['_static'] |
541 | + |
542 | +# Add any extra paths that contain custom files (such as robots.txt or |
543 | +# .htaccess) here, relative to this directory. These files are copied |
544 | +# directly to the root of the documentation. |
545 | +#html_extra_path = [] |
546 | + |
547 | +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
548 | +# using the given strftime format. |
549 | +#html_last_updated_fmt = '%b %d, %Y' |
550 | + |
551 | +# If true, SmartyPants will be used to convert quotes and dashes to |
552 | +# typographically correct entities. |
553 | +#html_use_smartypants = True |
554 | + |
555 | +# Custom sidebar templates, maps document names to template names. |
556 | +#html_sidebars = {} |
557 | + |
558 | +# Additional templates that should be rendered to pages, maps page names to |
559 | +# template names. |
560 | +#html_additional_pages = {} |
561 | + |
562 | +# If false, no module index is generated. |
563 | +#html_domain_indices = True |
564 | + |
565 | +# If false, no index is generated. |
566 | +#html_use_index = True |
567 | + |
568 | +# If true, the index is split into individual pages for each letter. |
569 | +#html_split_index = False |
570 | + |
571 | +# If true, links to the reST sources are added to the pages. |
572 | +#html_show_sourcelink = True |
573 | + |
574 | +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. |
575 | +#html_show_sphinx = True |
576 | + |
577 | +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. |
578 | +#html_show_copyright = True |
579 | + |
580 | +# If true, an OpenSearch description file will be output, and all pages will |
581 | +# contain a <link> tag referring to it. The value of this option must be the |
582 | +# base URL from which the finished HTML is served. |
583 | +#html_use_opensearch = '' |
584 | + |
585 | +# This is the file name suffix for HTML files (e.g. ".xhtml"). |
586 | +#html_file_suffix = None |
587 | + |
588 | +# Language to be used for generating the HTML full-text search index. |
589 | +# Sphinx supports the following languages: |
590 | +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' |
591 | +# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' |
592 | +#html_search_language = 'en' |
593 | + |
594 | +# A dictionary with options for the search language support, empty by default. |
595 | +# Now only 'ja' uses this config value |
596 | +#html_search_options = {'type': 'default'} |
597 | + |
598 | +# The name of a javascript file (relative to the configuration directory) that |
599 | +# implements a search results scorer. If empty, the default will be used. |
600 | +#html_search_scorer = 'scorer.js' |
601 | + |
602 | +# Output file base name for HTML help builder. |
603 | +htmlhelp_basename = 'YAMLTestsinSIESTAdoc' |
604 | + |
605 | +# -- Options for LaTeX output --------------------------------------------- |
606 | + |
607 | +latex_elements = { |
608 | +# The paper size ('letterpaper' or 'a4paper'). |
609 | +#'papersize': 'letterpaper', |
610 | + |
611 | +# The font size ('10pt', '11pt' or '12pt'). |
612 | +#'pointsize': '10pt', |
613 | + |
614 | +# Additional stuff for the LaTeX preamble. |
615 | +#'preamble': '', |
616 | + |
617 | +# Latex figure (float) alignment |
618 | +#'figure_align': 'htbp', |
619 | +} |
620 | + |
621 | +# Grouping the document tree into LaTeX files. List of tuples |
622 | +# (source start file, target name, title, |
623 | +# author, documentclass [howto, manual, or own class]). |
624 | +latex_documents = [ |
625 | + (master_doc, 'YAMLTestsinSIESTA.tex', 'YAML Tests in SIESTA Documentation', |
626 | + 'Yann Pouillon', 'manual'), |
627 | +] |
628 | + |
629 | +# The name of an image file (relative to this directory) to place at the top of |
630 | +# the title page. |
631 | +#latex_logo = None |
632 | + |
633 | +# For "manual" documents, if this is true, then toplevel headings are parts, |
634 | +# not chapters. |
635 | +#latex_use_parts = False |
636 | + |
637 | +# If true, show page references after internal links. |
638 | +#latex_show_pagerefs = False |
639 | + |
640 | +# If true, show URL addresses after external links. |
641 | +#latex_show_urls = False |
642 | + |
643 | +# Documents to append as an appendix to all manuals. |
644 | +#latex_appendices = [] |
645 | + |
646 | +# If false, no module index is generated. |
647 | +#latex_domain_indices = True |
648 | + |
649 | + |
650 | +# -- Options for manual page output --------------------------------------- |
651 | + |
652 | +# One entry per manual page. List of tuples |
653 | +# (source start file, name, description, authors, manual section). |
654 | +man_pages = [ |
655 | + (master_doc, 'yamltestsinsiesta', 'YAML Tests in SIESTA Documentation', |
656 | + [author], 1) |
657 | +] |
658 | + |
659 | +# If true, show URL addresses after external links. |
660 | +#man_show_urls = False |
661 | + |
662 | + |
663 | +# -- Options for Texinfo output ------------------------------------------- |
664 | + |
665 | +# Grouping the document tree into Texinfo files. List of tuples |
666 | +# (source start file, target name, title, author, |
667 | +# dir menu entry, description, category) |
668 | +texinfo_documents = [ |
669 | + (master_doc, 'YAMLTestsinSIESTA', 'YAML Tests in SIESTA Documentation', |
670 | + author, 'YAMLTestsinSIESTA', 'One line description of project.', |
671 | + 'Miscellaneous'), |
672 | +] |
673 | + |
674 | +# Documents to append as an appendix to all manuals. |
675 | +#texinfo_appendices = [] |
676 | + |
677 | +# If false, no module index is generated. |
678 | +#texinfo_domain_indices = True |
679 | + |
680 | +# How to display URL addresses: 'footnote', 'no', or 'inline'. |
681 | +#texinfo_show_urls = 'footnote' |
682 | + |
683 | +# If true, do not generate a @detailmenu in the "Top" node's menu. |
684 | +#texinfo_no_detailmenu = False |
685 | + |
686 | +# -- Further options ------------------------------------------------------ |
687 | +smartquotes = False |
688 | |
689 | === added file 'Docs/yaml_tests/implementation.rst' |
690 | --- Docs/yaml_tests/implementation.rst 1970-01-01 00:00:00 +0000 |
691 | +++ Docs/yaml_tests/implementation.rst 2018-05-30 08:59:05 +0000 |
692 | @@ -0,0 +1,65 @@ |
693 | +========================================== |
694 | +Implementation of the YAML variable dumper |
695 | +========================================== |
696 | + |
697 | +Changes in SIESTA |
698 | +----------------- |
699 | + |
700 | +The YAML variable dumper has been implemented in as an orthogonal way as |
701 | +possible from the rest of SIESTA. It consists in: |
702 | + |
703 | +- a Fortran module producing valid YAML 1.2, codename *m_io_yaml*; |
704 | +- the inclusion of the corresponding object file into the MAkefile of SIESTA; |
705 | +- a call to the main routine of the module, *siesta_write_yaml* at the end of |
706 | + *siesta.F*. |
707 | + |
708 | +The call to the I/O routine is both compatible with serial and parallel runs |
709 | +of SIESTA: |
710 | + |
711 | +.. code:: |
712 | + |
713 | + if (ionode) call siesta_write_yaml() |
714 | + |
715 | +This strategy is expected to be harmless to any other ongoing developments |
716 | +within SIESTA and allows to add the YAML output capability into already |
717 | +published versions of SIESTA. Patching such versions will indeed provide |
718 | +useful information on possible issues that were previously undetected. |
719 | + |
720 | +.. note:: |
721 | + |
722 | + Contrary to XML which has tags and attributes, YAML is just plain text |
723 | + using indenting (think of Python) to define data structures. As a |
724 | + consequence, emitting YAML does **not** introduce any additional dependency |
725 | + of SIESTA on another external library and is much easier to read by humans. |
726 | + |
727 | + |
728 | +Source code |
729 | +----------- |
730 | + |
731 | +The complete source code of the YAML dumper can be found in |
732 | +*~siesta/Src/m_io_yaml.F90*. The file is self-documented using the Doxygen |
733 | +format. |
734 | + |
735 | +.. note:: |
736 | + |
737 | + The Doxygen infrastructure is not merged yet... |
738 | + |
739 | + |
740 | +Documentation |
741 | +------------- |
742 | + |
743 | +To generate the Doxygen documentation, just run *doxygen* from the top |
744 | +source directory of SIESTA. The resulting files can then be found within the |
745 | +*~siesta/Docs/developers/* directory. |
746 | + |
747 | +To access the HTML website, look for *index.html* inside the *source/* |
748 | +subdirectory. To build the PDF manual, look at the *refman.tex* main document |
749 | +inside the *latex/* subdirectory. |
750 | + |
751 | +.. tip:: |
752 | + |
753 | + The provided *Doxyfile* has been tested with Doxygen 1.8.11. If you have an |
754 | + earlier version and experience crashes, just add the problematic files to |
755 | + the *EXCLUDE* variable within the *Doxyfile* and re-run doxygen. Repeat |
756 | + this procedure as many times as necessary. |
757 | + |
758 | |
759 | === added file 'Docs/yaml_tests/index.rst' |
760 | --- Docs/yaml_tests/index.rst 1970-01-01 00:00:00 +0000 |
761 | +++ Docs/yaml_tests/index.rst 2018-05-30 08:59:05 +0000 |
762 | @@ -0,0 +1,22 @@ |
763 | +.. YAML Tests in SIESTA documentation master file, created by |
764 | + sphinx-quickstart on Thu Jan 18 15:13:04 2018. |
765 | + You can adapt this file completely to your liking, but it should at least |
766 | + contain the root `toctree` directive. |
767 | + |
768 | +YAML Tests in SIESTA |
769 | +==================== |
770 | + |
771 | +.. toctree:: |
772 | + :maxdepth: 2 |
773 | + |
774 | + implementation.rst |
775 | + analysis.rst |
776 | + |
777 | + |
778 | +Indices and tables |
779 | +================== |
780 | + |
781 | +* :ref:`genindex` |
782 | +* :ref:`modindex` |
783 | +* :ref:`search` |
784 | + |
785 | |
786 | === modified file 'Src/Makefile' |
787 | --- Src/Makefile 2018-05-15 08:57:29 +0000 |
788 | +++ Src/Makefile 2018-05-30 08:59:05 +0000 |
789 | @@ -144,7 +144,7 @@ |
790 | setup_ordern_indexes.o\ |
791 | m_iodm.o m_iodm_old.o \ |
792 | m_filter.o \ |
793 | - m_io.o \ |
794 | + m_io.o m_io_yaml.o \ |
795 | m_timer.o \ |
796 | extrae_module.o extrae_eventllist.o\ |
797 | moreParallelSubs.o \ |
798 | @@ -839,6 +839,7 @@ |
799 | m_io.o: sys.o |
800 | m_io_s.o: class_OrbitalDistribution.o class_SpData1D.o class_SpData2D.o |
801 | m_io_s.o: class_Sparsity.o parallel.o precision.o |
802 | +m_io_yaml.o: m_energies.o precision.o version.o |
803 | m_iodm.o: class_OrbitalDistribution.o class_SpData2D.o class_Sparsity.o |
804 | m_iodm.o: m_io_s.o m_os.o parallel.o |
805 | m_iodm_old.o: alloc.o files.o m_matio.o m_mpi_utils.o parallel.o parallelsubs.o |
806 | @@ -1219,9 +1220,9 @@ |
807 | setup_ordern_indexes.o: alloc.o domain_decom.o parallel.o spatial.o |
808 | shaper.o: atmfuncs.o mneighb.o precision.o |
809 | show_distribution.o: atomlist.o parallel.o parallelsubs.o siesta_geom.o sys.o |
810 | -siesta.o: alloc.o extrae_module.o m_mpi_utils.o m_steps.o parallel.o |
811 | -siesta.o: siesta_analysis.o siesta_end.o siesta_forces.o siesta_init.o |
812 | -siesta.o: siesta_move.o |
813 | +siesta.o: alloc.o extrae_module.o m_io_yaml.o m_mpi_utils.o m_steps.o |
814 | +siesta.o: parallel.o siesta_analysis.o siesta_end.o siesta_forces.o |
815 | +siesta.o: siesta_init.o siesta_move.o |
816 | siesta2wannier90.o: files.o m_digest_nnkp.o m_spin.o m_trialorbitalclass.o |
817 | siesta2wannier90.o: parallel.o precision.o siesta_options.o sys.o |
818 | siesta_analysis.o: alloc.o atomlist.o bands.o basis_enthalpy.o dhscf.o files.o |
819 | |
820 | === added file 'Src/m_io_yaml.F90' |
821 | --- Src/m_io_yaml.F90 1970-01-01 00:00:00 +0000 |
822 | +++ Src/m_io_yaml.F90 2018-05-30 08:59:05 +0000 |
823 | @@ -0,0 +1,215 @@ |
824 | +!> \brief YAML output of SIESTA variables for external post-processors. |
825 | +!! |
826 | +!! This module provides facilities to output SIESTA variables into a YAML |
827 | +!! file at the end of a run. |
828 | +!! |
829 | +!! Variables are dumped in YAML format to provide structured data that |
830 | +!! can be read partially or fully, in any order, at the option of the user. |
831 | +!! |
832 | +!! The resulting output can be processed in C/C++ using LibYAML (found at |
833 | +!! https://github.com/yaml/libyaml), in Python through the ruamel.yaml |
834 | +!! package (found at https://pypi.python.org/pypi/ruamel.yaml), and in Perl |
835 | +!! thanks to the YAML::XS module (found at |
836 | +!! http://search.cpan.org/~tinita/YAML-LibYAML-0.69/lib/YAML/XS.pod). |
837 | +!! |
838 | +!! \author Yann Pouillon |
839 | +!! \date 2017-2018 |
840 | +!! \copyright GNU General Public License version 3 |
841 | +!! |
842 | +!! \note The interest of using the YAML format is that output can be achieved |
843 | +!! without introducing new external dependencies. |
844 | +!! |
845 | +module m_io_yaml |
846 | + |
847 | + use precision, only: dp |
848 | + |
849 | + implicit none |
850 | + |
851 | + private |
852 | + |
853 | + ! Ensure compliance with the YAML 1.2 file format |
854 | + character(len=*), parameter :: CH10 = achar(10) !< New line |
855 | + character(len=*), parameter :: CH34 = achar(34) !< Double quote |
856 | + character(len=*), parameter :: YAML_HEADER = "%YAML 1.2"//CH10//"---"//CH10 |
857 | + character(len=*), parameter :: YAML_FOOTER = CH10//"..." |
858 | + |
859 | + public :: siesta_write_yaml |
860 | + |
861 | +contains |
862 | + |
863 | + !> \brief Creates a YAML file containing SIESTA build parameters and |
864 | + !! final energy values. |
865 | + !! |
866 | + !! This routine calls io_assign() to get a free unit number and outputs |
867 | + !! valid YAML data structures into the associated OUTVARS.yml file. The |
868 | + !! data consists in two dictionaries: |
869 | + !! - siesta: build parameters and status of optional features; |
870 | + !! - energies: full decomposition of the total energy, using exactly |
871 | + !! the same naming conventions as in the \ref m_energies module. |
872 | + !! |
873 | + !! The resulting file can easily be parsed using the ruamel.yaml Python |
874 | + !! module. |
875 | + !! |
876 | + !! \todo Output forces and stress tensor. |
877 | + subroutine siesta_write_yaml() |
878 | + |
879 | + use m_energies |
880 | + use version_info |
881 | + |
882 | + implicit none |
883 | + |
884 | + logical :: trigger |
885 | + integer :: ierr, yaml_fd |
886 | + |
887 | + ! Open YAML document |
888 | + call io_assign(yaml_fd) |
889 | + open(unit=yaml_fd, file='OUTVARS.yml', status='new', action='write', & |
890 | +& access='sequential', form='formatted', iostat=ierr) |
891 | + ! FIXME: Find out why the system sometines reports a failure while things |
892 | + ! have gone perfectly well. |
893 | + !if ( ierr .ne. 0 ) call die('could not open OUTVARS.yml') |
894 | + write(unit=yaml_fd, fmt='(A)') YAML_HEADER |
895 | + |
896 | + ! Dump SIESTA information |
897 | + write(unit=yaml_fd, fmt='(A)') "siesta:" |
898 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "version", & |
899 | +& CH34, trim(adjustl(version_str)), CH34 |
900 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "arch", & |
901 | +& CH34, trim(adjustl(siesta_arch)), CH34 |
902 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "compiler", & |
903 | +& CH34, trim(adjustl(compiler_version)), CH34 |
904 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "fflags", & |
905 | +& CH34, trim(adjustl(fflags)), CH34 |
906 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "fppflags", & |
907 | +& CH34, trim(adjustl(fppflags)), CH34 |
908 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "libs", & |
909 | +& CH34, trim(adjustl(libs)), CH34 |
910 | +#ifdef MPI |
911 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "build", & |
912 | +& CH34, "mpi", CH34 |
913 | +#else |
914 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "build", & |
915 | +& CH34, "serial", CH34 |
916 | +#endif |
917 | +#ifdef _OPENMP |
918 | + trigger = .true. |
919 | +#else |
920 | + trigger = .false. |
921 | +#endif |
922 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "openmp", & |
923 | +& CH34, trim(yesno(trigger)), CH34 |
924 | +#ifdef USE_GEMM3M |
925 | + trigger = .true. |
926 | +#else |
927 | + trigger = .false. |
928 | +#endif |
929 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "gemm3m", & |
930 | +& CH34, trim(yesno(trigger)), CH34 |
931 | +#ifdef CDF |
932 | + trigger = .true. |
933 | +#else |
934 | + trigger = .false. |
935 | +#endif |
936 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "netcdf", & |
937 | +& CH34, trim(yesno(trigger)), CH34 |
938 | +#ifdef NCDF_4 |
939 | + trigger = .true. |
940 | +#else |
941 | + trigger = .false. |
942 | +#endif |
943 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "netcdf4", & |
944 | +& CH34, trim(yesno(trigger)), CH34 |
945 | +#ifdef NCDF_PARALLEL |
946 | + trigger = .true. |
947 | +#else |
948 | + trigger = .false. |
949 | +#endif |
950 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "netcdf4_mpi", & |
951 | +& CH34, trim(yesno(trigger)), CH34 |
952 | +#if defined(ON_DOMAIN_DECOMP) || defined(SIESTA__METIS) |
953 | + trigger = .true. |
954 | +#else |
955 | + trigger = .false. |
956 | +#endif |
957 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "metis", & |
958 | +& CH34, trim(yesno(trigger)), CH34 |
959 | +#ifdef SIESTA__CHESS |
960 | + trigger = .true. |
961 | +#else |
962 | + trigger = .false. |
963 | +#endif |
964 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "chess", & |
965 | +& CH34, trim(yesno(trigger)), CH34 |
966 | +#ifdef SIESTA__ELPA |
967 | + trigger = .true. |
968 | +#else |
969 | + trigger = .false. |
970 | +#endif |
971 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "elpa", & |
972 | +& CH34, trim(yesno(trigger)), CH34 |
973 | +#ifdef SIESTA__FLOOK |
974 | + trigger = .true. |
975 | +#else |
976 | + trigger = .false. |
977 | +#endif |
978 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "flook", & |
979 | +& CH34, trim(yesno(trigger)), CH34 |
980 | +#ifdef SIESTA__PEXSI |
981 | + trigger = .true. |
982 | +#else |
983 | + trigger = .false. |
984 | +#endif |
985 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,3(A))') "pexsi", & |
986 | +& CH34, trim(yesno(trigger)), CH34 |
987 | + |
988 | + ! Dump energies |
989 | + write(unit=yaml_fd, fmt='(A,A)') CH10, "energies:" |
990 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Ebs", Ebs |
991 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Eions", Eions |
992 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Ena", Ena |
993 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Ekin", Ekin |
994 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Enl", Enl |
995 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Eso", Eso |
996 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Eldau", Eldau |
997 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "DEna", DEna |
998 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "DUscf", DUscf |
999 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "DUext", DUext |
1000 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Enegf", DE_NEGF |
1001 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Exc", Exc |
1002 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Ecorrec", Ecorrec |
1003 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Emadel", Emad |
1004 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Emeta", Emeta |
1005 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Emolmec", Emm |
1006 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Ekinion", Ekinion |
1007 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Eharris", Eharrs+Ekinion |
1008 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "Etot", Etot+Ekinion |
1009 | + write(unit=yaml_fd, fmt='(2X,A,":",1X,E24.8)') "FreeEng", FreeE+Ekinion |
1010 | + |
1011 | + ! Close YAML document |
1012 | + write(unit=yaml_fd, fmt='(A)') YAML_FOOTER |
1013 | + call io_close(yaml_fd) |
1014 | + |
1015 | + end subroutine siesta_write_yaml |
1016 | + |
1017 | + !> \brief Internal function to translate booleans into "yes"/"no" strings. |
1018 | + !! |
1019 | + !! This function takes a boolean condition as input and returns a string |
1020 | + !! corresponding to the boolean value. |
1021 | + !! |
1022 | + !! \param[in] cond: boolean condition |
1023 | + !! \return string equal to "yes" for .true., and "no" for .false. |
1024 | + function yesno(cond) result(word) |
1025 | + |
1026 | + logical, intent(in) :: cond |
1027 | + |
1028 | + character(len=3) :: word |
1029 | + |
1030 | + if ( cond ) then |
1031 | + word = "yes" |
1032 | + else |
1033 | + word = "no " |
1034 | + end if |
1035 | + |
1036 | + end function yesno |
1037 | + |
1038 | +end module m_io_yaml |
1039 | |
1040 | === modified file 'Src/siesta.F' |
1041 | --- Src/siesta.F 2016-08-10 11:29:54 +0000 |
1042 | +++ Src/siesta.F 2018-05-30 08:59:05 +0000 |
1043 | @@ -25,6 +25,7 @@ |
1044 | #ifdef TRACING_SOLVEONLY |
1045 | use extrae_module |
1046 | #endif |
1047 | + use m_io_yaml, only: siesta_write_yaml |
1048 | |
1049 | implicit none |
1050 | |
1051 | @@ -91,6 +92,8 @@ |
1052 | if (ionode) call memory_snapshot("after siesta_analysis") |
1053 | #endif |
1054 | |
1055 | + if (ionode) call siesta_write_yaml() |
1056 | + |
1057 | call siesta_end() |
1058 | #ifdef SIESTA__PEXSI |
1059 | if (ionode) call memory_snapshot("at end of program") |
1060 | |
1061 | === added file 'Tests/Scripts/yaml_compare.py' |
1062 | --- Tests/Scripts/yaml_compare.py 1970-01-01 00:00:00 +0000 |
1063 | +++ Tests/Scripts/yaml_compare.py 2018-05-30 08:59:05 +0000 |
1064 | @@ -0,0 +1,303 @@ |
1065 | +#!/usr/bin/env python3 |
1066 | + |
1067 | +from __future__ import print_function |
1068 | + |
1069 | +import argparse |
1070 | +import os |
1071 | +import sys |
1072 | + |
1073 | +from time import gmtime, strftime |
1074 | +from ruamel.yaml import YAML |
1075 | +try: |
1076 | + from termcolor import colored |
1077 | +except ImportError: |
1078 | + sys.stderr.write("Warning: The termcolor package is unavailable\n") |
1079 | + sys.stderr.write(" The --fancy option will be ignored\n") |
1080 | + def colored(text, fgcolor, bgcolor=None, **kwargs): |
1081 | + return text |
1082 | + |
1083 | + |
1084 | + # ------------------------------------ # |
1085 | + |
1086 | + |
1087 | +# Color attributes for colorized reports |
1088 | +fancy_color = { |
1089 | + "????": ["grey", "on_yellow", "bold,dark"], |
1090 | + "enfl": ["grey", "on_yellow", "bold,dark"], |
1091 | + "eout": ["yellow", "on_red", "bold"], |
1092 | + "eref": ["white", "on_red", "bold"], |
1093 | + "etol": ["yellow", None, "bold"], |
1094 | + "xtfl": ["yellow", "on_green", "bold"], |
1095 | + "pass": ["green", None, "bold"], |
1096 | + "skip": ["grey", None, "bold"], |
1097 | +} |
1098 | + |
1099 | +# Test status formatter for both BW and color reports |
1100 | +def fancy_status(stat_str, colorize=False): |
1101 | + |
1102 | + # Maximum status length is 4 |
1103 | + if ( len(stat_str) >= 4 ): |
1104 | + fancy_str = stat_str[0:4] |
1105 | + else: |
1106 | + fancy_str = stat_str |
1107 | + |
1108 | + # Minimum status length is 4 |
1109 | + if ( len(fancy_str) == 0 ): |
1110 | + fancy_str = "????" |
1111 | + if ( len(fancy_str) <= 3 ): |
1112 | + fancy_str += " " |
1113 | + if ( len(fancy_str) <= 3 ): |
1114 | + fancy_str = " " + fancy_str |
1115 | + if ( len(fancy_str) <= 3 ): |
1116 | + fancy_str += " " |
1117 | + |
1118 | + # Colorize output when requested |
1119 | + if ( colorize ): |
1120 | + if ( fancy_str in fancy_color ): |
1121 | + fgcolor, bgcolor, deco = fancy_color[fancy_str] |
1122 | + if ( len(deco) > 0 ): |
1123 | + deco = deco.split(",") |
1124 | + else: |
1125 | + deco = [] |
1126 | + else: |
1127 | + fgcolor = "yellow" |
1128 | + bgcolor = "on_blue", |
1129 | + deco = ["bold"] |
1130 | + if ( bgcolor ): |
1131 | + fancy_str = colored(fancy_str.upper(), fgcolor, bgcolor, attrs=deco) |
1132 | + else: |
1133 | + fancy_str = colored(fancy_str.upper(), fgcolor, attrs=["bold"]) |
1134 | + fancy_str = colored("[", "white") + fancy_str + colored("]", "white") |
1135 | + else: |
1136 | + fancy_str = "[" + fancy_str.upper() + "]" |
1137 | + |
1138 | + return fancy_str |
1139 | + |
1140 | + |
1141 | + # ------------------------------------ # |
1142 | + |
1143 | + |
1144 | +# Process command-line arguments |
1145 | +parser = argparse.ArgumentParser( |
1146 | + description="Checks SIESTA test results against references") |
1147 | +parser.add_argument("-a", "--abs-tol", type=float, default=1.0e-7, |
1148 | + help="Absolute tolerance for comparisons (overrides configuration)") |
1149 | +parser.add_argument("-c", "--config", default="siesta-testsuite.yml", |
1150 | + help="Config file containing the SIESTA test suite specifications") |
1151 | +parser.add_argument("-d", "--details", action="store_true", default=False, |
1152 | + help="Display detailed information about each test") |
1153 | +parser.add_argument("-f", "--fancy", action="store_true", default=False, |
1154 | + help="Print fancy colorized report (for terminals supporting it)") |
1155 | +parser.add_argument("-o", "--output", default="tests-report.yml", |
1156 | + help="File to store a YAML version of the report with full details") |
1157 | +parser.add_argument("-r", "--refdir", default="YAML_Refs", |
1158 | + help="Directory containing reference YAML files") |
1159 | +parser.add_argument("-t", "--testdir", default=".", |
1160 | + help="Directory containing the test cases with their outputs") |
1161 | +parser.add_argument("-y", "--yaml", default=os.path.join("work", "OUTVARS.yml"), |
1162 | + help="Relative path where each test stores its YAML data") |
1163 | +args = parser.parse_args() |
1164 | + |
1165 | +# Check command-line arguments |
1166 | +if ( not os.path.exists(args.config) ): |
1167 | + parser.error("config file not found: '%s'" % args.config) |
1168 | +if ( not os.path.isdir(args.refdir) ): |
1169 | + parser.error("reference directory not found: '%s'" % args.refdir) |
1170 | +if ( not os.path.isdir(args.testdir) ): |
1171 | + parser.error("tests directory not found: '%s'" % args.testdir) |
1172 | + |
1173 | +# Banner |
1174 | +print("""\ |
1175 | +======================================== |
1176 | +Summary of the SIESTA Test Suite results |
1177 | +======================================== |
1178 | + |
1179 | +Introduction |
1180 | +------------ |
1181 | + |
1182 | +Each relevant test case of the SIESTA Test Suite has been run and its results |
1183 | +compared to a reference file. |
1184 | + |
1185 | +In the following, the result of each comparison is represented in a compact |
1186 | +way at the beginning of each line through a 4-letter keyword surrounded by |
1187 | +square brackets. It is followed by a description of the correpsonding test, |
1188 | +condensed by default, verbose if requested. |
1189 | + |
1190 | +Here is the meaning of each keyword: |
1191 | + |
1192 | +- ENFL: The test case succeeded while it was expected to fail. |
1193 | +- EOUT: Error reading YAML output file of the test case. |
1194 | +- EREF: Error reading YAML reference file of the test case. |
1195 | +- ETOL: Some values are beyond permitted tolerances. |
1196 | +- PASS: The test case meets all requirements. |
1197 | +- SKIP: The test case has not been executed. |
1198 | +- XTFL: The test failed as expected. |
1199 | + |
1200 | +A test is successful only if its result is "PASS". |
1201 | + |
1202 | +A report with full details of the tests is stored in the output file listed |
1203 | +below in YAML format. |
1204 | + |
1205 | + |
1206 | +Test suite parameters |
1207 | +--------------------- |
1208 | + |
1209 | +The test comparison script has been run with the following parameters: |
1210 | + |
1211 | +- Workdir : %s |
1212 | +- Configuration : %s |
1213 | +- Reference dir : %s |
1214 | +- Test dir : %s |
1215 | +- Output file : %s |
1216 | + |
1217 | + |
1218 | +Results |
1219 | +------- |
1220 | +""" % (os.getcwd(), args.config, args.refdir, args.testdir, args.output)) |
1221 | + |
1222 | +# Load global configuration |
1223 | +yaml_doc = YAML() |
1224 | +yaml_cfg = {"tests": []} |
1225 | +with open(args.config, "r") as cfg_file: |
1226 | + yaml_cfg = yaml_doc.load(cfg_file) |
1227 | + |
1228 | +# Perform test comparisons |
1229 | +siesta_tests = [] |
1230 | +siesta_index = {} |
1231 | +siesta_xfail = [] |
1232 | +for tcase in yaml_cfg["tests"]: |
1233 | + |
1234 | + # Init |
1235 | + siesta_index[tcase["name"]] = len(siesta_tests) |
1236 | + siesta_tests.append({"name": tcase["name"], "title": tcase["title"]}) |
1237 | + if ( ("fail_expect" in tcase) and (tcase["fail_expect"] == "yes") ): |
1238 | + siesta_xfail.append(tcase["name"]) |
1239 | + |
1240 | + # Check that test reference exists |
1241 | + ref_path = os.path.join(args.refdir, "%s.yml" % tcase["name"]) |
1242 | + if ( not os.path.exists(ref_path) ): |
1243 | + siesta_tests[-1]["result"] = "eref" |
1244 | + siesta_tests[-1]["message"] = "missing reference file" |
1245 | + continue |
1246 | + |
1247 | + # Load test reference |
1248 | + yaml_doc = YAML() |
1249 | + with open(ref_path, "r") as ref_file: |
1250 | + yaml_ref = yaml_doc.load(ref_file) |
1251 | + |
1252 | + # Check that test output exists |
1253 | + out_path = os.path.join(args.testdir, tcase["name"], args.yaml) |
1254 | + if ( not os.path.exists(out_path) ): |
1255 | + siesta_tests[-1]["result"] = "eout" |
1256 | + siesta_tests[-1]["message"] = "missing output file" |
1257 | + continue |
1258 | + |
1259 | + # Load test output |
1260 | + yaml_doc = YAML() |
1261 | + with open(out_path, "r") as out_file: |
1262 | + yaml_out = yaml_doc.load(out_file) |
1263 | + |
1264 | + # Compare energies |
1265 | + siesta_tests[-1]["tolerances"] = {} |
1266 | + ref_vars = yaml_ref["energies"] |
1267 | + out_vars = yaml_out["energies"] |
1268 | + tc_good = [] |
1269 | + tc_fail = [] |
1270 | + tc_skip = [] |
1271 | + for (key, val) in ref_vars.items(): |
1272 | + if ( ("tolerances" in tcase.keys()) and (key in tcase["tolerances"]) ): |
1273 | + tc_tol = tcase["tolerances"][key] |
1274 | + elif ( key in yaml_cfg["tolerances"] ): |
1275 | + tc_tol = yaml_cfg["tolerances"][key] |
1276 | + else: |
1277 | + tc_tol = args.abs_tol |
1278 | + siesta_tests[-1]["tolerances"][key] = tc_tol |
1279 | + |
1280 | + if ( (key in out_vars) and (abs(out_vars[key] - val) < tc_tol) ): |
1281 | + tc_good.append(key) |
1282 | + else: |
1283 | + tc_fail.append( |
1284 | + {"name": key, "value": out_vars[key], "expected": val}) |
1285 | + |
1286 | + # Store comparison results |
1287 | + tc_skip = sorted([item for item in out_vars.keys() if not item in ref_vars.keys()]) |
1288 | + siesta_tests[-1]["good"] = tc_good |
1289 | + siesta_tests[-1]["fail"] = tc_fail |
1290 | + siesta_tests[-1]["skip"] = tc_skip |
1291 | + |
1292 | + # Store final test result |
1293 | + if ( len(tc_fail) == 0 ): |
1294 | + siesta_tests[-1]["result"] = "pass" |
1295 | + siesta_tests[-1]["message"] = "all values within tolerance" |
1296 | + else: |
1297 | + siesta_tests[-1]["result"] = "etol" |
1298 | + siesta_tests[-1]["message"] = "some values beyond tolerance" |
1299 | + |
1300 | +# Write down full report |
1301 | +yaml_doc = YAML() |
1302 | +yaml_doc.default_flow_style=False |
1303 | +yaml_doc.indent(mapping=4, sequence=4, offset=2) |
1304 | +report = {"siesta_tests": siesta_tests, |
1305 | + "defaults": {"tolerance": args.abs_tol}} |
1306 | +with open(args.output, "w") as rep_file: |
1307 | + rep_file.write("%YAML 1.2\n---\n\n") |
1308 | + yaml_doc.dump(report, rep_file) |
1309 | + rep_file.write("\n...\n") |
1310 | + |
1311 | +# Display test results |
1312 | +for tcase in siesta_tests: |
1313 | + |
1314 | + if ( tcase["name"] in siesta_xfail ): |
1315 | + if ( tcase["result"] == "pass" ): |
1316 | + tcase["result"] = "enfl" |
1317 | + else: |
1318 | + tcase["result"] = "xtfl" |
1319 | + tcase["message"] += " (expected to fail)" |
1320 | + |
1321 | + if ( not args.details ): |
1322 | + titlen = 65 - len(tcase["name"]) |
1323 | + if ( len(tcase["title"]) > titlen ): |
1324 | + tcase["title"] = tcase["title"][:titlen] + "..." |
1325 | + |
1326 | + if ( args.fancy ): |
1327 | + tcase["name"] = colored(tcase["name"], "white", attrs=["bold"]) |
1328 | + tcase["title"] = colored(tcase["title"], "white", attrs=["dark"]) |
1329 | + |
1330 | + print("-", fancy_status(tcase["result"], args.fancy), tcase["name"], |
1331 | + "> %s" % tcase["title"]) |
1332 | + |
1333 | + if ( args.details ): |
1334 | + if ( not tcase["result"] in ["eout", "eref"] ): |
1335 | + print("") |
1336 | + print(" - Energies/good: %s", tcase["good"]) |
1337 | + print(" - Energies/fail: %s", tcase["fail"]) |
1338 | + print(" - Energies/skip: %s", tcase["skip"]) |
1339 | + print("") |
1340 | + |
1341 | +# Display statistics |
1342 | +ntests = len(siesta_tests) |
1343 | +ntpass = len([tcase for tcase in siesta_tests if tcase["result"] == "pass"]) |
1344 | +print("""\ |
1345 | + |
1346 | + |
1347 | +Statistics |
1348 | +---------- |
1349 | + |
1350 | +Global results of the test suite: |
1351 | + |
1352 | +- number of tests : %4d |
1353 | +- successful tests : %4d (%5.1f%%) |
1354 | +- failed tests : %4d (%5.1f%%) |
1355 | + |
1356 | +""" % (ntests, ntpass, ntpass*100.0/ntests, ntests-ntpass, (ntests-ntpass)*100.0/ntests)) |
1357 | + |
1358 | +# Display footer |
1359 | +print("""\ |
1360 | +.. note:: |
1361 | + |
1362 | + This report is valid ReStructuredText, unless you ask for colorized output. |
1363 | + You can render it in HTML, PDF and other formats using the Docutils package. |
1364 | + Please consult `http://docutils.sourceforge.net/`_ for details. |
1365 | + |
1366 | +Document generated on %s (UTC). |
1367 | +""" % strftime("%Y/%m/%d %H:%M:%S +0000",gmtime())) |
1368 | |
1369 | === added directory 'Tests/YAML_Refs' |
1370 | === added file 'Tests/YAML_Refs/benzene.yml' |
1371 | --- Tests/YAML_Refs/benzene.yml 1970-01-01 00:00:00 +0000 |
1372 | +++ Tests/YAML_Refs/benzene.yml 2018-05-30 08:59:05 +0000 |
1373 | @@ -0,0 +1,45 @@ |
1374 | +%YAML 1.2 |
1375 | +--- |
1376 | + |
1377 | +siesta: |
1378 | + version: "siesta-4.1--920" |
1379 | + arch: "gfortran-macosx64-openmpi" |
1380 | + compiler: "GNU Fortran (Homebrew GCC 7.2.0) 7.2.0" |
1381 | + fflags: "mpif90 -O2 -fbacktrace -g" |
1382 | + fppflags: "-DCDF -DMPI -DMPI_TIMING -DF2003" |
1383 | + libs: "-L/usr/local/lib -lnetcdff -L/opt/scalapack/openmpi-2.1.2--gfortran-7.2.0/liib -lscalapack -lveclibfort" |
1384 | + build: "mpi" |
1385 | + openmp: "no" |
1386 | + transiesta: "no" |
1387 | + gemm3m: "no" |
1388 | + netcdf: "yes" |
1389 | + netcdf4: "no" |
1390 | + netcdf4_mpi: "no" |
1391 | + metis: "no" |
1392 | + chess: "no" |
1393 | + elpa: "no" |
1394 | + flook: "no" |
1395 | + pexsi: "no" |
1396 | + |
1397 | +energies: |
1398 | + Ebs: -0.26343244E+02 |
1399 | + Eions: 0.11862249E+03 |
1400 | + Ena: 0.25019919E+02 |
1401 | + Ekin: 0.53830442E+02 |
1402 | + Enl: -0.87719378E+01 |
1403 | + Eso: 0.00000000E+00 |
1404 | + Eldau: 0.00000000E+00 |
1405 | + DEna: -0.24939449E+01 |
1406 | + DUscf: 0.27876148E+00 |
1407 | + DUext: 0.00000000E+00 |
1408 | + Exc: -0.24492164E+02 |
1409 | + Ecorrec: 0.00000000E+00 |
1410 | + Emadel: 0.00000000E+00 |
1411 | + Emeta: 0.00000000E+00 |
1412 | + Emolmec: 0.00000000E+00 |
1413 | + Ekinion: 0.00000000E+00 |
1414 | + Eharris: -0.75251411E+02 |
1415 | + Etot: -0.75251411E+02 |
1416 | + FreeEng: -0.75251411E+02 |
1417 | + |
1418 | +... |
1419 | |
1420 | === added file 'Tests/YAML_Refs/h2o.yml' |
1421 | --- Tests/YAML_Refs/h2o.yml 1970-01-01 00:00:00 +0000 |
1422 | +++ Tests/YAML_Refs/h2o.yml 2018-05-30 08:59:05 +0000 |
1423 | @@ -0,0 +1,45 @@ |
1424 | +%YAML 1.2 |
1425 | +--- |
1426 | + |
1427 | +siesta: |
1428 | + version: "siesta-4.1--920" |
1429 | + arch: "gfortran-macosx64-openmpi" |
1430 | + compiler: "GNU Fortran (Homebrew GCC 7.2.0) 7.2.0" |
1431 | + fflags: "mpif90 -O2 -fbacktrace -g" |
1432 | + fppflags: "-DCDF -DMPI -DMPI_TIMING -DF2003" |
1433 | + libs: "-L/usr/local/lib -lnetcdff -L/opt/scalapack/openmpi-2.1.2--gfortran-7.2.0/liib -lscalapack -lveclibfort" |
1434 | + build: "mpi" |
1435 | + openmp: "no" |
1436 | + transiesta: "no" |
1437 | + gemm3m: "no" |
1438 | + netcdf: "yes" |
1439 | + netcdf4: "no" |
1440 | + netcdf4_mpi: "no" |
1441 | + metis: "no" |
1442 | + chess: "no" |
1443 | + elpa: "no" |
1444 | + flook: "no" |
1445 | + pexsi: "no" |
1446 | + |
1447 | +energies: |
1448 | + Ebs: -0.76982627E+01 |
1449 | + Eions: 0.59963727E+02 |
1450 | + Ena: 0.12873605E+02 |
1451 | + Ekin: 0.25782413E+02 |
1452 | + Enl: -0.45540719E+01 |
1453 | + Eso: 0.00000000E+00 |
1454 | + Eldau: 0.00000000E+00 |
1455 | + DEna: -0.13095670E+00 |
1456 | + DUscf: 0.53468305E-01 |
1457 | + DUext: 0.00000000E+00 |
1458 | + Exc: -0.82990075E+01 |
1459 | + Ecorrec: 0.00000000E+00 |
1460 | + Emadel: 0.00000000E+00 |
1461 | + Emeta: 0.00000000E+00 |
1462 | + Emolmec: 0.00000000E+00 |
1463 | + Ekinion: 0.00000000E+00 |
1464 | + Eharris: -0.34238277E+02 |
1465 | + Etot: -0.34238277E+02 |
1466 | + FreeEng: -0.34238277E+02 |
1467 | + |
1468 | +... |
1469 | |
1470 | === added file 'Tests/YAML_Refs/mno_ldau.yml' |
1471 | --- Tests/YAML_Refs/mno_ldau.yml 1970-01-01 00:00:00 +0000 |
1472 | +++ Tests/YAML_Refs/mno_ldau.yml 2018-05-30 08:59:05 +0000 |
1473 | @@ -0,0 +1,45 @@ |
1474 | +%YAML 1.2 |
1475 | +--- |
1476 | + |
1477 | +siesta: |
1478 | + version: "siesta-4.1--920" |
1479 | + arch: "gfortran-macosx64-openmpi" |
1480 | + compiler: "GNU Fortran (Homebrew GCC 7.2.0) 7.2.0" |
1481 | + fflags: "mpif90 -O2 -fbacktrace -g" |
1482 | + fppflags: "-DCDF -DMPI -DMPI_TIMING -DF2003" |
1483 | + libs: "-L/usr/local/lib -lnetcdff -L/opt/scalapack/openmpi-2.1.2--gfortran-7.2.0/liib -lscalapack -lveclibfort" |
1484 | + build: "mpi" |
1485 | + openmp: "no" |
1486 | + transiesta: "no" |
1487 | + gemm3m: "no" |
1488 | + netcdf: "yes" |
1489 | + netcdf4: "no" |
1490 | + netcdf4_mpi: "no" |
1491 | + metis: "no" |
1492 | + chess: "no" |
1493 | + elpa: "no" |
1494 | + flook: "no" |
1495 | + pexsi: "no" |
1496 | + |
1497 | +energies: |
1498 | + Ebs: -0.73133469E+01 |
1499 | + Eions: 0.97990361E+02 |
1500 | + Ena: 0.14292867E+02 |
1501 | + Ekin: 0.73606487E+02 |
1502 | + Enl: -0.31590480E+02 |
1503 | + Eso: 0.00000000E+00 |
1504 | + Eldau: 0.39836046E-01 |
1505 | + DEna: -0.15678393E+01 |
1506 | + DUscf: 0.10598631E+00 |
1507 | + DUext: 0.00000000E+00 |
1508 | + Exc: -0.33376425E+02 |
1509 | + Ecorrec: 0.00000000E+00 |
1510 | + Emadel: 0.00000000E+00 |
1511 | + Emeta: 0.00000000E+00 |
1512 | + Emolmec: 0.00000000E+00 |
1513 | + Ekinion: 0.00000000E+00 |
1514 | + Eharris: -0.76479929E+02 |
1515 | + Etot: -0.76479929E+02 |
1516 | + FreeEng: -0.76480129E+02 |
1517 | + |
1518 | +... |
1519 | |
1520 | === added file 'Tests/siesta-testsuite.yml' |
1521 | --- Tests/siesta-testsuite.yml 1970-01-01 00:00:00 +0000 |
1522 | +++ Tests/siesta-testsuite.yml 2018-05-30 08:59:05 +0000 |
1523 | @@ -0,0 +1,258 @@ |
1524 | +%YAML 1.2 |
1525 | +--- |
1526 | + |
1527 | +# Default test parameters: |
1528 | +# |
1529 | +# - category : basic = "just run SIESTA", advanced = "complex workflow" |
1530 | +# - fail_allow : whether it is OK for a test to fail |
1531 | +# - fail_expect: whether a test is expected to fail (new feature development) |
1532 | +# - program : executable program to run |
1533 | +# - timeout : maximum run time allowed (in case the program hangs) |
1534 | +# |
1535 | +# All these parameters can be overridden individually for each test. |
1536 | +# |
1537 | +defaults: |
1538 | + category: basic |
1539 | + fail_allow: no |
1540 | + fail_expect: no |
1541 | + program: siesta |
1542 | + timeout: 300 |
1543 | + |
1544 | +# Term-wise tolerances (can be overridden individually for each test) |
1545 | +# Note: the following values were imported from ~siesta/Tests/tolerances.dat |
1546 | +tolerances: |
1547 | + DEna: 0.015 |
1548 | + DUscf: 0.001 |
1549 | + Eharris: 0.003 |
1550 | + Ekin: 0.017 |
1551 | + Ena: 0.003 |
1552 | + Enl: 0.005 |
1553 | + Etot: 0.003 |
1554 | + Exc: 0.003 |
1555 | + FreeEng: 0.005 |
1556 | + Uscf: 0.015 |
1557 | + |
1558 | +# Specifications for each test case: |
1559 | +# |
1560 | +# - auxdata : auxilliary files needed by the test |
1561 | +# - name : short name for the test (should match the test directory name) |
1562 | +# - title : one-sentence description of the test |
1563 | +# - triggers: optional SIESTA features (see the "siesta" section of any |
1564 | +# OUTVARS.yml file) |
1565 | +# |
1566 | +# The "name" and "title" fields are mandatory. The rest is optional. |
1567 | +# |
1568 | +tests: |
1569 | + - name: "32_h2o" |
1570 | + title: "32 water molecules for simplex minimization" |
1571 | + - name: "ag" |
1572 | + title: "Untitled" |
1573 | + - name: "ar2_vdw" |
1574 | + title: "Unconverged optimization of the Argon dimer with vdW-DF" |
1575 | + - name: "batio3" |
1576 | + title: "Barium titanate cubic structure" |
1577 | + - name: "benzene" |
1578 | + title: "Benzene molecule" |
1579 | + - name: "bessel" |
1580 | + title: "Water molecule with Bessel orbitals" |
1581 | + - name: "born" |
1582 | + title: "Untitled" |
1583 | + auxdata: ["FC.fdf"] |
1584 | + - name: "born_spin" |
1585 | + title: "Untitled" |
1586 | + auxdata: ["FC.fdf"] |
1587 | + - name: "carbon_nanoscroll" |
1588 | + title: "80-5-20 carbon nanoscroll" |
1589 | + - name: "ch4" |
1590 | + title: "FCC Methane with vdW pre-packaged molecules" |
1591 | + - name: "chargeconf-h2o" |
1592 | + title: "Water molecule with charge confinement" |
1593 | + - name: "constant_volume" |
1594 | + title: "MgCO3 SZ in variable primitive cell with constant volume" |
1595 | + - name: "dipole_correction" |
1596 | + title: "Automatic dipole correction of a layer of water molecules" |
1597 | + - name: "fe" |
1598 | + title: "BCC iron, non-linear partial-core correction, Pulay mixing" |
1599 | + - name: "fe_broyden" |
1600 | + title: "BCC iron, non-linear partial-core correction, Broyden mixing" |
1601 | + - name: "fe_clust_noncollinear" |
1602 | + title: "Linear Fe3 cluster, LDA" |
1603 | + - name: "fe_clust_noncollinear-gga" |
1604 | + title: "Linear Fe3 cluster, GGA" |
1605 | + - name: "fe_cohp" |
1606 | + title: "BCC iron, non-linear partial-core correction, COOP curves" |
1607 | + - name: "fe_noncol_kp" |
1608 | + title: "Linear Fe3 cluster with k-points" |
1609 | + - name: "fen" |
1610 | + title: "Bulk FeN in ZB structure , COOP curves" |
1611 | + - name: "fire_benzene" |
1612 | + title: "Benzene molecule with FIRE optimizer" |
1613 | + - name: "floating" |
1614 | + title: "Water molecule with Floating H orbitals" |
1615 | + - name: "force_2" |
1616 | + title: "Untitled" |
1617 | + auxdata: ["FC.fdf"] |
1618 | + - name: "force_constants" |
1619 | + title: "Untitled" |
1620 | + auxdata: ["FC.fdf"] |
1621 | + - name: "gate_G_charge" |
1622 | + title: "Untitled" |
1623 | + - name: "gate_G_hartree" |
1624 | + title: "Untitled" |
1625 | + - name: "ge111" |
1626 | + title: "Germanium 111 slab with 2x8 reconstruction" |
1627 | + - name: "ge_fatbands_so" |
1628 | + title: "Bulk Ge with SOC and various types of WFS output" |
1629 | + tags: ["WIP"] |
1630 | + - name: "graphite_c6" |
1631 | + title: "Untitled" |
1632 | + - name: "graphite_vdw_df" |
1633 | + title: "Unconverged graphite with vdw-DF" |
1634 | + - name: "h2_bessel" |
1635 | + title: "H2 molecule with a Bessel orbital in the middle" |
1636 | + - name: "h2o" |
1637 | + title: "Water molecule" |
1638 | + - name: "h2o-pop" |
1639 | + title: "Untitled" |
1640 | + - name: "h2o-rhog-mixing" |
1641 | + title: "Untitled" |
1642 | + - name: "h2oZ" |
1643 | + title: "Untitled" |
1644 | + - name: "h2o_2" |
1645 | + title: "Water molecule, changing the numbering of atoms" |
1646 | + - name: "h2o_4" |
1647 | + title: "Cluster of 4 water molecules, compute mu" |
1648 | + - name: "h2o_am05" |
1649 | + title: "Water molecule optimization with the AM05 functional" |
1650 | + - name: "h2o_basis" |
1651 | + title: "Water molecule with various basis generation options" |
1652 | + - name: "h2o_coop" |
1653 | + title: "Water molecule, COOP curves" |
1654 | + - name: "h2o_dipole" |
1655 | + title: "Dipole correction of a water molecule from DOI:10.1103/PhysRevB.59.12301" |
1656 | + - name: "h2o_dipole2" |
1657 | + title: "Dipole correction of a water molecule from DOI:10.1103/PhysRevB.59.12301" |
1658 | + - name: "h2o_dos" |
1659 | + title: "Untitled" |
1660 | + - name: "h2o_filteret_basis" |
1661 | + title: "Water molecule using a Filteret basis set" |
1662 | + - name: "h2o_findp_bug" |
1663 | + title: "Pre-findp bug example" |
1664 | + - name: "h2o_netcdf" |
1665 | + title: "NetCDF DMHS history of a water molecule" |
1666 | + triggers: ["netcdf"] |
1667 | + - name: "h2o_op_broyden" |
1668 | + title: "Broyden optimization of a water molecule" |
1669 | + - name: "h2o_orderN" |
1670 | + title: "Order-N optimization of a water molecule" |
1671 | + - name: "h2o_radialgrid" |
1672 | + title: "Example of accurate radial grid use" |
1673 | + - name: "h2o_reparam" |
1674 | + title: "Pseudopotential reparametrization of a water molecule" |
1675 | + - name: "h3po4_1" |
1676 | + title: "H3PO4 molecule optimization changing species ordering" |
1677 | + - name: "h3po4_2" |
1678 | + title: "H3PO4 molecule optimization changing species ordering" |
1679 | + - name: "h3po4_3" |
1680 | + title: "H3PO4 molecule optimization changing species ordering" |
1681 | + - name: "h_chain" |
1682 | + title: "Hydrogen chain" |
1683 | + - name: "h_chain2" |
1684 | + title: "Hydrogen chain with 2 atoms per cell and SZ basis" |
1685 | + - name: "md_anneal" |
1686 | + title: "Harris-functional annealing of a primitive c-Si supercell" |
1687 | + auxdata: ["md_anneal.STRUCT_IN"] |
1688 | + - name: "md_nose" |
1689 | + title: "Nosé MD of a MgCO3 primitive cell" |
1690 | + - name: "md_npr" |
1691 | + title: "Nosé-Parinello-Rahman MD of a MgCO3 primitive cell" |
1692 | + - name: "md_pr" |
1693 | + title: "Parinello-Rahman MD of a MgCO3 primitive cell" |
1694 | + - name: "md_verlet" |
1695 | + title: "Verlet MD of a MgCO3 primitive cell" |
1696 | + - name: "mgc-force" |
1697 | + title: "One-shot forces of a MgCO3 primitive cell" |
1698 | + - name: "mgco3" |
1699 | + title: "Default MD of a MgCO3 primitive cell" |
1700 | + - name: "mix_broyden" |
1701 | + title: "Linear Fe3 cluster, Broyden mixing" |
1702 | + - name: "mix_linear" |
1703 | + title: "Linear Fe3 cluster, linear mixing" |
1704 | + - name: "mix_pulay" |
1705 | + title: "Linear Fe3 cluster, Pulay mixing" |
1706 | + - name: "mno_ldau" |
1707 | + title: "Ferromagnetic Manganese oxide, LDA+U" |
1708 | + - name: "n_chain" |
1709 | + title: "Nitrogen atom chain" |
1710 | + - name: "nanotube-c-5-0" |
1711 | + title: "Metallic (5,0) carbon nanotube" |
1712 | + - name: "oxyn" |
1713 | + title: "Molecule made up of ON hybrids" |
1714 | + - name: "pb_bulk" |
1715 | + title: "Bulk lead" |
1716 | + - name: "pb_bulk_1000" |
1717 | + title: "Bulk lead" |
1718 | + - name: "pb_filter_cutoff" |
1719 | + title: "Bulk lead, cutoff-filtered" |
1720 | + - name: "pb_filter_tol" |
1721 | + title: "Bulk lead, tolerance-filtered" |
1722 | + - name: "ptcda" |
1723 | + title: "Untitled" |
1724 | + - name: "ptcda-au" |
1725 | + title: "Untitled" |
1726 | + - name: "scfmix" |
1727 | + title: "Linear Fe3 cluster, various mixing methods" |
1728 | + - name: "si-optical" |
1729 | + title: "Optical properties of bulk Si" |
1730 | + - name: "si001" |
1731 | + title: "Si(100), asymmetric 2x1 reconstruction" |
1732 | + - name: "si001-diags" |
1733 | + title: "Untitled" |
1734 | + - name: "si001-ldos" |
1735 | + title: "Untitled" |
1736 | + - name: "si111-spinpol" |
1737 | + title: "Untitled" |
1738 | + - name: "si2x1h" |
1739 | + title: "Untitled" |
1740 | + - name: "si2x1h-dipole" |
1741 | + title: "Untitled" |
1742 | + - name: "si2x1h-dipole-gcs" |
1743 | + title: "Untitled" |
1744 | + - name: "si2x1h-quench" |
1745 | + title: "Untitled" |
1746 | + - name: "si64" |
1747 | + title: "Untitled" |
1748 | + - name: "si64_coop" |
1749 | + title: " Cubic supercell of 64 Si atoms, COOP curves" |
1750 | + - name: "si_bandpoints" |
1751 | + title: "Bulk Silicon to test BandPoints" |
1752 | + - name: "si_coop" |
1753 | + title: "Si chain for the calculation of COOP curves" |
1754 | + - name: "si_fatbands" |
1755 | + title: "Bulk Silicon with various types of WFS output" |
1756 | + - name: "si_pdos_kgrid" |
1757 | + title: "bulk silicon with extra sampling for PDOS" |
1758 | + - name: "sic-slab" |
1759 | + title: "Hydrogen/SiC surface" |
1760 | + - name: "sih" |
1761 | + title: "Hydrogen in a supercell of 64 Silicon atoms" |
1762 | + - name: "sih-mrrr" |
1763 | + title: "Hydrogen in a supercell of 64 Silicon atoms, MRRR diagonalizer" |
1764 | + - name: "sih_fire" |
1765 | + title: "Hydrogen in a supercell of 64 Silicon atoms, FIRE quenching" |
1766 | + - name: "sih_op_broyden" |
1767 | + title: "Hydrogen in a supercell of 64 Silicon atoms, Broyden optimization" |
1768 | + - name: "sinw" |
1769 | + title: "Si Nanowire grown along the 110 direction" |
1770 | + - name: "sinw_2" |
1771 | + title: "Untitled" |
1772 | + - name: "var_cell" |
1773 | + title: "Broyden optimization of MgCO3 in a variable primitive cell" |
1774 | + - name: "wannier" |
1775 | + title: "Occupied bonding Wannier functions of Silicon" |
1776 | + auxdata: ["wannier.nnkp"] |
1777 | + - name: "zmatrix" |
1778 | + title: "Convoluted example of zmatrix input" |
1779 | + auxdata: ["Zmatrix.data"] |
1780 | + |
1781 | +... |
1782 | |
1783 | === modified file 'version.info' |
1784 | --- version.info 2018-05-25 11:13:25 +0000 |
1785 | +++ version.info 2018-05-30 08:59:05 +0000 |
1786 | @@ -1,1 +1,4 @@ |
1787 | -siesta-4.1--920 |
1788 | +siesta-4.1--920--yaml-923 |
1789 | + |
1790 | + |
1791 | + |
I would not have included the Docs/yaml_ tests/_ build/ subdirectory, since it is generated by Sphinx. If it was in the Bazaar branch, it's probably because I imported it for the demo I made at Simune's office. The important files are the *.rst found in Docs/yaml_tests/. The Makefile will do the rest, provided that Sphinx is installed. If not, the .rst files remain highly readable.