Skip to content

Commit

Permalink
Merge pull request #2574 from dmitry-ganyushin/docs
Browse files Browse the repository at this point in the history
Added a description of the Group API and step selection.
  • Loading branch information
dmitry-ganyushin authored Jan 7, 2021
2 parents aa7aacd + d7d594a commit dd9b211
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
67 changes: 67 additions & 0 deletions docs/user_guide/source/api_full/cxx11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,70 @@ Example:
// will throw exception like this:
// C++ exception with description "can't handle ShapeID::GlobalValue
// in Variable<double>(Name: "myVar")" thrown

**Group API**


.. doxygenclass:: adios2::Group
:project: CXX11
:path: ../../bindings/CXX11/adios2/cxx11/
:members:

The Group API can be used for inquiring other group objects, variables, and attributes
by reading, provided that variable and attribute names were written in a tree-like
way similar that is used in a file system:

.. code-block:: bash
"group1/group2/group3/variable1"
"group1/group2/group3/attribute1"
A group object containing the tree structure is obtained by the
``InquireGroup`` function of the ``IO`` object.

.. code-block:: c++

Group g = io.InquireGroup("group1");

Another group object can be generated by the predecessor group object.

.. code-block:: c++

Group g1 = g.InquireGroup("group2");

The absolute path can be inquired or set explicitly

.. code-block:: c++

std::string path = g.InquirePath();
g.setPath("group1/group2/group3");

Names of available groups, variables and attributes could be inquired:

.. code-block:: c++

std::vector<std::string> groups = g.AvailableGroups();
std::vector<std::string> variables = g.AvailableVariables();
std::vector<std::string> attributes = g.AvailableVariables();

Finally, variables can be inquired

.. code-block:: c++

auto var = g.InquireVariable("variable1");

An extra function is provided that returns a type of a variable

.. code-block:: c++

DataType varType = g.VariableType("variable1");


**Step selection**

Steps for reading can be selected using a pre-set parameter with as a file name
as a key and a list of selected steps separated by comma as a value.

.. code-block:: c++

io.SetParameter(filename, "1,3");
2 changes: 1 addition & 1 deletion docs/user_guide/source/engines/bp4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,5 @@ buffer using the IME native API. To use the IME transport, IME must be
avaiable on the target system and ADIOS2 needs to be configured with
``ADIOS2_USE_IME``. By default, data written to the IME is automatically
flushed to the parallel filesystem at every ``EndStep()`` call. You can
disable this automaic flush by setting the transport parameter ``SyncToPFS``
disable this automatic flush by setting the transport parameter ``SyncToPFS``
to ``OFF``.

0 comments on commit dd9b211

Please sign in to comment.