The PDI specification tree is expressed in YAML.
The specification tree root is a mapping that contains the following keys:
key | value |
---|---|
"types" (optional) | a types_map |
"data" (optional) | a data_map |
"metadata" (optional) | a data_map |
"plugins" (optional) | a plugin_map |
"logging" (optional) | a logging |
"plugin_path" (optional) | a plugin_path |
".*" (optional) | anything |
types
section specifies user-defined datatypesdata
and metadata
sections specify the type of the data in buffers exposed by the application; for metadata
, PDI keeps a copy while it only keeps references for data
,plugins
section specifies the list of plugins to load and their configuration,plugin_path
section specifies the path to a directory where PDI should search for pluginslogging
section specify logger propertiesExample:
A array_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "array" |
"size" | a intexpr_or_seq |
"subtype" (optional) | a datatype |
"subsize" (optional, deprecated) | a intexpr_or_seq |
"start" (optional, deprecated) | a intexpr_or_seq |
A array_type_node represents a potentially multi-dimensional array where:
size
key represents the size of the array in each dimension (C order),subtype
key represents the type of the elements in the array,subsize
key represents the number of elements to actually use in each dimension (slicing), if specified it must have the same number of elements as size
, this defaults to the full array size in each dimension,start
key represents the index of the first element to actually use in each dimension (slicing), if specified it must have the same number of elements as size
, this defaults to the first (0) element in each dimension.Examples:
A char_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "char" |
A char_type represents the C char
datatype; it accepts no parameter.
Example:
A character_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "character" |
"kind" (optional) | a integer-valued $-expression |
A character_type_node represents the Fortran character
datatype. The value associated to the kind
key corresponds to the Fortran kind parameter (character(kind=...)
).
Examples:
A datatype can be any of:
Amongst these, simple_datatype is the only scalar. All others are dictionaries with a type
key used for disambiguation between them. Plugins can add new options that follow the same pattern.
A datatype represents the memory layout and interpretation for data exposed by the user in the data store.
Optional attributes can be added to any datatype. An attribute is identified by a key that starts with the +
character. The value can be anything(scalar, sequence or mapping).
Example:
A data_map is a mapping that contains the following keys:
key | value |
---|---|
".*" (optional) | a datatype |
Example:
A double_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "double" |
A double_type represents the C double
type. It accepts no parameter.
Example:
A $-expression is a scalar whose content matches the following grammar:
The rules for evaluating an expression are close to those of BASH for example.
In addition to raw text, a STRING_LITERAL
can contain references to the string value of some data in the store as well as the result of an operation by enclosing it inside a dollar-parenthesis $()
.
An OPERATION
can include logical and arithmetic operators grouped by parenthesis. The basic terms manipulated in an operation can be integer literals or references to the integer value of some data in the store.
A REFERENCE
is introduced by a dollar $
sign and optionally enclosed in curly braces {
, }
. Its value is that of the data or metadata with the associated name. It is always a good idea to have referenced values in the metadata section as it prevents dangling references. Value formatting can be applied using a FMT format_spec
string by adding a column :
followed by the format_spec
after a column just before the closing bracket }
(see: https://fmt.dev/latest/syntax.html#grammar-token-format_spec). A direct reference is possible as well as sub-references to:
[
, ]
operator,.
operator.The value-type of an EXPRESSION
is as follow:
REFERENCE
, it has the type of the referenced data in the store,OPERATION
, it is integer-valued,STRING_LITERAL
, it is string-valued.In addition, an integer can be interpreted as a string or as a boolean value where zero is interpreted as false and any other value as true.
Examples:
A float_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "float" |
A float_type represents the C float
type. It accepts no parameter.
Example:
A int_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "int" |
A int_type represents the C int
type. It accepts no parameter.
Example:
A int16_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "int16" |
A int16_type represents the C int16_t
type from the <stdtypes.h>
header. It accepts no parameter.
Example:
A int32_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "int32" |
A int32_type represents the C int32_t
type from the <stdtypes.h>
header. It accepts no parameter.
Example:
A int64_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "int64" |
A int64_type represents the C int64_t
type from the <stdtypes.h>
header. It accepts no parameter.
Example:
A int8_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "int8" |
A int8_type represents the C int8_t
type from the <stdtypes.h>
header. It accepts no parameter.
Example:
A integer_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "integer" |
"kind" (optional) | a integer-valued $-expression |
A integer_type represents the Fortran integer
datatype. The value associated to the kind
key corresponds to the Fortran kind parameter (integer(kind=...)
). If missing, the default kind of the Fortran implementation is used.
Examples:
A intexpr_seq is a sequence where each element of the sequence is a integer-valued $-expression.
Example:
A intexpr_or_seq can be any of:
In that context, a simple $-expression is interpreted as a shortcut for a sequence containing a single $-expression.
For example, the following value:
is interpreted as if it was:
A logging can be any of:
A logging is fully supported in specification tree root and any plugin_map .
A logging_map is a mapping that contains the following keys:
key | value |
---|---|
"level" (optional) | a logging_level |
"pattern" (optional) | a logger prefix pattern of spdlog |
"output" (optional) | a logging_output_map |
%{<EXPR>}
, where <EXPR>
represents a string-valued $-expression|a $-expression that will be evaluated just after all plugins have been initialized,PDI
or a plugin name): Example:
A logging_level is a scalar which determines verbosity level. It can be set to (from the most to the least verbose):
"debug"
- shows a log when a normal situation of the execution might be useful to understand the behavior of the library,"info"
- shows a log when a normal situation of the execution is likely useful to understand the behavior of the library,"warn"
- shows a log when a very likely invalid situation has been detected by the library (user input that is technically valid, but very unusual for example),"error"
- shows a log when an invalid situation has been detected by the library (invalid user input, invalid hardware behaviour, etc.),"off"
- logs are disabled.Examples:
level
is set to info
A logical_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "logical" |
"kind" (optional) | a integer-valued $-expression |
A logical_type represents the Fortran logical
datatype. The value associated to the kind
key corresponds to the Fortran kind parameter (logical(kind=...)
). If missing, the default kind of the Fortran implementation is used.
Examples:
A logging_output_map is a mapping that contains the following keys:
key | value |
---|---|
"file" (optional) | a path of the file where to write logs |
"console" (optional) | on or off |
file
is defined, console
is set to off
.Example:
A struct_member_desc is a mapping that contains the following keys:
key | value |
---|---|
"type" | a scalar , array , record or struct |
".*" (optional) | anything |
type
key identifies the type of this member, all other keys required for this datatype must be present.Examples:
See struct_type for more examples.
A record_member_desc is a mapping that contains the following keys:
key | value |
---|---|
"disp" | a integer-valued $-expression |
"type" | a scalar , array , record or struct |
".*" (optional) | anything |
disp
key identifies the displacement in bytes from the base address of the record and the address of this specific member,type
key identifies the type of this record, all other keys required for this datatype must be present.Examples:
See record_type for more examples.
A struct_members_omap is an ordered mapping that contains the following keys:
key | value |
---|---|
".*" (optional) | a struct_member_desc |
See struct_type for an example.
A types_map is a mapping that contains the following keys:
key | value |
---|---|
".*" (optional) | a datatype |
A record_members_map is a mapping that contains the following keys:
key | value |
---|---|
".*" (optional) | a record_member_desc |
See record_type for an example.
A plugin_map is a mapping that contains the following keys:
key | value |
---|---|
".*" (optional) | anything |
Have a look at the plugins documentation to see the specification tree they accept.
See specification tree root for an example.
A real_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "real" |
"kind" (optional) | a integer-valued $-expression |
A real_type represents the Fortran real
datatype. The value associated to the kind
key corresponds to the Fortran kind parameter (real(kind=...)
). If missing, the default kind of the Fortran implementation is used.
Examples:
A struct_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "struct" |
"members" (optional) | a struct_members_omap |
A struct_type represents a "struct", aka C "struct", C++ "class". Buffersize and members displacemnts will be calculated by the PDI.
Example:
A record_type is a mapping that contains the following keys:
key | value |
---|---|
"type" | "record" |
"buffersize" | a integer-valued $-expression |
"members" (optional) | a record_members_map |
A record_type represents a "record" where:
buffersize
key represents the overall size of the record, including potential padding,members
key lists all members of the record with given displacements.Example:
A simple_datatype is a scalar.
It is interpreted as a shortcut for a mapping with a single key type
whose value is the provided scalar and therefore another datatype.
For example, the following value:
is interpreted as if it was:
A path to directory where PDI should search for plugins. It can be single path:
or array of paths (PDI will take first match):