IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
ippl::detail::Archive< Properties > Class Template Reference

#include <Archive.h>

Inheritance diagram for ippl::detail::Archive< Properties >:
Collaboration diagram for ippl::detail::Archive< Properties >:

Public Types

using buffer_type = typename ViewType<char, 1, Properties...>::view_type
using pointer_type = typename buffer_type::pointer_type

Public Member Functions

 Archive (size_type size=0)
template<typename T, class... ViewArgs>
void serialize (const Kokkos::View< T *, ViewArgs... > &view, size_type nsends)
template<typename T, unsigned Dim, class... ViewArgs>
void serialize (const Kokkos::View< Vector< T, Dim > *, ViewArgs... > &view, size_type nsends)
template<typename T, class... ViewArgs>
void deserialize (Kokkos::View< T *, ViewArgs... > &view, size_type nrecvs)
template<typename T, unsigned Dim, class... ViewArgs>
void deserialize (Kokkos::View< Vector< T, Dim > *, ViewArgs... > &view, size_type nrecvs)
pointer_type getBuffer ()
size_type getSize () const
size_type getBufferSize () const
void resizeBuffer (size_type size)
void reallocBuffer (size_type size)
void resetWritePos ()
void resetReadPos ()
 ~Archive ()=default

Private Attributes

size_type writepos_m
 write position for serialization
size_type readpos_m
 read position for deserialization
buffer_type buffer_m
 serialized data

Detailed Description

template<class... Properties>
class ippl::detail::Archive< Properties >

Definition at line 29 of file Archive.h.

Member Typedef Documentation

◆ buffer_type

template<class... Properties>
using ippl::detail::Archive< Properties >::buffer_type = typename ViewType<char, 1, Properties...>::view_type

Definition at line 31 of file Archive.h.

◆ pointer_type

template<class... Properties>
using ippl::detail::Archive< Properties >::pointer_type = typename buffer_type::pointer_type

Definition at line 32 of file Archive.h.

Constructor & Destructor Documentation

◆ Archive()

template<class... Properties>
ippl::detail::Archive< Properties >::Archive ( size_type size = 0)

Definition at line 13 of file Archive.hpp.

References buffer_m, readpos_m, and writepos_m.

◆ ~Archive()

template<class... Properties>
ippl::detail::Archive< Properties >::~Archive ( )
default

Member Function Documentation

◆ deserialize() [1/2]

template<class... Properties>
template<typename T, class... ViewArgs>
void ippl::detail::Archive< Properties >::deserialize ( Kokkos::View< T *, ViewArgs... > & view,
size_type nrecvs )

Deserialize.

Parameters
viewto put data to

Definition at line 63 of file Archive.hpp.

References buffer_m, and readpos_m.

Referenced by ippl::detail::FieldBufferData< T, ViewArgs... >::deserialize(), and ippl::ParticleAttrib< T >::deserialize().

Here is the caller graph for this function:

◆ deserialize() [2/2]

template<class... Properties>
template<typename T, unsigned Dim, class... ViewArgs>
void ippl::detail::Archive< Properties >::deserialize ( Kokkos::View< Vector< T, Dim > *, ViewArgs... > & view,
size_type nrecvs )

Deserialize vector attributes

Remarks
We need a specialized function for vectors since the vector is not a trivially copyable class. Hence, we cannot use std::memcpy directly.
Parameters
viewto put data to

Definition at line 85 of file Archive.hpp.

References buffer_m, Dim, and readpos_m.

◆ getBuffer()

template<class... Properties>
pointer_type ippl::detail::Archive< Properties >::getBuffer ( )
inline
Returns
a pointer to the data of the buffer

Definition at line 76 of file Archive.h.

◆ getBufferSize()

template<class... Properties>
size_type ippl::detail::Archive< Properties >::getBufferSize ( ) const
inline

Definition at line 83 of file Archive.h.

◆ getSize()

template<class... Properties>
size_type ippl::detail::Archive< Properties >::getSize ( ) const
inline
Returns
the size of the buffer

Definition at line 81 of file Archive.h.

◆ reallocBuffer()

template<class... Properties>
void ippl::detail::Archive< Properties >::reallocBuffer ( size_type size)
inline

Definition at line 87 of file Archive.h.

◆ resetReadPos()

template<class... Properties>
void ippl::detail::Archive< Properties >::resetReadPos ( )
inline

Definition at line 90 of file Archive.h.

◆ resetWritePos()

template<class... Properties>
void ippl::detail::Archive< Properties >::resetWritePos ( )
inline

Definition at line 89 of file Archive.h.

◆ resizeBuffer()

template<class... Properties>
void ippl::detail::Archive< Properties >::resizeBuffer ( size_type size)
inline

Definition at line 85 of file Archive.h.

◆ serialize() [1/2]

template<class... Properties>
template<typename T, class... ViewArgs>
void ippl::detail::Archive< Properties >::serialize ( const Kokkos::View< T *, ViewArgs... > & view,
size_type nsends )

Serialize.

Parameters
viewto take data from.

Definition at line 20 of file Archive.hpp.

References buffer_m, and writepos_m.

Referenced by ippl::detail::FieldBufferData< T, ViewArgs... >::serialize(), and ippl::ParticleAttrib< T >::serialize().

Here is the caller graph for this function:

◆ serialize() [2/2]

template<class... Properties>
template<typename T, unsigned Dim, class... ViewArgs>
void ippl::detail::Archive< Properties >::serialize ( const Kokkos::View< Vector< T, Dim > *, ViewArgs... > & view,
size_type nsends )

Serialize vector attributes

Remarks
We need a specialized function for vectors since the vector is not a trivially copyable class. Hence, we cannot use std::memcpy directly.
Parameters
viewto take data from.

Definition at line 37 of file Archive.hpp.

References buffer_m, Dim, and writepos_m.

Member Data Documentation

◆ buffer_m

template<class... Properties>
buffer_type ippl::detail::Archive< Properties >::buffer_m
private

serialized data

Definition at line 100 of file Archive.h.

Referenced by Archive(), deserialize(), deserialize(), serialize(), and serialize().

◆ readpos_m

template<class... Properties>
size_type ippl::detail::Archive< Properties >::readpos_m
private

read position for deserialization

Definition at line 98 of file Archive.h.

Referenced by Archive(), deserialize(), and deserialize().

◆ writepos_m

template<class... Properties>
size_type ippl::detail::Archive< Properties >::writepos_m
private

write position for serialization

Definition at line 96 of file Archive.h.

Referenced by Archive(), serialize(), and serialize().


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