|
DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
|
ParArray<real, N> whose operator[] returns an Eigen::Map<Vector>.
More...
#include <ArrayEigenVector.hpp>
Classes | |
| class | iterator |
| Element iterator for ArrayEigenVector, yielding Eigen::Map per row. More... | |
Public Member Functions | |
| ArrayEigenVector (const t_self &R)=default | |
| t_self & | operator= (const t_self &R)=default |
| void | clone (const t_self &R) |
| Shallow clone (same semantics as assignment). | |
| t_EigenMap | operator[] (index i) |
| Mutable row-as-Eigen-map accessor. | |
| t_EigenMap_Const | operator[] (index i) const |
| Const row-as-Eigen-map accessor. | |
| template<DeviceBackend B> | |
| auto | deviceView () |
| because no extra data than Array<> | |
| template<DeviceBackend B> | |
| auto | deviceView () const |
| Const device view. | |
| template<DeviceBackend B> | |
| iterator< B > | begin () |
| template<DeviceBackend B> | |
| iterator< B > | end () |
| void | ReadSerializer (Serializer::SerializerBaseSSP serializerP, const std::string &name, Serializer::ArrayGlobalOffset &offset) |
| Deserialize (read) the parallel array with MPI-aware metadata. | |
| void | WriteSerializer (Serializer::SerializerBaseSSP serializerP, const std::string &name, Serializer::ArrayGlobalOffset offset) |
| Serialize (write) the parallel array with MPI-aware metadata. | |
Public Member Functions inherited from DNDS::ParArray< T, _row_size, _row_max, _align > | |
| ParArray (const t_self &R)=default | |
| t_self & | operator= (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. | |
| MPIInfo & | getMPI () |
| Mutable MPI context accessor. | |
| const MPIInfo & | getMPI () 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_Data & | RawDataVector () |
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_type & | operator= (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 | |
| ObjectNaming & | operator= (const ObjectNaming &)=default |
| ObjectNaming & | operator= (ObjectNaming &&)=default |
| ~ObjectNaming ()=default | |
| void | setObjectName (const std::string &name) |
| const std::string & | getObjectName () const |
| std::string | getObjectIdentity (const std::string &sig) const |
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. | |
Public Attributes inherited from DNDS::ParArray< T, _row_size, _row_max, _align > | |
| 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 inherited from DNDS::ParArray< T, _row_size, _row_max, _align > | |
| 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 |
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 |
ParArray<real, N> whose operator[] returns an Eigen::Map<Vector>.
Each row stores an N-component vector of real. operator[] produces an Eigen::Map so user code can write natural linear-algebra expressions directly on array storage without copies:
Used chiefly for node coordinates (ArrayEigenVectorPair<3>) and per-cell fluxes.
| _vec_size | Vector length. 1, small fixed size, or DynamicSize. |
Definition at line 37 of file ArrayEigenVector.hpp.
| using DNDS::ArrayEigenVector< _vec_size, _row_max, _align >::t_base = ParArray<real, _vec_size, _row_max, _align> |
Definition at line 41 of file ArrayEigenVector.hpp.
| using DNDS::ArrayEigenVector< _vec_size, _row_max, _align >::t_copy = t_EigenVector |
Canonical "snapshot" type produced by value-returning helpers.
Definition at line 57 of file ArrayEigenVector.hpp.
| using DNDS::ArrayEigenVector< _vec_size, _row_max, _align >::t_deviceView = ArrayEigenVectorDeviceView<B, real, _vec_size, _row_max, _align> |
Definition at line 45 of file ArrayEigenVector.hpp.
| using DNDS::ArrayEigenVector< _vec_size, _row_max, _align >::t_deviceViewConst = ArrayEigenVectorDeviceView<B, const real, _vec_size, _row_max, _align> |
Definition at line 47 of file ArrayEigenVector.hpp.
| using DNDS::ArrayEigenVector< _vec_size, _row_max, _align >::t_EigenMap = typename t_deviceView<DeviceBackend::Host>::t_EigenMap |
Mutable Eigen map view onto a row.
Definition at line 52 of file ArrayEigenVector.hpp.
| using DNDS::ArrayEigenVector< _vec_size, _row_max, _align >::t_EigenMap_Const = typename t_deviceView<DeviceBackend::Host>::t_EigenMap_Const |
Const Eigen map view onto a row.
Definition at line 54 of file ArrayEigenVector.hpp.
| using DNDS::ArrayEigenVector< _vec_size, _row_max, _align >::t_EigenVector = typename t_deviceView<DeviceBackend::Host>::t_EigenVector |
Owning Eigen vector matching the row shape.
Definition at line 50 of file ArrayEigenVector.hpp.
| using DNDS::ArrayEigenVector< _vec_size, _row_max, _align >::t_self = ArrayEigenVector<_vec_size, _row_max, _align> |
Definition at line 40 of file ArrayEigenVector.hpp.
|
inline |
Definition at line 126 of file ArrayEigenVector.hpp.
Shallow clone (same semantics as assignment).
Definition at line 66 of file ArrayEigenVector.hpp.
|
inline |
because no extra data than Array<>
Mutable device view (Eigen::Map rows on the given backend).
Definition at line 88 of file ArrayEigenVector.hpp.
|
inline |
Const device view.
Definition at line 95 of file ArrayEigenVector.hpp.
|
inline |
|
default |
|
inline |
Mutable row-as-Eigen-map accessor.
Definition at line 72 of file ArrayEigenVector.hpp.
|
inline |
Const row-as-Eigen-map accessor.
Definition at line 78 of file ArrayEigenVector.hpp.
|
inline |
Deserialize (read) the parallel array with MPI-aware metadata.
Resolves the input offset before delegating to Array::ReadSerializer:
sizeGlobal, computes even-split range, resolves to isDist({localRows, globalRowStart}).Asserts MPI context consistency with the serializer.
| serializerP | Serializer instance. |
| name | Sub-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.
|
inline |
Serialize (write) the parallel array with MPI-aware metadata.
Delegates to Array::WriteSerializer for metadata, structure, and data. Additionally for collective (H5) serializers:
sizeGlobal (sum of all ranks' _size) as a scalar attribute.Asserts MPI context consistency with the serializer.
| serializerP | Serializer instance. |
| name | Sub-path name for this array. |
| offset | [in] Row-level partitioning (typically ArrayGlobalOffset_Parts). |
Definition at line 106 of file ArrayTransformer.hpp.