Skip to content

Commit

Permalink
Fix two little bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Mar 30, 2022
1 parent 2ed1ba2 commit 1a6b89c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/ReadIterations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

#include "openPMD/Series.hpp"

#include <iostream>

namespace openPMD
{

Expand Down
1 change: 0 additions & 1 deletion src/Series.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,6 @@ void Series::readFileBased()
bool atLeastOneIterationSuccessful = false;
for (auto &iteration : series.iterations)
{
readIterationEagerly(iteration.second);
if (auto error = readIterationEagerly(iteration.second); error)
{
std::cerr << "Cannot read iteration '" << iteration.first
Expand Down
8 changes: 4 additions & 4 deletions test/SerialIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5305,15 +5305,15 @@ void deferred_parsing(std::string const &extension)
Series series(basename + "%06T." + extension, Access::CREATE);
std::vector<float> buffer(20);
std::iota(buffer.begin(), buffer.end(), 0.f);
auto dataset = series.iterations[1000].meshes["E"]["x"];
auto dataset = series.iterations[0].meshes["E"]["x"];
dataset.resetDataset({Datatype::FLOAT, {20}});
dataset.storeChunk(buffer, {0}, {20});
series.flush();
}
// create some empty pseudo files
// if the reader tries accessing them it's game over
{
for (size_t i = 0; i < 1000; i += 100)
for (size_t i = 1; i < 1000; i += 100)
{
std::string infix = std::to_string(i);
std::string padding;
Expand All @@ -5333,7 +5333,7 @@ void deferred_parsing(std::string const &extension)
Access::READ_ONLY,
"{\"defer_iteration_parsing\": true}");
auto dataset =
series.iterations[1000].open().meshes["E"]["x"].loadChunk<float>(
series.iterations[0].open().meshes["E"]["x"].loadChunk<float>(
{0}, {20});
series.flush();
for (size_t i = 0; i < 20; ++i)
Expand All @@ -5349,7 +5349,7 @@ void deferred_parsing(std::string const &extension)
Access::READ_WRITE,
"{\"defer_iteration_parsing\": true}");
auto dataset =
series.iterations[1000].open().meshes["E"]["x"].loadChunk<float>(
series.iterations[0].open().meshes["E"]["x"].loadChunk<float>(
{0}, {20});
series.flush();
for (size_t i = 0; i < 20; ++i)
Expand Down

0 comments on commit 1a6b89c

Please sign in to comment.