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.
voidwritenewchunk(const T(&) chunkdata[CHUNKLENGTH])
Write data to a new chunk in the hosted dataset.
voidRA_write(const T(&) values[CHUNKLENGTH], const hsize_t(&) coords[CHUNKLENGTH], std::size_t npoints)
voidzero()
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)
Tget_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_tcreateDataSet(hid_t location_id, const std::string & name, const std::size_t rdims[DSETRANK])
Create a (chunked) dataset.
hid_topenDataSet(hid_t location_id, const std::string & name, const std::size_t rdims[DSETRANK])
Open an existing dataset.
voidcloseDataSet()
Close an open dataset.
voidextend_dset(const unsigned long i)
Extend dataset to nearest multiple of CHUNKLENGTH above supplied length.
std::stringget_myname() const
std::size_tget_dsetrank() const
std::size_tget_chunklength() const
const hsize_t *get_maxdsetdims() const
const hsize_t *get_chunkdims() const
const hsize_t *get_slicedims() const
unsigned longget_nextemptyslab() const
unsigned longdset_length() const
characcess_mode() const
voidreset_nextemptyslab()
hsize_t *dsetdims()

Protected Functions inherited from Gambit::Printers::DataSetInterfaceBase< T, 0, CHUNKLENGTH >

Name
hid_tget_dset_id() const

Protected Attributes inherited from Gambit::Printers::DataSetInterfaceBase< T, 0, CHUNKLENGTH >

Name
const hid_thdftype_id
DataSetInterfaceBase class member definitions.
hid_tdset_id
unsigned longdsetnextemptyslab
unsigned longvirtualwriteposition

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