Several backends exist for storing and loading IMAS data. Each backend uses a different format for storing the data.
| :ref:`HDF5 <hdf5 backend>` | :ref:`MDSplus <mdsplus backend>` | :ref:`UDA <uda backend>` | :ref:`Memory <memory backend>` | :ref:`ASCII <ascii backend>` | :ref:`Flexbuffers <flexbuffers backend>` | |
|---|---|---|---|---|---|---|
get |
Yes | Yes | Yes | Yes | Yes | Yes [3] |
get_slice |
Yes | Yes | Yes | Yes | - | - |
put |
Yes | Yes | - | Yes | Yes | Yes [4] |
put_slice |
Yes | Yes | - | Yes | - | - |
| Persistent storage | Yes | Yes | Yes [1] | - | Yes [2] | - |
| [1] | The UDA backend is read-only. |
| [2] | Suitable for tests and small data, but not recommended for large datasets or long-term storage. |
| [3] | Only when using OPEN_PULSE mode |
| [4] | Only when not using OPEN_PULSE mode |
The HDF5 backend is identified by hdf5 in the IMAS URI, and stores data in
the hdf5 data format
The MDSplus backend is identified by mdsplus in the IMAS URI. The data is
stored in the MDSplus format.
This backend imposes some limitations on the data that can be stored, see maxoccur in the |DD| documentation.
This backend has been around and stable for a longer time, so most older IMAS data is stored in this format.
The UDA backend is used when a host is provided. UDA (Universal Data Access) is the mechanism for contacting the server that stores the data.
A number of UDA plugins already exist for these, but their availability depends on how UDA has been installed on the local cluster. Therefore it's recommended that you contact the IMAS support team when you want to use this functionality.
simple URI example: imas://uda.iter.org:56565/uda?path=/work/imas/shared/imasdb/ITER/3/131062/4;backend=hdf5;verbose=1
The memory backend is identified by memory in the IMAS URI. When storing or
loading IMAS data with this backend, the data is stored in-memory. This is
therefore not persistent.
The memory backend can still be useful to transfer data between languages in the same program (for example, storing an IDS in C++ and then loading it with the Fortranens-user API) or to store a number of time slices and then loading all time slices.
simple URI example: imas:memory?path=/path/to/data
The ASCII backend is identified by ascii in the IMAS URI. The ASCII backend
can be used to store IDS data in a plain-text human readable format. The
performance and size of the stored data is worse than the other backends, so
this is typically only used for debugging.
The Flexbuffers backend is identified by flexbuffers in the IMAS URI. The
Flexbuffers backend is used when (de)serializing IDSs with the
FLEXBUFFERS_SERIALIZER_PROTOCOL. It is optimized for (de)serialization speed and
therefore has very limited functionality. It is not intended to be used outside of IDS
serialization.
You can use query keys to indicate to the backend where the data is stored and (optionally) set backend-specific configuration options. The following query keys are currently recognized.
Note
Query keys are case-sensitive and unknown query keys are silently ignored.
path[5]Provide the path to the folder where the IMAS data is (or will be) stored. Paths can be absolute (starting with a
/on UNIX, or with a drive letter on Windows) or relative to the current working directory.The backend manages how your IMAS data is stored within the folder.
imas:hdf5?path=/absolute/path/to/data imas:hdf5?path=relative_path
user,database,version,pulse,run[5]Use legacy (Access Layer version 4 and earlier) way to indicate where the IMAS data is (or will be) stored.
imas:mdsplus?user=public;pulse=131024;run=41;database=ITER;version=3
In Access Layer version 5.0.0 and earlier use key
shotinstead ofpulse.imas:mdsplus?user=public;shot=131024;run=41;database=ITER;version=3
| [5] | (1, 2) Either path or all of the legacy query keys must be
provided. |
The :ref:`HDF5 backend` also recognizes these backend-specific query keys.
hdf5_compression- Data compression is enabled by default. Set
hdf5_compression=noorhdf5_compression=nto disable data compression. hdf5_write_bufferingDuring a put operation, 0D and 1D buffers are first stored in memory. Buffers are flushed at the end of the put.
This feature is enabled by default. Set
hdf5_write_buffering=noorhdf5_write_buffering=nto disable write buffering.write_cache_option- Set the size of the HDF5 chunk cache used during chunked datasets write operations. Default to 100x1024x1024 bytes (100 MiB).
read_cache_option- Set the size of the HDF5 chunk cache used during chunked datasets read operations. Default to 5x1024x1024 bytes (5 MiB).
open_read_only- Open master file and IDSs files in read only if
open_read_only=yesoropen_read_only=y, overwriting the files access modes default behavior (see IMAS-5274 for an example use-case). hdf5_debug- HDF5 debug output is disabled by default. Set
hdf5_debug=yesorhdf5_debug=yto enable HDF5 debug output.
The :ref:`ASCII backend` also recognizes these backend-specific query keys.
filename- Specify the exact filename in which the IDS data will be stored, instead of the default <idsname><occurrence>.ids.
The :ref:`UDA backend` also recognizes these backend-specific query keys.
verbose- UDA verbosity is disabled by default. Set
verbose=1to obtain more information and ease debugging. cache_mode- UDA cache_mode is
idsby default. Setcache_mode=noneorcache_mode=idsto specify the mode of caching. -none: No caching is performed. -ids: Caches the entire IDS (Interface Data Structure). fetch- UDA
fetchis disabled by default. Setfetch=1to enable fetching and downloading IDS files to the locallocal_cachedirectory. local_cache- UDA
local_cacheis set totmp/uda-cache-of-$USER/path_in_uriby default. This is used along withfetch=1in the query. Setlocal_cache=/path/to/local/cache/directoryand the download directory will belocal_cache/path_in_uri.local_cachespecifies the path to the local cache directory where IDSs will be downloaded.