YAML is the format used to write PDI specification tree. A YAML file is a text format file that represents a tree.
For example, the following file:
Represents the following tree:
.
This tree contains the following kinds of nodes:
A scalar is a leaf in the tree, represented as a string. Some forms of scalars can be interpreted as boolean, integer or floating-point valued. Simple examples of scalars include (see the YAML specification for the complete syntax):
"hello"
,world
,3
,5.7
.Scalars are represented in pink in the graphical representation.
A sequence is an ordered list of sub-nodes (that can themselves be scalars, sequences, mappings, ...). Two variants of the syntax are available for sequences (see the YAML specification for the complete syntax).
[1, 2, 3, hello, "world"]
Sequences are represented in yellow in the graphical representation.
A mapping is an unordered list of key-value pairs (whose elements can themselves be scalars, sequences, mappings, ...). There can be no duplicates in the keys and the order in which the pairs are specified has no impact. Two variants of the syntax are available for mapping (see the YAML specification for the complete syntax).
{1: one, 2: "two", "three": 3}
Mapping are represented in blue in the graphical representation.
In addition to the previous basic building blocks, YAML supports additional advanced elements. These advanced elements build on the basic one to provide additional meaning.
An ordered mapping is represented as a sequence of mappings containing a single key-value pair each. There can be no duplicates in the keys. The sub-nodes can be scalars, sequences or mappings. Unlike in a normal mapping, the order of elements in an ordered mapping is meaningful. Two variants of the syntax are available for ordered mapping (see the YAML specification for the complete syntax).
[{1: one}, {2: "two"}, {"three": 3}]
The PDI_init function gets as parameter a tree with logging
, data
, metadata
and plugins
maps defined in its root. User can define its own values in yaml and pass to PDI only the subtree:
C source code:
Fortran source code: