diff --git a/src/IO/ADIOS/CommonADIOS1IOHandler.cpp b/src/IO/ADIOS/CommonADIOS1IOHandler.cpp index b0d8a8c98d..d9551e2f34 100644 --- a/src/IO/ADIOS/CommonADIOS1IOHandler.cpp +++ b/src/IO/ADIOS/CommonADIOS1IOHandler.cpp @@ -871,6 +871,9 @@ void CommonADIOS1IOHandlerImpl::readAttribute(Writable* writable, Parameter< Operation::READ_ATT >& parameters) { + if( !writable->written ) + throw std::runtime_error("Internal error: Writable not marked written during attribute reading"); + ADIOS_FILE* f; f = m_openReadFileHandles.at(m_filePaths.at(writable)); @@ -1311,6 +1314,9 @@ void CommonADIOS1IOHandlerImpl::listPaths(Writable* writable, Parameter< Operation::LIST_PATHS >& parameters) { + if( !writable->written ) + throw std::runtime_error("Internal error: Writable not marked written during path listing"); + ADIOS_FILE* f; f = m_openReadFileHandles.at(m_filePaths.at(writable)); @@ -1359,6 +1365,9 @@ void CommonADIOS1IOHandlerImpl::listDatasets(Writable* writable, Parameter< Operation::LIST_DATASETS >& parameters) { + if( !writable->written ) + throw std::runtime_error("Internal error: Writable not marked written during dataset listing"); + ADIOS_FILE* f; f = m_openReadFileHandles.at(m_filePaths.at(writable)); @@ -1388,6 +1397,9 @@ void CommonADIOS1IOHandlerImpl::listAttributes(Writable* writable, Parameter< Operation::LIST_ATTS >& parameters) { + if( !writable->written ) + throw std::runtime_error("Internal error: Writable not marked written during attribute listing"); + ADIOS_FILE* f; f = m_openReadFileHandles.at(m_filePaths.at(writable)); diff --git a/src/IO/HDF5/HDF5IOHandler.cpp b/src/IO/HDF5/HDF5IOHandler.cpp index fa8e3730b0..02e646d3db 100644 --- a/src/IO/HDF5/HDF5IOHandler.cpp +++ b/src/IO/HDF5/HDF5IOHandler.cpp @@ -1066,6 +1066,9 @@ void HDF5IOHandlerImpl::readAttribute(Writable* writable, Parameter< Operation::READ_ATT >& parameters) { + if( !writable->written ) + throw std::runtime_error("Internal error: Writable not marked written during attribute read"); + auto res = m_fileIDs.find(writable); if( res == m_fileIDs.end() ) res = m_fileIDs.find(writable->parent); @@ -1396,6 +1399,9 @@ void HDF5IOHandlerImpl::listPaths(Writable* writable, Parameter< Operation::LIST_PATHS > & parameters) { + if( !writable->written ) + throw std::runtime_error("Internal error: Writable not marked written during path listing"); + auto res = m_fileIDs.find(writable); if( res == m_fileIDs.end() ) res = m_fileIDs.find(writable->parent); @@ -1428,6 +1434,9 @@ void HDF5IOHandlerImpl::listDatasets(Writable* writable, Parameter< Operation::LIST_DATASETS >& parameters) { + if( !writable->written ) + throw std::runtime_error("Internal error: Writable not marked written during dataset listing"); + auto res = m_fileIDs.find(writable); if( res == m_fileIDs.end() ) res = m_fileIDs.find(writable->parent); @@ -1459,6 +1468,9 @@ HDF5IOHandlerImpl::listDatasets(Writable* writable, void HDF5IOHandlerImpl::listAttributes(Writable* writable, Parameter< Operation::LIST_ATTS >& parameters) { + if( !writable->written ) + throw std::runtime_error("Internal error: Writable not marked written during attribute listing"); + auto res = m_fileIDs.find(writable); if( res == m_fileIDs.end() ) res = m_fileIDs.find(writable->parent);