File tree Expand file tree Collapse file tree 1 file changed +23
-9
lines changed
Expand file tree Collapse file tree 1 file changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -446,21 +446,35 @@ class ADIOS2IOHandlerImpl
446446 }
447447 }
448448 auto joinedDim = joinedDimension (shape);
449- for ( unsigned int i = 0 ; i < actualDim; i++ )
449+ if (joinedDim. has_value () )
450450 {
451- if (!(joinedDim.has_value () && *joinedDim == i) &&
452- offset[i] + extent[i] > shape[i])
451+ if (!offset.empty ())
453452 {
454453 throw std::runtime_error (
455- " [ADIOS2] Dataset access out of bounds." );
454+ " [ADIOS2] Offset must be an empty vector in case of joined "
455+ " array." );
456+ }
457+ for (unsigned int i = 0 ; i < actualDim; i++)
458+ {
459+ if (*joinedDim != i && extent[i] != shape[i])
460+ {
461+ throw std::runtime_error (
462+ " [ADIOS2] store_chunk extent of non-joined dimensions "
463+ " must be equivalent to the total extent." );
464+ }
456465 }
457466 }
458-
459- if (joinedDim.has_value () && !offset.empty ())
467+ else
460468 {
461- throw std::runtime_error (
462- " [ADIOS2] Offset must be an empty vector in case of joined "
463- " array." );
469+ for (unsigned int i = 0 ; i < actualDim; i++)
470+ {
471+ if (!(joinedDim.has_value () && *joinedDim == i) &&
472+ offset[i] + extent[i] > shape[i])
473+ {
474+ throw std::runtime_error (
475+ " [ADIOS2] Dataset access out of bounds." );
476+ }
477+ }
464478 }
465479
466480 var.SetSelection (
You can’t perform that action at this time.
0 commit comments