Skip to content

SourceSet

#include <sbio/core/iteration.hh>
template<class... Sources>
class SourceSet

Defined in src/lib/sbio/core/iteration.hh:752

—SourceSet Implementations (Zipping multiple DataSources) —///

A set of DataSources iterated together, in lockstep by step index.

The SourceSet allows grouping multiple DataSources, even those that are viewing different underlying data. Iteration over a SourceSet means iterating over each component DataSource simultaneously - ie.e when a SoruceSet returns a step n, it corresponds to step n for each DataSource. No remapping/alignment occurs.

The SourceSet holds its own EPolicy IterationState and therefore behaves like an independent DataSource.

Each parallel executing unit (e.g. a thread or rank, etc.) iterating will setup its own range-based for loop over the zipped set. First create the set, then zip the BrokerGroups of intereset.

auto set = source_set(ds_a, ds_b);
for (auto step : zip(set, bg1, bg2)) {
auto hdl1 = step.get(bg1);
auto hdl2 = step.get(bg2);
}
  • Sources The DataSource types. They must use the same EPolicy and StepIdxType.
Return Name Description
SBIO_HD SourceSet inline explicit Construct a set over DataSources which have already discovered their metadata.
SourceSet Deleted constructor.
SourceSet & operator= Deleted assignment operator.
SBIO_HDStepIdxType next const inline Request the next index for a step to read data for, common to all DataSources.
SBIO_HDStepBatch< StepIdxType > next_batch const inline Request the next contiguous batch of indices for steps, common to all DataSources.
SBIO_HDStepRange steps inline Return a range over the common steps of the set for the calling unit.
SBIO_HDConstStepRange steps const inline
SBIO_HDConstStepRange csteps const inline
SBIO_HDBatchRange batches inline Return a range over contiguous batches of steps, common to the DataSources.
SBIO_HDConstBatchRange batches const inline
SBIO_HDConstBatchRange cbatches const inline

inline explicit

inline explicit SBIO_HD SourceSet(Sources &... sources)

Defined in src/lib/sbio/core/iteration.hh:772

Construct a set over DataSources which have already discovered their metadata.


SourceSet(const SourceSet &) = delete

Defined in src/lib/sbio/core/iteration.hh:778

Deleted constructor.


SourceSet & operator=(const SourceSet &) = delete

Defined in src/lib/sbio/core/iteration.hh:779

Deleted assignment operator.


const inline

inline SBIO_HDStepIdxType next() const

Defined in src/lib/sbio/core/iteration.hh:787

Request the next index for a step to read data for, common to all DataSources.

The next step index to fetch and query data for, or the ExhaustedSentinel if no more data is available.


const inline

inline SBIO_HDStepBatch< StepIdxType > next_batch(hd_std::size_t batch_size = 0) const

Defined in src/lib/sbio/core/iteration.hh:809

Request the next contiguous batch of indices for steps, common to all DataSources.

The next back of step indices [first, last) to fetch data for. The Exhausted batch is returned as first and last equal to ExhaustedSentinel

Parameter Type Description
batch_size hd_std::size_t The maximum size of the batch of step indcies to read.

inline

inline SBIO_HDStepRange steps()

Defined in src/lib/sbio/core/iteration.hh:946

Return a range over the common steps of the set for the calling unit.

A range to iterate over in a range-based for loop.


const inline

inline SBIO_HDConstStepRange steps() const

Defined in src/lib/sbio/core/iteration.hh:947


const inline

inline SBIO_HDConstStepRange csteps() const

Defined in src/lib/sbio/core/iteration.hh:948


inline

inline SBIO_HDBatchRange batches(hd_std::size_t batch_size = 0)

Defined in src/lib/sbio/core/iteration.hh:957

Return a range over contiguous batches of steps, common to the DataSources.

A range to iterate over in a range-based for loop.

Parameter Type Description
batch_size hd_std::size_t The maximum number of steps per batch. The default is the smallest configured max_batch_size.

const inline

inline SBIO_HDConstBatchRange batches(hd_std::size_t batch_size = 0) const

Defined in src/lib/sbio/core/iteration.hh:960


const inline

inline SBIO_HDConstBatchRange cbatches(hd_std::size_t batch_size = 0) const

Defined in src/lib/sbio/core/iteration.hh:963

Name Description
DataFormat
ExecutionPolicy
StepIdxType
Iterator
ConstIterator
BatchIterator
ConstBatchIterator
StepRange
ConstStepRange
BatchRange
ConstBatchRange

using DataFormat = typename First::DataFormat

Defined in src/lib/sbio/core/iteration.hh:758


using ExecutionPolicy = typename First::ExecutionPolicy

Defined in src/lib/sbio/core/iteration.hh:759


using StepIdxType = typename First::StepIdxType

Defined in src/lib/sbio/core/iteration.hh:760


using Iterator = IteratorImpl< SourceSet, false >

Type: IteratorImpl< SourceSet, false >

Defined in src/lib/sbio/core/iteration.hh:874


using ConstIterator = IteratorImpl< const SourceSet, false >

Type: IteratorImpl< const SourceSet, false >

Defined in src/lib/sbio/core/iteration.hh:875


using BatchIterator = IteratorImpl< SourceSet, true >

Type: IteratorImpl< SourceSet, true >

Defined in src/lib/sbio/core/iteration.hh:877


using ConstBatchIterator = IteratorImpl< const SourceSet, true >

Type: IteratorImpl< const SourceSet, true >

Defined in src/lib/sbio/core/iteration.hh:878


using StepRange = RangeImpl< SourceSet, false >

Type: RangeImpl< SourceSet, false >

Defined in src/lib/sbio/core/iteration.hh:935


using ConstStepRange = RangeImpl< const SourceSet, false >

Type: RangeImpl< const SourceSet, false >

Defined in src/lib/sbio/core/iteration.hh:936


using BatchRange = RangeImpl< SourceSet, true >

Type: RangeImpl< SourceSet, true >

Defined in src/lib/sbio/core/iteration.hh:938


using ConstBatchRange = RangeImpl< const SourceSet, true >

Type: RangeImpl< const SourceSet, true >

Defined in src/lib/sbio/core/iteration.hh:939

Return Name Description
hd_std::tuple< Sources *... > m_sources
ExecutionPolicy::IterationState m_iteration_state
StepIdxType m_capacity

hd_std::tuple< Sources *... > m_sources

Defined in src/lib/sbio/core/iteration.hh:1019


ExecutionPolicy::IterationState m_iteration_state {}

Defined in src/lib/sbio/core/iteration.hh:1020


StepIdxType m_capacity { 0 }

Type: StepIdxType

Defined in src/lib/sbio/core/iteration.hh:1021

Return Name Description
SBIO_HD bool reindex_trigger const inline Reindex the DataSources which reached the common capacity.
SBIO_HDStepIdxType min_capacity const inline
SBIO_HD hd_std::size_t min_batch_size const inline

const inline

inline SBIO_HD bool reindex_trigger() const

Defined in src/lib/sbio/core/iteration.hh:973

Reindex the DataSources which reached the common capacity.

Whether more common steps are available (false once any is exhausted).


const inline

inline SBIO_HDStepIdxType min_capacity() const

Defined in src/lib/sbio/core/iteration.hh:989


const inline

inline SBIO_HD hd_std::size_t min_batch_size() const

Defined in src/lib/sbio/core/iteration.hh:1004