-
Notifications
You must be signed in to change notification settings - Fork 57
Advanced backend configuration via JSON #569
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
Changes from all commits
36de477
7ce3ed3
7ecd54b
f44967c
176b107
c438792
cf44a7c
b4c3f10
7df9184
d3dee1d
2339f59
e84ced8
3604b8b
97da62a
784c0c6
56c3451
74e9d38
9a6569e
f683b25
f824c4e
4c412cd
cd89f55
422143b
00768b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "adios2": { | ||
| "engine": { | ||
| "type": "sst", | ||
| "parameters": { | ||
| "BufferGrowthFactor": "2.0", | ||
| "QueueLimit": "2" | ||
| } | ||
| }, | ||
| "dataset": { | ||
| "operators": [ | ||
| { | ||
| "type": "bzip2", | ||
| "parameters": {} | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| .. _backendconfig | ||
|
|
||
| Backend-Specific Configuration | ||
| ============================== | ||
|
|
||
| While the openPMD API intends to be a backend-*independent* implementation of the openPMD standard, it is sometimes useful to pass configuration parameters to the specific backend in use. | ||
| :ref:`For each backend <backends-overview>`, configuration options can be passed via a JSON-formatted string or via environment variables. | ||
| A JSON option always takes precedence over an environment variable. | ||
|
|
||
| The fundamental structure of this JSON configuration string is given as follows: | ||
|
|
||
| .. literalinclude:: config_layout.json | ||
| :language: json | ||
|
|
||
|
franzpoeschel marked this conversation as resolved.
|
||
| This structure allows keeping one configuration string for several backends at once, with the concrete backend configuration being chosen upon choosing the backend itself. | ||
|
|
||
| The configuration is read in a case-sensitive manner. | ||
| Generally, keys of the configuration are *lower case*. | ||
| Parameters that are directly passed through to an external library and not interpreted within openPMD API (e.g. ``adios2.engine.parameters``) are unaffected by this and follow the respective library's conventions. | ||
|
|
||
| The configuration string may refer to the complete ``openPMD::Series`` or may additionally be specified per ``openPMD::Dataset``, passed in the respective constructors. | ||
| *A configuration per dataset is currently not yet implemented.* | ||
| This reflects the fact that certain backend-specific parameters may refer to the whole Series (such as storage engines and their parameters) and others refer to actual datasets (such as compression). | ||
|
|
||
| For a consistent user interface, backends shall follow the following rules: | ||
|
|
||
| * The configuration structures for the Series and for each dataset should be defined equivalently. | ||
| * Any setting referring to single datasets should also be applicable globally, affecting all datasets. | ||
| * If a setting is defined globally, but also for a concrete dataset, the dataset-specific setting should override the global one. | ||
| * If a setting is passed to a dataset that only makes sense globally (such as the storage engine), the setting should be ignored except for printing a warning. | ||
| Backends should define clearly which keys are applicable to datasets and which are not. | ||
|
|
||
|
|
||
| Configuration Structure per Backend | ||
| ----------------------------------- | ||
|
|
||
| ADIOS2 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally, and I think this can be a follow-up PR as well, I think these backend-specific options should go into the respective backend docs page (where we also document the current environment vars).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @franzpoeschel please try to split this up in a follow-up PR, we already have backend-specific docs where this should go :) |
||
| ^^^^^^ | ||
|
|
||
| A full configuration of the ADIOS2 backend: | ||
|
|
||
| .. literalinclude:: adios2.json | ||
| :language: json | ||
|
|
||
|
ax3l marked this conversation as resolved.
|
||
| All keys found under ``adios2.dataset`` are applicable globally as well as per dataset, keys found under ``adios2.engine`` only globally. | ||
| Explanation of the single keys: | ||
|
|
||
| * ``adios2.engine.type``: A string that is passed directly to ``adios2::IO:::SetEngine`` for choosing the ADIOS2 engine to be used. | ||
| Please refer to the `official ADIOS2 documentation <https://adios2.readthedocs.io/en/latest/engines/engines.html>`_ for a list of available engines. | ||
| * ``adios2.engine.type``: An associative array of string-formatted engine parameters, passed directly through to ``adios2::IO::SetParameters``. | ||
| Please refer to the official ADIOS2 documentation for the allowable engine parameters. | ||
| * ``adios2.dataset.operators``: (*currently unimplemented* – please use the ``openPMD::Dataset::compression`` for the meantime) This key contains a list of ADIOS2 `operators <https://adios2.readthedocs.io/en/latest/components/components.html#operator>`_, used to enable compression or dataset transformations. | ||
| Each object in the list has three keys: | ||
|
|
||
| * ``type`` supported ADIOS operator type, e.g. zfp, sz | ||
| * ``parameters`` is an associative map of string parameters for the operator (e.g. compression levels) | ||
|
|
||
| Other backends | ||
| ^^^^^^^^^^^^^^ | ||
|
|
||
| Do currently not read the configuration string. | ||
| Please refer to the respective backends' documentations for further information on their configuration. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "adios": "put ADIOS config here", | ||
| "adios2": "put ADIOS2 config here", | ||
| "hdf5": "put HDF5 config here", | ||
| "json": "put JSON config here" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up PR: can we add a schema for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a good idea, yeah