Skip to content

Commit 7b9de6f

Browse files
committed
Add test for redundant resetDataset()
1 parent f47f825 commit 7b9de6f

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

test/ParallelIOTest.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,29 @@ void joined_dim(std::string const &ext)
19951995
patchExtent.store<type>(10);
19961996
}
19971997
writeFrom.clear();
1998+
// There seems to be a bug making this flush call necessary, need to fix
1999+
it.seriesFlush();
19982000
it.close();
2001+
2002+
it = s.writeIterations()[200];
2003+
2004+
// Test issue fixed with
2005+
// https://github.com/openPMD/openPMD-api/pull/1740
2006+
2007+
auto bug_dataset = it.particles["flush_multiple_times"]["position"];
2008+
2009+
std::vector<int> buffer(length_of_patch * 2);
2010+
std::iota(buffer.begin(), buffer.end(), length_of_patch * 2 * rank);
2011+
2012+
bug_dataset.resetDataset({Datatype::INT, {Dataset::JOINED_DIMENSION}});
2013+
bug_dataset.storeChunkRaw(buffer.data(), {}, {length_of_patch});
2014+
it.seriesFlush();
2015+
2016+
bug_dataset.resetDataset({Datatype::INT, {Dataset::JOINED_DIMENSION}});
2017+
bug_dataset.storeChunkRaw(
2018+
buffer.data() + length_of_patch, {}, {length_of_patch});
2019+
it.seriesFlush();
2020+
19992021
s.close();
20002022
}
20012023

0 commit comments

Comments
 (0)