OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
ippl::detail::Archive< Properties > Class Template Reference

#include <Archive.h>

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

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 More...
 
size_type readpos_m
 read position for deserialization More...
 
buffer_type buffer_m
 serialized data More...
 

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.

◆ ~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 ippl::fence(), and ippl::parallel_for().

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

Here is the call 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 Dim, ippl::fence(), and ippl::parallel_for().

Here is the call graph for this function:

◆ 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.

References ippl::detail::Archive< Properties >::buffer_m.

◆ getBufferSize()

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

Definition at line 83 of file Archive.h.

References ippl::detail::Archive< Properties >::buffer_m.

◆ 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.

References ippl::detail::Archive< Properties >::writepos_m.

◆ reallocBuffer()

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

Definition at line 87 of file Archive.h.

References ippl::detail::Archive< Properties >::buffer_m.

◆ resetReadPos()

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

Definition at line 90 of file Archive.h.

References ippl::detail::Archive< Properties >::readpos_m.

◆ resetWritePos()

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

Definition at line 89 of file Archive.h.

References ippl::detail::Archive< Properties >::writepos_m.

◆ resizeBuffer()

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

Definition at line 85 of file Archive.h.

References ippl::detail::Archive< Properties >::buffer_m.

◆ 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 ippl::fence(), and ippl::parallel_for().

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

Here is the call 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 Dim, ippl::fence(), and ippl::parallel_for().

Here is the call graph for this function:

Member Data Documentation

◆ buffer_m

◆ 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 ippl::detail::Archive< Properties >::resetReadPos().

◆ 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 ippl::detail::Archive< Properties >::getSize(), and ippl::detail::Archive< Properties >::resetWritePos().


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