Openpmd-api: Reading `particlePatches["numParticles"]` fails

Created on 22 Jan 2021  路  3Comments  路  Source: openPMD/openPMD-api

Describe the bug
I am testing https://github.com/openPMD/openPMD-api/tree/9e201df4e20f3cf41b75df55a19ae9a33f57cdae together with PIConGPU und realized an error when loading an old checkpoint.
After investing some hours in debugging the issue I tested the release 0.12.0-alpha and all works fine.

The error is:

Unhandled exception of type 'St13runtime_error' with message 'Chunk does not reside inside dataset (Dimension on index 0. DS: 262144 - Chunk: 28299152)', terminating

To Reproduce
You can use this dataset checkpoint_blosc_000100.bp.zip (the dataset is not compressed, please ignore that it is named blosc)
The dataset was produced with a single MPI rank.

The data is read with the C++ API: https://github.com/ComputationalRadiationPhysics/picongpu/blob/b17941d2b90afb83b17284cae1b70e62d33e088e/include/picongpu/plugins/openPMD/restart/LoadSpecies.hpp#L108-L110

ADIOS2 internal tools shows that the data in the file is correct:

bpls checkpoint_blosc_000100.bp --dump -a /data/100/particles/e/particlePatches/numParticles
  uint64_t  /data/100/particles/e/particlePatches/numParticles               {1}
    (0)    262144 

Expected behavior
A clear and concise description of what you expected to happen.

Software Environment

Additional context
As I wrote above after switching from the current dev branch to 0.12.0-alpha all works fine.
For unknown reason openpmd-api is reading 28299152 from the dataset instead of 262144 what is stored in the adios file.

affects latest release bug internal

Most helpful comment

Fixed with #909, thanks for reporting!

Also, WRITE_ITERATIONS is a macro defined in PIConGPU, not in openPMD. We use it to support writing iterations in 0.12.* as well as in 0.13.* streaming mode. It has nothing to do with this issue.

All 3 comments

In PIConGPU we implemented that we can support openpmd-api 0.12.0-alpha and 0.13.x in this PR
On some places like https://github.com/ComputationalRadiationPhysics/picongpu/blob/b17941d2b90afb83b17284cae1b70e62d33e088e/include/picongpu/plugins/openPMD/restart/LoadSpecies.hpp#L109 we have not applied our macro WRITE_ITERATIONS.
I am not sure if there is a need for it. Never the less I tested using WRITE_ITERATIONS on all missed places where we read data but it was not solving the issue.

@franzpoeschel could you have a look. The macro is called WRITE_ITERATIONS, do we need to use it also in places where we read data with openpmd-api?

update: I tested now the last stable release 0.13.1 and have the reading error from the dev branch too.

Fixed with #909, thanks for reporting!

Also, WRITE_ITERATIONS is a macro defined in PIConGPU, not in openPMD. We use it to support writing iterations in 0.12.* as well as in 0.13.* streaming mode. It has nothing to do with this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ax3l picture ax3l  路  7Comments

PrometheusPi picture PrometheusPi  路  3Comments

KseniaBastrakova picture KseniaBastrakova  路  6Comments

ax3l picture ax3l  路  3Comments

eschnett picture eschnett  路  5Comments