Skip to content

Commit 01d2789

Browse files
gujfranzpoeschel
authored andcommitted
working around an unusal encounter when the joined_dim has actual
value "max::size_t - 1"
1 parent c2a96d8 commit 01d2789

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

include/openPMD/IO/ADIOS/ADIOS2IOHandler.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,22 @@ class ADIOS2IOHandlerImpl
509509
}
510510
else
511511
{
512+
if (var.ShapeID() == adios2::ShapeID::JoinedArray)
513+
{
514+
// When you reach here due to a mysterious inconsistency observed from time to time
515+
// e.g. adios2::JoinedDim=(~(size_t)0) which for 64 bits = 18446744073709551615
516+
// but the particle shape, when printed out, turns out to be
517+
// [18446744073709551614]
518+
//
519+
if (!offset.empty())
520+
{
521+
throw std::runtime_error(
522+
"[ADIOS2] Offset must be an empty vector in case of joined "
523+
"array.");
524+
}
525+
}
526+
else
527+
{
512528
for (unsigned int i = 0; i < actualDim; i++)
513529
{
514530
if (!(joinedDim.has_value() && *joinedDim == i) &&
@@ -518,6 +534,7 @@ class ADIOS2IOHandlerImpl
518534
"[ADIOS2] Dataset access out of bounds.");
519535
}
520536
}
537+
}// else
521538
}
522539

523540
var.SetSelection(

0 commit comments

Comments
 (0)