DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::Serializer::ArrayGlobalOffset Class Reference

Describes one rank's window into a globally-distributed dataset. More...

#include <SerializerBase.hpp>

Public Member Functions

 ArrayGlobalOffset (index __size, index __offset)
 Construct with explicit local size and global offset.
 
index size () const
 Local size this rank owns (in element units of the caller's choosing).
 
index offset () const
 Global offset of this rank's data (or a sentinel value, see Offset_Parts etc.).
 
ArrayGlobalOffset operator* (index R) const
 Scale the descriptor's element count by R (and the offset too if it is a real offset, not a sentinel). Used for byte-level offsets: elemOffset * sizeof(T).
 
ArrayGlobalOffset operator/ (index R) const
 Inverse of operator*. Real-offset descriptors scale both size and offset; sentinel descriptors only scale the size.
 
void CheckMultipleOf (index R) const
 Assert that both size and offset are multiples of R.
 
bool operator== (const ArrayGlobalOffset &other) const
 Equality: sentinel offsets compare only by offset, real-offset descriptors compare by the full (size, offset) pair.
 
 operator std::string () const
 Pretty-printed representation for logging.
 
bool isDist () const
 Whether this descriptor carries a real distributed offset (rather than a sentinel like Offset_Parts).
 

Friends

std::ostream & operator<< (std::ostream &o, const ArrayGlobalOffset &v)
 

Detailed Description

Describes one rank's window into a globally-distributed dataset.

Stores a (localSize, globalOffset) pair. The offset is overloaded to carry the special sentinels Offset_Parts / Offset_One / Offset_EvenSplit / Offset_Unknown (negative values). Multiplication / division are defined so that byte offsets can be derived from element offsets (offset * sizeof(T)) with overflow guards.

Definition at line 32 of file SerializerBase.hpp.

Constructor & Destructor Documentation

◆ ArrayGlobalOffset()

DNDS::Serializer::ArrayGlobalOffset::ArrayGlobalOffset ( index  __size,
index  __offset 
)
inline

Construct with explicit local size and global offset.

Definition at line 40 of file SerializerBase.hpp.

Member Function Documentation

◆ CheckMultipleOf()

void DNDS::Serializer::ArrayGlobalOffset::CheckMultipleOf ( index  R) const
inline

Assert that both size and offset are multiples of R.

Used when translating between element and byte offsets.

Definition at line 77 of file SerializerBase.hpp.

◆ isDist()

bool DNDS::Serializer::ArrayGlobalOffset::isDist ( ) const
inline

Whether this descriptor carries a real distributed offset (rather than a sentinel like Offset_Parts).

Definition at line 104 of file SerializerBase.hpp.

Here is the caller graph for this function:

◆ offset()

index DNDS::Serializer::ArrayGlobalOffset::offset ( ) const
inline

Global offset of this rank's data (or a sentinel value, see Offset_Parts etc.).

Definition at line 46 of file SerializerBase.hpp.

Here is the caller graph for this function:

◆ operator std::string()

DNDS::Serializer::ArrayGlobalOffset::operator std::string ( ) const
inline

Pretty-printed representation for logging.

Definition at line 97 of file SerializerBase.hpp.

◆ operator*()

ArrayGlobalOffset DNDS::Serializer::ArrayGlobalOffset::operator* ( index  R) const
inline

Scale the descriptor's element count by R (and the offset too if it is a real offset, not a sentinel). Used for byte-level offsets: elemOffset * sizeof(T).

Definition at line 51 of file SerializerBase.hpp.

◆ operator/()

ArrayGlobalOffset DNDS::Serializer::ArrayGlobalOffset::operator/ ( index  R) const
inline

Inverse of operator*. Real-offset descriptors scale both size and offset; sentinel descriptors only scale the size.

Definition at line 67 of file SerializerBase.hpp.

◆ operator==()

bool DNDS::Serializer::ArrayGlobalOffset::operator== ( const ArrayGlobalOffset other) const
inline

Equality: sentinel offsets compare only by offset, real-offset descriptors compare by the full (size, offset) pair.

Definition at line 88 of file SerializerBase.hpp.

◆ size()

index DNDS::Serializer::ArrayGlobalOffset::size ( ) const
inline

Local size this rank owns (in element units of the caller's choosing).

Definition at line 43 of file SerializerBase.hpp.

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  o,
const ArrayGlobalOffset v 
)
friend

Definition at line 109 of file SerializerBase.hpp.


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