@@ -1541,37 +1541,30 @@ namespace
15411541 }
15421542 static constexpr char const *errorMsg = " DistributeToAllRanks" ;
15431543 };
1544+ #endif
15441545
1545- void warn_ignored_modifiable_attributes (
1546- adios2::IO &IO , std::string const &exempt_this_from_warnings)
1546+ void warn_ignored_modifiable_attributes (adios2::IO &IO )
15471547 {
1548- auto all_attributes = IO .AvailableAttributes ();
1549- std::deque<std::string> modifiable_attributes;
1550- for (auto const &[identifier, params] : all_attributes)
1551- {
1552- if (params.at (" Modifiable" ) == " 1" )
1553- {
1554- modifiable_attributes.emplace_back (identifier);
1555- }
1556- }
1557- if (modifiable_attributes.size () > 1 ||
1558- (modifiable_attributes.size () == 1 &&
1559- *modifiable_attributes.begin () != exempt_this_from_warnings))
1560- {
1561- std::cerr << &R"(
1562- Warning: Random-access for variable-encoding in ADIOS2 is currently
1548+ auto modifiable_flag = IO .InquireAttribute <detail::bool_representation>(
1549+ adios_defaults::str_useModifiableAttributes);
1550+ auto print_warning = [](std::string const ¬e) {
1551+ std::cerr << " Warning: " << note << R"(
1552+ Random-access for variable-encoding in ADIOS2 is currently
15631553experimental. Support for modifiable attributes is currently not implemented
15641554yet, meaning that attributes such as /data/time will show useless values.
15651555Use Access::READ_LINEAR to retrieve those values if needed.
15661556The following modifiable attributes have been found:
1567- )" [1 ];
1568- for (auto const &identifier : modifiable_attributes)
1569- {
1570- std::cerr << ' \t ' << identifier << ' \n ' ;
1571- }
1557+ )" ;
1558+ };
1559+ if (!modifiable_flag)
1560+ {
1561+ print_warning (" File might be using modifiable attributes." );
1562+ }
1563+ else if (modifiable_flag.Data ().at (0 ) != 0 )
1564+ {
1565+ print_warning (" File uses modifiable attributes." );
15721566 }
15731567 }
1574- #endif
15751568} // namespace
15761569
15771570void ADIOS2IOHandlerImpl::readAttributeAllsteps (
@@ -1589,7 +1582,7 @@ void ADIOS2IOHandlerImpl::readAttributeAllsteps(
15891582 IO .SetParameter (" StreamReader" , " ON" ); // this be for BP4
15901583 auto engine = IO .Open (fullPath (*file), adios2::Mode::Read);
15911584 auto status = engine.BeginStep ();
1592- warn_ignored_modifiable_attributes (IO , name );
1585+ warn_ignored_modifiable_attributes (IO );
15931586 auto type = detail::attributeInfo (IO , name, /* verbose = */ true );
15941587 switchType<ReadAttributeAllsteps>(
15951588 type, IO , engine, name, status, *param.resource );
0 commit comments