@@ -509,32 +509,34 @@ 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- {
528- for (unsigned int i = 0 ; i < actualDim; i++)
512+ if (var.ShapeID () == adios2::ShapeID::JoinedArray)
529513 {
530- if (!(joinedDim.has_value () && *joinedDim == i) &&
531- offset[i] + extent[i] > shape[i])
514+ // When you reach here due to a mysterious inconsistency
515+ // observed from time to time e.g.
516+ // adios2::JoinedDim=(~(size_t)0) which for 64 bits =
517+ // 18446744073709551615 but the particle shape, when printed
518+ // out, turns out to be [18446744073709551614]
519+ //
520+ if (!offset.empty ())
532521 {
533522 throw std::runtime_error (
534- " [ADIOS2] Dataset access out of bounds." );
523+ " [ADIOS2] Offset must be an empty vector in case of "
524+ " joined "
525+ " array." );
535526 }
536527 }
537- }// else
528+ else
529+ {
530+ for (unsigned int i = 0 ; i < actualDim; i++)
531+ {
532+ if (!(joinedDim.has_value () && *joinedDim == i) &&
533+ offset[i] + extent[i] > shape[i])
534+ {
535+ throw std::runtime_error (
536+ " [ADIOS2] Dataset access out of bounds." );
537+ }
538+ }
539+ } // else
538540 }
539541
540542 var.SetSelection (
0 commit comments