Skip to content

infinite loop when filename does not contain '%T' but IterationEncoding is fileBased #1048

@PrometheusPi

Description

@PrometheusPi

Describe the bug
When setting a series' file name without the %T and switching the IterationEncoding to fileBased the code runs into an infinite loop.

To Reproduce
C++

#include <openPMD/openPMD.hpp>

void error_openPMD()
{
    ::openPMD::Series series = ::openPMD::Series("error.h5", ::openPMD::Access::CREATE);
    series.iterations[10];
    series.setIterationEncoding(::openPMD::IterationEncoding::fileBased);
    series.flush(); 
};

int main()
{
    error_openPMD();
};

Expected behavior
Such a wrong configuration should be caught and an error should be thrown.

Software Environment

  • version of openPMD-api: 0.13.2
  • installed openPMD-api via: conda-forge,
  • operating system: MacOS 10.15.7
  • version of HDF5: 1.10.6

Additional context
This infinite loop can only be triggered if the user initially set a wrong file name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions