openPMD-api
 
Loading...
Searching...
No Matches
openPMD::AbstractIOHandler Class Referenceabstract

Interface for communicating between logical and physically persistent data. More...

#include <AbstractIOHandler.hpp>

Inheritance diagram for openPMD::AbstractIOHandler:
openPMD::ADIOS2IOHandler openPMD::DummyIOHandler openPMD::HDF5IOHandler openPMD::JSONIOHandler openPMD::ParallelHDF5IOHandler

Public Member Functions

template<typename TracingJSON>
 AbstractIOHandler (std::optional< std::unique_ptr< AbstractIOHandler > > initialize_from, std::string path, Access at, TracingJSON &&jsonConfig, MPI_Comm)
 
template<typename TracingJSON>
 AbstractIOHandler (std::optional< std::unique_ptr< AbstractIOHandler > > initialize_from, std::string path, Access at, TracingJSON &&jsonConfig)
 
 AbstractIOHandler (std::optional< std::unique_ptr< AbstractIOHandler > >)
 
 AbstractIOHandler (AbstractIOHandler const &)=delete
 
 AbstractIOHandler (AbstractIOHandler &&) noexcept(false)
 
AbstractIOHandleroperator= (AbstractIOHandler const &)=delete
 
AbstractIOHandleroperator= (AbstractIOHandler &&) noexcept
 
virtual void enqueue (IOTask const &iotask)
 Add provided task to queue according to FIFO.
 
std::future< void > flush (internal::FlushParams const &)
 Process operations in queue according to FIFO.
 
virtual std::future< void > flush (internal::ParsedFlushParams &)=0
 Process operations in queue according to FIFO.
 
virtual std::string backendName () const =0
 The currently used backend.
 
virtual bool fullSupportForVariableBasedEncoding () const
 
template<>
 AbstractIOHandler (std::optional< std::unique_ptr< AbstractIOHandler > > initialize_from, std::string path, Access at, json::TracingJSON &&jsonConfig, MPI_Comm)
 
template<>
 AbstractIOHandler (std::optional< std::unique_ptr< AbstractIOHandler > > initialize_from, std::string path, Access at, json::TracingJSON &&jsonConfig)
 

Public Attributes

std::string directory
 
Access m_backendAccess
 
Access m_frontendAccess
 
std::queue< IOTaskm_work
 
bool m_lastFlushSuccessful = false
 This is to avoid that the destructor tries flushing again if an error happened.
 
internal::SeriesStatus m_seriesStatus = internal::SeriesStatus::Default
 
IterationEncoding m_encoding = IterationEncoding::groupBased
 
OpenpmdStandard m_standard = auxiliary::parseStandard(getStandardDefault())
 
bool m_verify_homogeneous_extents = true
 

Protected Attributes

std::unique_ptr< json::JsonMatcherjsonMatcher
 

Friends

class Series
 
class ADIOS2IOHandlerImpl
 
class JSONIOHandlerImpl
 
class HDF5IOHandlerImpl
 
class detail::ADIOS2File
 

Detailed Description

Interface for communicating between logical and physically persistent data.

Input and output operations are channeled through a task queue that is managed by the concrete class implementing this handler. The queue of pending operations is only processed on demand. For certain scenarios it is therefore necessary to manually execute all operations by calling AbstractIOHandler::flush().

Member Function Documentation

◆ backendName()

virtual std::string openPMD::AbstractIOHandler::backendName ( ) const
pure virtual

◆ enqueue()

virtual void openPMD::AbstractIOHandler::enqueue ( IOTask const & iotask)
inlinevirtual

Add provided task to queue according to FIFO.

Parameters
iotaskTask to be executed after all previously enqueued IOTasks complete.

Reimplemented in openPMD::DummyIOHandler.

◆ flush() [1/2]

std::future< void > openPMD::AbstractIOHandler::flush ( internal::FlushParams const & params)

Process operations in queue according to FIFO.

Returns
Future indicating the completion state of the operation for backends that decide to implement this operation asynchronously.

◆ flush() [2/2]

virtual std::future< void > openPMD::AbstractIOHandler::flush ( internal::ParsedFlushParams & )
pure virtual

Process operations in queue according to FIFO.

Returns
Future indicating the completion state of the operation for backends that decide to implement this operation asynchronously.

Implemented in openPMD::ADIOS2IOHandler, openPMD::DummyIOHandler, openPMD::HDF5IOHandler, openPMD::JSONIOHandler, and openPMD::ParallelHDF5IOHandler.

Member Data Documentation

◆ m_lastFlushSuccessful

bool openPMD::AbstractIOHandler::m_lastFlushSuccessful = false

This is to avoid that the destructor tries flushing again if an error happened.

Otherwise, this would lead to confusing error messages. Initialized as false, set to true after successful construction. If flushing results in an error, set this back to false. The destructor will only attempt flushing again if this is true.


The documentation for this class was generated from the following files: