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

BeamMonitor: No BP5 Group Based #870

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ If the same element name is used multiple times, then an output series is create
* ``<element_name>.backend`` (``string``, default value: ``default``)

`I/O backend <https://openpmd-api.readthedocs.io/en/latest/backends/overview.html>`_ for `openPMD <https://www.openPMD.org>`_ data dumps.
``bp`` is the `ADIOS2 I/O library <https://csmd.ornl.gov/adios>`_, ``h5`` is the `HDF5 format <https://www.hdfgroup.org/solutions/hdf5/>`_, and ``json`` is a `simple text format <https://en.wikipedia.org/wiki/JSON>`_.
``bp4``/``bp5`` is the `ADIOS2 I/O library <https://csmd.ornl.gov/adios>`_, ``h5`` is the `HDF5 format <https://www.hdfgroup.org/solutions/hdf5/>`_, and ``json`` is a `simple text format <https://en.wikipedia.org/wiki/JSON>`_.
``json`` only works with serial/single-rank jobs.
By default, the first available backend in the order given above is taken.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/usage/python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ This module provides elements for the accelerator lattice.
If the same element ``name`` is used multiple times, then an output series is created with multiple outputs.

The `I/O backend <https://openpmd-api.readthedocs.io/en/latest/backends/overview.html>`_ for `openPMD <https://www.openPMD.org>`_ data dumps.
``bp`` is the `ADIOS2 I/O library <https://csmd.ornl.gov/adios>`_, ``h5`` is the `HDF5 format <https://www.hdfgroup.org/solutions/hdf5/>`_, and ``json`` is a `simple text format <https://en.wikipedia.org/wiki/JSON>`_.
``bp4``/``bp5`` is the `ADIOS2 I/O library <https://csmd.ornl.gov/adios>`_, ``h5`` is the `HDF5 format <https://www.hdfgroup.org/solutions/hdf5/>`_, and ``json`` is a `simple text format <https://en.wikipedia.org/wiki/JSON>`_.
``json`` only works with serial/single-rank jobs.
By default, the first available backend in the order given above is taken.

Expand Down
2 changes: 1 addition & 1 deletion src/elements/diagnostics/BeamMonitor.H
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace detail
* Elements with the same series name are identical.
*
* @param series_name name of the data series, usually the element name
* @param backend file format backend for openPMD, e.g., "bp" or "h5"
* @param backend file format backend for openPMD, e.g., "bp5", "bp4", or "h5"
* @param encoding openPMD iteration encoding: "v"ariable based, "f"ile based, "g"roup based (default)
* @param period_sample_intervals for periodic lattice, only output every Nth period (turn)
*/
Expand Down
19 changes: 13 additions & 6 deletions src/elements/diagnostics/BeamMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ namespace detail {
{
#ifdef ImpactX_USE_OPENPMD
// pick first available backend if default is chosen
if( m_OpenPMDFileType == "default" )
if (m_OpenPMDFileType == "default")
# if openPMD_HAVE_ADIOS2==1
m_OpenPMDFileType = "bp";
m_OpenPMDFileType = "bp4";
Copy link
Member Author

@ax3l ax3l Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to change this default to bp5 as soon as variable based encoding works well for our (reader) tools.

# elif openPMD_HAVE_ADIOS1==1
m_OpenPMDFileType = "bp";
m_OpenPMDFileType = "bp"; // bp3
# elif openPMD_HAVE_HDF5==1
m_OpenPMDFileType = "h5";
# else
Expand All @@ -139,13 +139,20 @@ namespace detail {

// encoding of iterations in the series
openPMD::IterationEncoding series_encoding = openPMD::IterationEncoding::groupBased;
if ( "v" == encoding )
if ("v" == encoding)
series_encoding = openPMD::IterationEncoding::variableBased;
else if ( "g" == encoding )
else if ("g" == encoding)
series_encoding = openPMD::IterationEncoding::groupBased;
else if ( "f" == encoding )
else if ("f" == encoding)
series_encoding = openPMD::IterationEncoding::fileBased;

// BP5 does not support groupBased (metadata explosion)
if ((m_OpenPMDFileType == "bp5" || m_OpenPMDFileType == "bp") &&
(series_encoding == openPMD::IterationEncoding::groupBased))
{
throw std::runtime_error("BeamMonitor: groupBased encoding not supported for BP5.");
}

amrex::ParmParse pp_diag("diag");
// turn filter
pp_diag.queryAddWithParser("period_sample_intervals", m_period_sample_intervals);
Expand Down
Loading