DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::ParArray< T, _row_size, _row_max, _align > Class Template Reference

MPI-aware Array: adds a communicator, rank, and global index mapping. More...

#include <ArrayTransformer.hpp>

Inheritance diagram for DNDS::ParArray< T, _row_size, _row_max, _align >:
[legend]
Collaboration diagram for DNDS::ParArray< T, _row_size, _row_max, _align >:
[legend]

Public Types

using TArray = Array< T, _row_size, _row_max, _align >
 
using t_self = ParArray< T, _row_size, _row_max, _align >
 
using t_pArray = ssp< TArray >
 
using t_pRowSizes = typename TArray::t_pRowSizes
 
- Public Types inherited from DNDS::Array< T, _row_size, _row_max, _align >
using self_type = Array< T, _row_size, _row_max, _align >
 
using t_Layout = ArrayLayout< T, _row_size, _row_max, _align >
 
using t_View = ArrayView< T, _row_size, _row_max, _align >
 
using t_Data = host_device_vector< value_type >
 
using t_DataUncompressed = std::vector< std::vector< value_type > >
 
using t_RowStart = host_device_vector< index >
 
using t_pRowStart = ssp< t_RowStart >
 
using t_RowSizes = host_device_vector< rowsize >
 
using t_pRowSizes = ssp< t_RowSizes >
 
template<DeviceBackend B>
using t_deviceView = ArrayDeviceView< B, T, _row_size, _row_max, _align >
 
template<DeviceBackend B>
using t_deviceViewConst = ArrayDeviceView< B, const T, _row_size, _row_max, _align >
 
- Public Types inherited from DNDS::ArrayLayout< T, _row_size, _row_max, _align >
using value_type = T
 

Public Member Functions

 ParArray (const t_self &R)=default
 
t_selfoperator= (const t_self &R)=default
 
void clone (const t_self &R)
 Copy-assign from another ParArray. Shallow copy semantics (mirrors Arrayclone): shares structural/data buffers.
 
void WriteSerializer (Serializer::SerializerBaseSSP serializerP, const std::string &name, Serializer::ArrayGlobalOffset offset)
 Serialize (write) the parallel array with MPI-aware metadata.
 
void ReadSerializer (Serializer::SerializerBaseSSP serializerP, const std::string &name, Serializer::ArrayGlobalOffset &offset)
 Deserialize (read) the parallel array with MPI-aware metadata.
 
MPI_Datatype getDataType ()
 MPI element datatype used for ghost exchange (deduced from T).
 
MPI_int getTypeMult ()
 Per-element count multiplier that goes with getDataType.
 
void setMPI (const MPIInfo &n_mpi)
 Install the MPI context after default construction.
 
MPIInfogetMPI ()
 Mutable MPI context accessor.
 
const MPIInfogetMPI () const
 Read-only MPI context accessor.
 
void setDataType (MPI_Datatype n_dType, MPI_int n_TypeMult)
 Override the deduced MPI datatype and element multiplier (advanced; needed for custom compound element types).
 
 ParArray ()=default
 Default-construct an uninitialised ParArray; call setMPI and Resize later.
 
 ParArray (const MPIInfo &n_mpi)
 Construct a ParArray bound to the given MPI context.
 
 ParArray (MPI_Datatype n_dType, MPI_int n_TypeMult, const MPIInfo &n_mpi)
 Construct with a custom (MPI datatype, multiplier) pair.
 
template<typename... Args>
 ParArray (ObjName objName, Args &&...args)
 Named constructor: sets the object name for tracing/debugging. All existing constructor overloads are supported via perfect forwarding. Inherited by derived classes (ArrayAdjacency, ArrayEigenVector, etc.) through using t_base::t_base.
 
void AssertDataType ()
 Assert the MPI datatype matches sizeof(T) exactly.
 
bool AssertConsistent ()
 Check array consistency across all ranks.
 
void createGlobalMapping ()
 Collective: build the global offsets table.
 
index globalSize () const
 Returns the total global size (sum of sizes across all ranks).
 
 Array ()=default
 Default-constructed array: empty, no storage.
 
 Array (ObjName objName)
 Named constructor: sets the object name for tracing/debugging. Delegates to the default constructor, then sets the name.
 
 Array (const self_type &R)
 Copy constructor (same semantics as clone).
 
- Public Member Functions inherited from DNDS::Array< T, _row_size, _row_max, _align >
t_pRowStart getRowStart ()
 Shared pointer to the row-start index (CSR layout only).
 
t_pRowSizes getRowSizes ()
 Shared pointer to the per-row size vector (TABLE_Max / TABLE_StaticMax).
 
 Array ()=default
 Default-constructed array: empty, no storage.
 
 Array (ObjName objName)
 Named constructor: sets the object name for tracing/debugging. Delegates to the default constructor, then sets the name.
 
index Size () const
 Number of rows currently stored. O(1).
 
rowsize RowSize () const
 Uniform row width for fixed layouts (no row index needed).
 
rowsize DataStride () const
 Number of T elements per row in flat storage (data stride). For TABLE_StaticMax/TABLE_Max, this is _row_max (padded), not RowSize (used). Not valid for CSR (variable stride per row).
 
rowsize RowSize (index iRow) const
 Width used by row iRow in number of T elements.
 
rowsize RowSizeMax () const
 Maximum allowed row width for TABLE_Max / TABLE_StaticMax.
 
rowsize RowSizeField () const
 "Logical" row-field width used by derived (Eigen) arrays: max for padded layouts, uniform width for fixed layouts. Not valid for CSR.
 
rowsize RowSizeField (index iRow) const
 Per-row "field" size for CSR (= actual row width). Invalid elsewhere.
 
bool IfCompressed () const
 (CSR only) Whether the array is in packed / flat form.
 
void CSRDecompress ()
 (CSR only) Switch to the uncompressed (nested vector) representation.
 
void CSRCompress ()
 (CSR only) Pack the nested-vector representation into a flat buffer plus _pRowStart. No-op if already compressed.
 
void Compress ()
 Layout-polymorphic compress: no-op for non-CSR, calls CSRCompress for CSR.
 
void Decompress ()
 Layout-polymorphic decompress: no-op for non-CSR, calls CSRDecompress for CSR.
 
t_DataRawDataVector ()
 Access to the underlying flat buffer (host_device_vector<T>).
 
void Resize (index nSize, rowsize nRow_size_dynamic)
 Resize the array, setting a uniform or maximum row width.
 
void Resize (index nSize)
 Resize using only the row count (layouts with an implicit row width).
 
template<class TFRowSize >
void Resize (index nSize, TFRowSize &&FRowSize)
 Resize a CSR array directly to the compressed form via a width functor.
 
void ResizeRow (index iRow, rowsize nRowSize)
 Change the width of a single row.
 
void ReserveRow (index iRow, rowsize nRowSize)
 Reserve capacity for a CSR decompressed row without changing its size.
 
t_View view ()
 Produce a lightweight, device-agnostic view onto the array.
 
const T & at (index iRow, rowsize iCol) const
 Bounds-checked element access.
 
T & operator() (index iRow, rowsize iCol=0)
 Bounds-checked 2D element access (writable).
 
const T & operator() (index iRow, rowsize iCol=0) const
 Bounds-checked 2D element access (read-only).
 
T * operator[] (index iRow)
 Return a raw pointer to the start of row iRow.
 
const T * operator[] (index iRow) const
 Const row pointer, see the non-const overload.
 
T * data (DeviceBackend B=DeviceBackend::Unknown)
 Raw pointer to the flat data buffer.
 
size_t DataSize () const
 Total number of T elements currently stored in the flat buffer.
 
size_t DataSizeBytes () const
 Flat buffer size in bytes (= DataSize() * sizeof(T)).
 
void CopyRowFrom (index dstRow, const self_type &src, index srcRow)
 Copy raw row data from another Array of the same type. Works for all layouts (StaticFixed, Fixed, CSR, etc.) and is not hidden by derived types that make operator()/operator[] private.
 
template<class TRowSizeFunc >
void ResizeRowsAndCompress (TRowSizeFunc &&rowSizeFunc)
 Set per-row sizes from a source, applying an index mapping, then compress. For CSR layout only. rowSizeFunc(i) returns the desired row size for row i. Not hidden by derived types that make ResizeRow private.
 
size_t FullSizeBytes () const
 Total footprint in bytes including structural arrays.
 
std::size_t hash ()
 Combined hash of size, structural arrays, and data.
 
constexpr DataLayout GetDataLayout ()
 Runtime accessor for the layout tag (constexpr-folded).
 
void clone (const self_type &R)
 Shallow clone: copies all metadata and shares structural/data storage.
 
void CopyData (const self_type &R)
 Deep copy alias. Currently delegates to clone; kept for API compatibility and to allow a future true deep-copy implementation.
 
self_typeoperator= (const self_type &R)
 Copy-assignment; implemented via clone with self-assign guard.
 
 Array (const self_type &R)
 Copy constructor (same semantics as clone).
 
void SwapData (self_type &R)
 Swap the storage of two arrays in-place.
 
void __WriteSerializerData (const Serializer::SerializerBaseSSP &serializerP, Serializer::ArrayGlobalOffset offset)
 
void __ReadSerializerData (const Serializer::SerializerBaseSSP &serializerP, Serializer::ArrayGlobalOffset &offset)
 
void WriteSerializer (Serializer::SerializerBaseSSP serializerP, const std::string &name, Serializer::ArrayGlobalOffset offset, Serializer::ArrayGlobalOffset dataOffset=Serializer::ArrayGlobalOffset_Unknown)
 Serialize (write) array data to a serializer.
 
void ReadSerializer (Serializer::SerializerBaseSSP serializerP, const std::string &name, Serializer::ArrayGlobalOffset &offset)
 Convenience overload that discards the dataOffset output.
 
void ReadSerializer (Serializer::SerializerBaseSSP serializerP, const std::string &name, Serializer::ArrayGlobalOffset &offset, Serializer::ArrayGlobalOffset &dataOffset)
 Deserialize (read) array data from a serializer.
 
ReadSerializerMetaResult ReadSerializerMeta (Serializer::SerializerBaseSSP serializerP, const std::string &name)
 Reads only metadata from a serialized array without reading data.
 
void __ReadSerializerStructuralAndResolveDataOffset (const Serializer::SerializerBaseSSP &serializerP, Serializer::ArrayGlobalOffset &offset, Serializer::ArrayGlobalOffset &dataOffset)
 Reads structural data (pRowStart / pRowSizes) and resolves dataOffset.
 
void __ReadSerializerDataAndPropagateOffset (const Serializer::SerializerBaseSSP &serializerP, Serializer::ArrayGlobalOffset &offset, Serializer::ArrayGlobalOffset &dataOffset)
 Reads flat data and propagates resolved offsets back to the caller.
 
void to_host ()
 Mirror the flat/structural buffers back to host memory.
 
void to_device (DeviceBackend backend=DeviceBackend::Host)
 Mirror the flat/structural buffers to a target device (e.g. CUDA).
 
void clear_device ()
 Release any device-side mirror of this array's buffers.
 
template<DeviceBackend B>
t_deviceView< B > deviceView ()
 Mutable device-callable view (Eigen::Map-style row access on GPU).
 
template<DeviceBackend B>
t_deviceViewConst< B > deviceView () const
 Const device-callable view. See non-const overload.
 
DeviceBackend device () const
 Current device backend the data is mirrored on, or Unknown if host-only.
 
template<DeviceBackend B>
iterator< B > begin ()
 Iterator to the first row, viewed on device backend B.
 
template<DeviceBackend B>
iterator< B > end ()
 Iterator one past the last row, viewed on device backend B.
 
- Public Member Functions inherited from DNDS::ObjectNaming
 ObjectNaming ()=default
 
 ObjectNaming (const ObjectNaming &)=default
 
 ObjectNaming (ObjectNaming &&)=default
 
ObjectNamingoperator= (const ObjectNaming &)=default
 
ObjectNamingoperator= (ObjectNaming &&)=default
 
 ~ObjectNaming ()=default
 
void setObjectName (const std::string &name)
 
const std::string & getObjectName () const
 
std::string getObjectIdentity (const std::string &sig) const
 

Public Attributes

t_pLGlobalMapping pLGlobalMapping
 Shared pointer to the global-offsets table. Populated by createGlobalMapping; may be pointed at an existing table to skip the collective setup.
 
MPIInfo mpi
 MPI context associated with this array (must be set before collectives).
 

Static Public Attributes

static const DataLayout _dataLayout = TArray::_dataLayout
 
- Static Public Attributes inherited from DNDS::ArrayLayout< T, _row_size, _row_max, _align >
static const rowsize al = _align
 
static const rowsize rs = _row_size
 
static const rowsize rm = _row_max
 
static const size_t sizeof_T = sizeof(value_type)
 
static const rowsize s_T = al == NoAlign ? sizeof_T : (sizeof_T / al + 1) * al
 
static const DataLayout _dataLayout = _GetDataLayout()
 
static const bool isCSR = _dataLayout == CSR
 

Additional Inherited Members

- Static Public Member Functions inherited from DNDS::Array< T, _row_size, _row_max, _align >
static constexpr bool IsCSR ()
 
static constexpr DataLayout GetDataLayoutStatic ()
 Compile-time layout tag (one of TABLE_StaticFixed, TABLE_Fixed, TABLE_StaticMax, TABLE_Max, CSR).
 
- Static Public Member Functions inherited from DNDS::ArrayLayout< T, _row_size, _row_max, _align >
static constexpr DataLayout _GetDataLayout ()
 Deduce the DataLayout tag from the template parameters.
 
static std::string GetArrayName ()
 Human-readable type identifier including element typeid, sizes, and alignment.
 
static std::string GetArraySignature ()
 Compiler-independent identifier used by serializers to tag an array.
 
static std::string GetArraySignatureRelaxed ()
 Signature with _row_size / _row_max replaced by DynamicSize.
 
static std::tuple< int, int, int, int > ParseArraySignatureTuple (const std::string &v)
 Parse a signature string into (sizeof_T, row_size, row_max, align).
 
static bool ArraySignatureIsCompatible (const std::string &v)
 Whether a stored signature can be read into this array type.
 
- Protected Member Functions inherited from DNDS::Array< T, _row_size, _row_max, _align >
bool IfCompressed_ () const
 
- Protected Attributes inherited from DNDS::Array< T, _row_size, _row_max, _align >
t_pRowStart _pRowStart
 
t_pRowSizes _pRowSizes
 
t_Data _data
 
DeviceBackend deviceBackend = DeviceBackend::Unknown
 
t_DataUncompressed _dataUncompressed
 
index _size = 0
 
rowsize _row_size_dynamic = 0
 

Detailed Description

template<class T, rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
class DNDS::ParArray< T, _row_size, _row_max, _align >

MPI-aware Array: adds a communicator, rank, and global index mapping.

Inherits everything from Array and layers on:

Typical usage:

auto father = std::make_shared<ParArray<real, 5>>(mpi);
father->Resize(nLocal);
father->createGlobalMapping(); // collective
index nGlobal = father->globalSize(); // total rows across ranks
Non-owning device-callable view of an Array, specialised per DeviceBackend.
MPIInfo mpi
MPI context associated with this array (must be set before collectives).
int64_t index
Global row / DOF index type (signed 64-bit; handles multi-billion-cell meshes).
Definition Defines.hpp:107
constexpr DNDS::index nLocal

Ghost (halo) data is not managed here; pair with ArrayTransformer or wrap in an ArrayPair for that.

See also
ArrayTransformer, ArrayPair, docs/architecture/array_infrastructure.md.

Definition at line 58 of file ArrayTransformer.hpp.

Member Typedef Documentation

◆ t_pArray

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
using DNDS::ParArray< T, _row_size, _row_max, _align >::t_pArray = ssp<TArray>

Definition at line 63 of file ArrayTransformer.hpp.

◆ t_pRowSizes

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
using DNDS::ParArray< T, _row_size, _row_max, _align >::t_pRowSizes = typename TArray::t_pRowSizes

Definition at line 74 of file ArrayTransformer.hpp.

◆ t_self

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
using DNDS::ParArray< T, _row_size, _row_max, _align >::t_self = ParArray<T, _row_size, _row_max, _align>

Definition at line 62 of file ArrayTransformer.hpp.

◆ TArray

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
using DNDS::ParArray< T, _row_size, _row_max, _align >::TArray = Array<T, _row_size, _row_max, _align>

Definition at line 61 of file ArrayTransformer.hpp.

Constructor & Destructor Documentation

◆ ParArray() [1/5]

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
DNDS::ParArray< T, _row_size, _row_max, _align >::ParArray ( const t_self R)
default

◆ ParArray() [2/5]

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
DNDS::ParArray< T, _row_size, _row_max, _align >::ParArray ( )
default

Default-construct an uninitialised ParArray; call setMPI and Resize later.

◆ ParArray() [3/5]

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
DNDS::ParArray< T, _row_size, _row_max, _align >::ParArray ( const MPIInfo n_mpi)
inline

Construct a ParArray bound to the given MPI context.

Definition at line 278 of file ArrayTransformer.hpp.

Here is the call graph for this function:

◆ ParArray() [4/5]

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
DNDS::ParArray< T, _row_size, _row_max, _align >::ParArray ( MPI_Datatype  n_dType,
MPI_int  n_TypeMult,
const MPIInfo n_mpi 
)
inline

Construct with a custom (MPI datatype, multiplier) pair.

Useful for element types whose in-memory layout differs from the default BasicType_To_MPIIntType<T>() deduction.

Definition at line 285 of file ArrayTransformer.hpp.

Here is the call graph for this function:

◆ ParArray() [5/5]

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
template<typename... Args>
DNDS::ParArray< T, _row_size, _row_max, _align >::ParArray ( ObjName  objName,
Args &&...  args 
)
inline

Named constructor: sets the object name for tracing/debugging. All existing constructor overloads are supported via perfect forwarding. Inherited by derived classes (ArrayAdjacency, ArrayEigenVector, etc.) through using t_base::t_base.

Usage: ParArray<index> arr(ObjName{"cell2node"}, mpi); ArrayAdjacency<> adj(ObjName{"cell2cell"}, mpi);

Definition at line 300 of file ArrayTransformer.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ Array() [1/3]

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
DNDS::Array< T, _row_size, _row_max, _align >::Array ( )
default

Default-constructed array: empty, no storage.

◆ Array() [2/3]

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
DNDS::Array< T, _row_size, _row_max, _align >::Array ( const self_type R)
inline

Copy constructor (same semantics as clone).

Definition at line 821 of file Array.hpp.

◆ Array() [3/3]

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
DNDS::Array< T, _row_size, _row_max, _align >::Array ( ObjName  objName)
inlineexplicit

Named constructor: sets the object name for tracing/debugging. Delegates to the default constructor, then sets the name.

Definition at line 160 of file Array.hpp.

◆ AssertConsistent()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
bool DNDS::ParArray< T, _row_size, _row_max, _align >::AssertConsistent ( )
inline

Check array consistency across all ranks.

Uses MPI_Allgather to verify that row sizes (for TABLE_Fixed and TABLE_Max layouts) and MPI type multipliers are the same on every rank. Intended as a post-setup sanity check before entering ghost exchange.

Warning
Must be called collectively. O(nRanks) memory and communication.
Returns
true Always (failures are reported via DNDS_check_throw_info).

Definition at line 328 of file ArrayTransformer.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AssertDataType()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
void DNDS::ParArray< T, _row_size, _row_max, _align >::AssertDataType ( )
inline

Assert the MPI datatype matches sizeof(T) exactly.

Called from constructors / setMPI / setDataType. Guards against size mismatches that would silently corrupt comms.

Definition at line 309 of file ArrayTransformer.hpp.

Here is the caller graph for this function:

◆ clone()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
void DNDS::ParArray< T, _row_size, _row_max, _align >::clone ( const t_self R)
inline

Copy-assign from another ParArray. Shallow copy semantics (mirrors Arrayclone): shares structural/data buffers.

Definition at line 85 of file ArrayTransformer.hpp.

Here is the call graph for this function:

◆ createGlobalMapping()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
void DNDS::ParArray< T, _row_size, _row_max, _align >::createGlobalMapping ( )
inline

Collective: build the global offsets table.

Every rank broadcasts its local Size(); after the call, pLGlobalMapping holds the full GlobalOffsetsMapping::RLengths / GlobalOffsetsMapping::ROffsets on every rank. Must be invoked before globalSize, ArrayTransformercreateFatherGlobalMapping, or any CSR collective serialization.

Warning
Must be called collectively on mpi.comm.

Definition at line 363 of file ArrayTransformer.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDataType()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
MPI_Datatype DNDS::ParArray< T, _row_size, _row_max, _align >::getDataType ( )
inline

MPI element datatype used for ghost exchange (deduced from T).

Definition at line 238 of file ArrayTransformer.hpp.

◆ getMPI() [1/2]

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
MPIInfo & DNDS::ParArray< T, _row_size, _row_max, _align >::getMPI ( )
inline

Mutable MPI context accessor.

Definition at line 255 of file ArrayTransformer.hpp.

◆ getMPI() [2/2]

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
const MPIInfo & DNDS::ParArray< T, _row_size, _row_max, _align >::getMPI ( ) const
inline

Read-only MPI context accessor.

Definition at line 261 of file ArrayTransformer.hpp.

◆ getTypeMult()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
MPI_int DNDS::ParArray< T, _row_size, _row_max, _align >::getTypeMult ( )
inline

Per-element count multiplier that goes with getDataType.

Definition at line 240 of file ArrayTransformer.hpp.

◆ globalSize()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
index DNDS::ParArray< T, _row_size, _row_max, _align >::globalSize ( ) const
inline

Returns the total global size (sum of sizes across all ranks).

Note
This method was previously collective (using MPI_Allreduce) but is now non-collective. It requires that the global mapping has been created first (which is done via the collective createGlobalMapping() method on the underlying ParArray).
Precondition
createGlobalMapping() must have been called on the underlying array.
Returns
index The global size (cached from global mapping).

Definition at line 382 of file ArrayTransformer.hpp.

Here is the caller graph for this function:

◆ operator=()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
t_self & DNDS::ParArray< T, _row_size, _row_max, _align >::operator= ( const t_self R)
default
Here is the caller graph for this function:

◆ ReadSerializer()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
void DNDS::ParArray< T, _row_size, _row_max, _align >::ReadSerializer ( Serializer::SerializerBaseSSP  serializerP,
const std::string &  name,
Serializer::ArrayGlobalOffset offset 
)
inline

Deserialize (read) the parallel array with MPI-aware metadata.

Resolves the input offset before delegating to Array::ReadSerializer:

  • EvenSplit: reads sizeGlobal, computes even-split range, resolves to isDist({localRows, globalRowStart}).
  • CSR with collective serializer: reads per-rank size, computes row offset via MPI_Scan, resolves to isDist. This is required because CSR pRowStart is stored in global coordinates.
  • Otherwise: passes offset through unchanged.

Asserts MPI context consistency with the serializer.

Parameters
serializerPSerializer instance.
nameSub-path name for this array.
offset[in/out] Row-level offset. EvenSplit is resolved here. After return, reflects the resolved row-level position.

Definition at line 182 of file ArrayTransformer.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDataType()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
void DNDS::ParArray< T, _row_size, _row_max, _align >::setDataType ( MPI_Datatype  n_dType,
MPI_int  n_TypeMult 
)
inline

Override the deduced MPI datatype and element multiplier (advanced; needed for custom compound element types).

Definition at line 268 of file ArrayTransformer.hpp.

◆ setMPI()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
void DNDS::ParArray< T, _row_size, _row_max, _align >::setMPI ( const MPIInfo n_mpi)
inline

Install the MPI context after default construction.

Calls AssertDataType to verify the deduced datatype / multiplier match sizeof(T).

Definition at line 248 of file ArrayTransformer.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteSerializer()

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
void DNDS::ParArray< T, _row_size, _row_max, _align >::WriteSerializer ( Serializer::SerializerBaseSSP  serializerP,
const std::string &  name,
Serializer::ArrayGlobalOffset  offset 
)
inline

Serialize (write) the parallel array with MPI-aware metadata.

Delegates to Array::WriteSerializer for metadata, structure, and data. Additionally for collective (H5) serializers:

  • Writes sizeGlobal (sum of all ranks' _size) as a scalar attribute.
  • For CSR: computes global data offsets via MPI_Scan and writes pRowStart in global data coordinates as a contiguous (nRowsGlobal+1) dataset. Non-last ranks write nRows entries (dropping the redundant tail), last rank writes nRows+1 (including the global data total).

Asserts MPI context consistency with the serializer.

Parameters
serializerPSerializer instance.
nameSub-path name for this array.
offset[in] Row-level partitioning (typically ArrayGlobalOffset_Parts).

Definition at line 106 of file ArrayTransformer.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _dataLayout

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
const DataLayout DNDS::ParArray< T, _row_size, _row_max, _align >::_dataLayout = TArray::_dataLayout
static

Definition at line 64 of file ArrayTransformer.hpp.

◆ mpi

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
MPIInfo DNDS::ParArray< T, _row_size, _row_max, _align >::mpi

MPI context associated with this array (must be set before collectives).

Definition at line 73 of file ArrayTransformer.hpp.

◆ pLGlobalMapping

template<class T , rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
t_pLGlobalMapping DNDS::ParArray< T, _row_size, _row_max, _align >::pLGlobalMapping

Shared pointer to the global-offsets table. Populated by createGlobalMapping; may be pointed at an existing table to skip the collective setup.

Definition at line 71 of file ArrayTransformer.hpp.


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