Skip to content
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

Added a description of the Group API and step selection. #2574

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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``.