openPMD-api
Public Member Functions | Public Attributes | Friends | List of all members
openPMD::AbstractIOHandler Class Referenceabstract

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

#include <AbstractIOHandler.hpp>

Inheritance diagram for openPMD::AbstractIOHandler:
Inheritance graph
[legend]
Collaboration diagram for openPMD::AbstractIOHandler:
Collaboration graph
[legend]

Public Member Functions

 AbstractIOHandler (std::string path, Access at, MPI_Comm)
 
 AbstractIOHandler (std::string path, Access at)
 
 AbstractIOHandler (AbstractIOHandler const &)=default
 
 AbstractIOHandler (AbstractIOHandler &&)=default
 
AbstractIOHandleroperator= (AbstractIOHandler const &)=default
 
AbstractIOHandleroperator= (AbstractIOHandler &&)=default
 
virtual void enqueue (IOTask const &iotask)
 Add provided task to queue according to FIFO. More...
 
std::future< void > flush (internal::FlushParams const &)
 Process operations in queue according to FIFO. More...
 
virtual std::future< void > flush (internal::ParsedFlushParams &)=0
 Process operations in queue according to FIFO. More...
 
virtual std::string backendName () const =0
 The currently used backend.
 

Public Attributes

std::string directory
 
Access m_backendAccess
 
Access m_frontendAccess
 
internal::SeriesStatus m_seriesStatus = internal::SeriesStatus::Default
 
std::queue< IOTaskm_work
 
bool m_lastFlushSuccessful = false
 This is to avoid that the destructor tries flushing again if an error happened. More...
 

Friends

class Series
 
class ADIOS2IOHandlerImpl
 
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

◆ 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::JSONIOHandler, openPMD::ParallelHDF5IOHandler, openPMD::HDF5IOHandler, openPMD::DummyIOHandler, and openPMD::ADIOS2IOHandler.

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: