Implementation of a contiguous in-memory serialization buffer. More...
Classes | |
| struct | SizeInfo |
| Information about the allocated size with and without padding. More... | |
Public Member Functions | |
| Span< Real > | getRealBuffer () override |
| Span< Int16 > | getInt16Buffer () override |
| Span< Int32 > | getInt32Buffer () override |
| Span< Int64 > | getInt64Buffer () override |
| Span< Byte > | getByteBuffer () override |
| Span< Int8 > | getInt8Buffer () override |
| Span< Float16 > | getFloat16Buffer () override |
| Span< BFloat16 > | getBFloat16Buffer () override |
| Span< Float32 > | getFloat32Buffer () override |
| Span< Float128 > | getFloat128Buffer () override |
| Span< Int128 > | getInt128Buffer () override |
| void | allocateBuffer (Int64 nb_real, Int64 nb_int16, Int64 nb_int32, Int64 nb_int64, Int64 nb_byte) override |
| void | allocateBuffer (Int64 nb_real, Int64 nb_int16, Int64 nb_int32, Int64 nb_int64, Int64 nb_byte, Int64 nb_int8, Int64 nb_float16, Int64 nb_bfloat16, Int64 nb_float32, Int64 nb_float128, Int64 nb_int128) override |
| void | copy (Impl *rhs) override |
| Span< Byte > | globalBuffer () override |
| Span< const Byte > | globalBuffer () const override |
| ConstArrayView< Int64 > | sizesBuffer () const override |
| void | preallocate (Int64 size) override |
| void | releaseBuffer () override |
| void | setFromSizes () override |
| ConstArrayView< Byte > | copyAndGetSizesBuffer () override |
| Int64 | totalSize () const override |
| void | printSizes (std::ostream &o) const override |
| Public Member Functions inherited from Arcane::BasicSerializer::Impl | |
| virtual void | copy (Impl *rhs)=0 |
Public Attributes | |
| UniqueArray< Byte > | m_buffer |
| Array containing the serialized data. | |
| Span< Byte > | m_buffer_view |
| View aligned to ALIGN_SIZE of m_buffer. | |
| Span< Real > | m_real_view |
| View on reals;. | |
| Span< Int64 > | m_int64_view |
| View on 64-bit integers. | |
| Span< Int32 > | m_int32_view |
| View on 32-bit integers. | |
| Span< Int16 > | m_int16_view |
| View on 16-bit integers. | |
| Span< Byte > | m_byte_view |
| View on bytes. | |
| Span< Int8 > | m_int8_view |
| View on Int8. | |
| Span< Float16 > | m_float16_view |
| View on Float16. | |
| Span< BFloat16 > | m_bfloat16_view |
| View on BFloat16. | |
| Span< Float32 > | m_float32_view |
| View on Float32. | |
| Span< Float128 > | m_float128_view |
| View on Float128. | |
| Span< Int128 > | m_int128_view |
| View on Int128. | |
| ArrayView< Int64 > | m_sizes_view |
| View for sizes (must be a multiple of ALIGN_SIZE);. | |
| Int64 | m_size_copy_buffer [NB_SIZE_ELEM] |
| Copy of sizes used for multi-part sending. | |
Protected Member Functions | |
| SizeInfo | getPaddingSize (Int64 nb_elem, Int64 elem_size) |
| void | _fillPadding (Int64 position, SizeInfo size_info) |
| Fills the padding zones corresponding to the padding with a fixed value. This prevents having uninitialized values. | |
| void | _fillPadding (Span< Byte > buf) |
| void | _checkAlignment () |
| void | _checkAddr (void *ptr) |
| void | _printAlignment () |
| void | _printAddr (void *ptr, const String &name) |
| void | _allocBuffer (Int64 size) |
Static Private Attributes | |
| static constexpr int | IDX_TAG = 0 |
| Index of the tag to identify that it is a serialization. | |
| static constexpr Int64 | SERIALIZE_TAG = 0x7a9b3cd0 |
| Tag identifying the serialization. | |
| static constexpr int | IDX_VERSION = 1 |
| Serialization version. | |
| static constexpr int | IDX_RESERVED1 = 2 |
| Field reserved for additional information (e.g., compression). | |
| static constexpr int | IDX_TOTAL_SIZE = 3 |
| Position of the field indicating the total size of the serialization. | |
| static constexpr int | IDX_NB_BYTE = 4 |
| static constexpr int | IDX_NB_FLOAT16 = 5 |
| static constexpr int | IDX_NB_FLOAT32 = 6 |
| static constexpr int | IDX_NB_FLOAT64 = 7 |
| static constexpr int | IDX_NB_FLOAT128 = 8 |
| static constexpr int | IDX_NB_INT16 = 9 |
| static constexpr int | IDX_NB_INT32 = 10 |
| static constexpr int | IDX_NB_INT64 = 11 |
| static constexpr int | IDX_NB_INT128 = 12 |
| static constexpr int | IDX_NB_INT8 = 13 |
| static constexpr int | IDX_NB_BFLOAT16 = 14 |
| static constexpr int | IDX_POS_BYTE = 32 |
| static constexpr int | IDX_POS_FLOAT16 = 33 |
| static constexpr int | IDX_POS_FLOAT32 = 34 |
| static constexpr int | IDX_POS_FLOAT64 = 35 |
| static constexpr int | IDX_POS_FLOAT128 = 36 |
| static constexpr int | IDX_POS_INT16 = 37 |
| static constexpr int | IDX_POS_INT32 = 38 |
| static constexpr int | IDX_POS_INT64 = 39 |
| static constexpr int | IDX_POS_INT128 = 40 |
| static constexpr int | IDX_POS_INT8 = 41 |
| static constexpr int | IDX_POS_BFLOAT16 = 42 |
| static constexpr Integer | NB_SIZE_ELEM = 128 |
| static constexpr Integer | ALIGN_SIZE = BasicSerializer::paddingSize() |
Implementation of a contiguous in-memory serialization buffer.
This implementation allows data to be serialized into a contiguous memory area and thus sent in a single operation, for example via MPI. The buffer consists of a first part containing NB_SIZE_ELEM objects of type Integer. This part contains the number of elements serialized for each type (Real, Int64, Int32, Int16, Byte). The second part contains the actual serialized data.
When this class is used in the context of an MPI call, the array m_size_copy_buffer is used to send the sizes. during the first message when the complete message is sent in several parts. MPI standard indeed indicates that a buffer used during an MPI call must not be used until that call is finished.
Definition at line 48 of file BasicSerializer.cc.
|
inlineprotected |
Definition at line 493 of file BasicSerializer.cc.
|
inlineprotected |
Definition at line 460 of file BasicSerializer.cc.
|
inlineprotected |
Definition at line 445 of file BasicSerializer.cc.
|
inlineprotected |
Fills the padding zones corresponding to the padding with a fixed value. This prevents having uninitialized values.
_allocBuffer() must be called beforehand
Definition at line 429 of file BasicSerializer.cc.
References _fillPadding(), and m_buffer_view.
Referenced by _fillPadding().
Definition at line 436 of file BasicSerializer.cc.
|
inlineprotected |
Definition at line 487 of file BasicSerializer.cc.
|
inlineprotected |
Definition at line 469 of file BasicSerializer.cc.
|
inlineoverridevirtual |
Implements Arcane::BasicSerializer::Impl.
Definition at line 149 of file BasicSerializer.cc.
|
inlineoverridevirtual |
Implements Arcane::BasicSerializer::Impl.
Definition at line 162 of file BasicSerializer.cc.
|
inlineoverride |
Definition at line 275 of file BasicSerializer.cc.
|
inlineoverridevirtual |
Implements Arcane::BasicSerializer::Impl.
Definition at line 368 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 144 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 141 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 146 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 143 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 145 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 147 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 138 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 139 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 140 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 142 of file BasicSerializer.cc.
|
inlineprotected |
Definition at line 406 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 137 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 297 of file BasicSerializer.cc.
Implements Arcane::BasicSerializer::Impl.
Definition at line 292 of file BasicSerializer.cc.
|
inlineoverridevirtual |
Implements Arcane::BasicSerializer::Impl.
Definition at line 307 of file BasicSerializer.cc.
|
inlineoverridevirtual |
Implements Arcane::BasicSerializer::Impl.
Definition at line 383 of file BasicSerializer.cc.
|
inlineoverridevirtual |
Implements Arcane::BasicSerializer::Impl.
Definition at line 313 of file BasicSerializer.cc.
|
inlineoverridevirtual |
Implements Arcane::BasicSerializer::Impl.
Definition at line 318 of file BasicSerializer.cc.
|
inlineoverridevirtual |
Implements Arcane::BasicSerializer::Impl.
Definition at line 302 of file BasicSerializer.cc.
|
inlineoverridevirtual |
Implements Arcane::BasicSerializer::Impl.
Definition at line 378 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 92 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 73 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 63 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 67 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 64 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 65 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 66 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 71 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 68 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 69 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 70 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 72 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 86 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 76 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 80 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 77 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 78 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 79 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 84 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 81 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 82 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 83 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 85 of file BasicSerializer.cc.
|
staticconstexprprivate |
Field reserved for additional information (e.g., compression).
Definition at line 58 of file BasicSerializer.cc.
|
staticconstexprprivate |
Index of the tag to identify that it is a serialization.
Definition at line 52 of file BasicSerializer.cc.
|
staticconstexprprivate |
Position of the field indicating the total size of the serialization.
Definition at line 61 of file BasicSerializer.cc.
|
staticconstexprprivate |
Serialization version.
Definition at line 56 of file BasicSerializer.cc.
View on BFloat16.
Definition at line 120 of file BasicSerializer.cc.
| UniqueArray<Byte> Arcane::BasicSerializerNewImpl::m_buffer |
Array containing the serialized data.
Definition at line 108 of file BasicSerializer.cc.
View aligned to ALIGN_SIZE of m_buffer.
Definition at line 111 of file BasicSerializer.cc.
Referenced by _fillPadding().
View on bytes.
Definition at line 117 of file BasicSerializer.cc.
View on Float128.
Definition at line 122 of file BasicSerializer.cc.
View on Float16.
Definition at line 119 of file BasicSerializer.cc.
View on Float32.
Definition at line 121 of file BasicSerializer.cc.
View on Int128.
Definition at line 123 of file BasicSerializer.cc.
View on 16-bit integers.
Definition at line 116 of file BasicSerializer.cc.
View on 32-bit integers.
Definition at line 115 of file BasicSerializer.cc.
View on 64-bit integers.
Definition at line 114 of file BasicSerializer.cc.
View on Int8.
Definition at line 118 of file BasicSerializer.cc.
View on reals;.
Definition at line 113 of file BasicSerializer.cc.
| Int64 Arcane::BasicSerializerNewImpl::m_size_copy_buffer[NB_SIZE_ELEM] |
Copy of sizes used for multi-part sending.
Only the first elements (currently 40) are used, but the size of this structure must be a multiple of ALIGN_SIZE.
Definition at line 133 of file BasicSerializer.cc.
View for sizes (must be a multiple of ALIGN_SIZE);.
Definition at line 125 of file BasicSerializer.cc.
|
staticconstexprprivate |
Definition at line 88 of file BasicSerializer.cc.
|
staticconstexprprivate |
Tag identifying the serialization.
Definition at line 54 of file BasicSerializer.cc.