class Gambit::Printers::DataSetInterfaceScalar
[No description available] More…
#include <DataSetInterfaceScalar.hpp>
Inherits from Gambit::Printers::DataSetInterfaceBase< T, 0, CHUNKLENGTH >
Public Functions
Name | |
---|---|
DataSetInterfaceScalar() Constructors. | |
DataSetInterfaceScalar(hid_t location_id, const std::string & name, const bool resume, const char access) | |
std::pair< hid_t, hid_t > | select_chunk(std::size_t offset, std::size_t length) const Select a hyperslab chunk in the hosted dataset. |
void | writenewchunk(const T(&) chunkdata[CHUNKLENGTH]) Write data to a new chunk in the hosted dataset. |
void | RA_write(const T(&) values[CHUNKLENGTH], const hsize_t(&) coords[CHUNKLENGTH], std::size_t npoints) |
void | zero() Set all elements of the dataset to zero. |
std::vector< T > | get_chunk(std::size_t i, std::size_t length) const READ methods (perhaps can generalise to non-scalar case, but this doesn’t exist yet for writing anyway so not bothering yet) |
T | get_entry(std::size_t index) Extract a single entry from a linked dataset. |
Additional inherited members
Public Functions inherited from Gambit::Printers::DataSetInterfaceBase< T, 0, CHUNKLENGTH >
Name | |
---|---|
DataSetInterfaceBase() Constructors. | |
DataSetInterfaceBase(hid_t location_id, const std::string & name, const std::size_t rdims[DSETRANK], const bool resume, const char access) | |
virtual | ~DataSetInterfaceBase() Do cleanup (close dataset) |
hid_t | createDataSet(hid_t location_id, const std::string & name, const std::size_t rdims[DSETRANK]) Create a (chunked) dataset. |
hid_t | openDataSet(hid_t location_id, const std::string & name, const std::size_t rdims[DSETRANK]) Open an existing dataset. |
void | closeDataSet() Close an open dataset. |
void | extend_dset(const unsigned long i) Extend dataset to nearest multiple of CHUNKLENGTH above supplied length. |
std::string | get_myname() const |
std::size_t | get_dsetrank() const |
std::size_t | get_chunklength() const |
const hsize_t * | get_maxdsetdims() const |
const hsize_t * | get_chunkdims() const |
const hsize_t * | get_slicedims() const |
unsigned long | get_nextemptyslab() const |
unsigned long | dset_length() const |
char | access_mode() const |
void | reset_nextemptyslab() |
hsize_t * | dsetdims() |
Protected Functions inherited from Gambit::Printers::DataSetInterfaceBase< T, 0, CHUNKLENGTH >
Name | |
---|---|
hid_t | get_dset_id() const |
Protected Attributes inherited from Gambit::Printers::DataSetInterfaceBase< T, 0, CHUNKLENGTH >
Name | |
---|---|
const hid_t | hdftype_id DataSetInterfaceBase class member definitions. |
hid_t | dset_id |
unsigned long | dsetnextemptyslab |
unsigned long | virtualwriteposition |
Detailed Description
template <class T ,
std::size_t CHUNKLENGTH>
class Gambit::Printers::DataSetInterfaceScalar;
Derived dataset interface, with methods for writing scalar records (i.e. single ints, doubles, etc.) i.e. RANK=0 case
Public Functions Documentation
function DataSetInterfaceScalar
DataSetInterfaceScalar()
Constructors.
function DataSetInterfaceScalar
DataSetInterfaceScalar(
hid_t location_id,
const std::string & name,
const bool resume,
const char access
)
function select_chunk
std::pair< hid_t, hid_t > select_chunk(
std::size_t offset,
std::size_t length
) const
Select a hyperslab chunk in the hosted dataset.
To facilitate code factorisation, the hyperslab selection is now contained here Only selects whole chunks at the moment.
function writenewchunk
void writenewchunk(
const T(&) chunkdata[CHUNKLENGTH]
)
Write data to a new chunk in the hosted dataset.
function RA_write
void RA_write(
const T(&) values[CHUNKLENGTH],
const hsize_t(&) coords[CHUNKLENGTH],
std::size_t npoints
)
Perform desynchronised (“random access”) dataset writes to previous scan iterations from a queue.
function zero
void zero()
Set all elements of the dataset to zero.
Easiest way to do this is to simply point the “nextemptyslab” index back to the beginning of the dataset, and then rewrite all the chunks with zero values.
Figure out how many chunks to overwrite
Point hyperslab selector back to beginning of dataset (might already point there if this is a random-access dataset, which actually it should be since we shouldn’t be resetting the sync datasets. Well anyway it should be ok, just means we cannot use it to compute how many chunks there are)
function get_chunk
std::vector< T > get_chunk(
std::size_t i,
std::size_t length
) const
READ methods (perhaps can generalise to non-scalar case, but this doesn’t exist yet for writing anyway so not bothering yet)
{@ READ methods
Extract a data slice from the linked dataset
function get_entry
T get_entry(
std::size_t index
)
Extract a single entry from a linked dataset.
Updated on 2024-07-18 at 13:53:32 +0000