IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
ippl::detail::HaloCells< T, Dim, ViewArgs > Class Template Reference

#include <HaloCells.h>

Inheritance diagram for ippl::detail::HaloCells< T, Dim, ViewArgs >:
Collaboration diagram for ippl::detail::HaloCells< T, Dim, ViewArgs >:

Classes

struct  assign
struct  lhs_plus_assign
struct  rhs_plus_assign

Public Types

enum  SendOrder { HALO_TO_INTERNAL , INTERNAL_TO_HALO , HALO_TO_INTERNAL_NOGHOST }
using view_type = typename detail::ViewType<T, Dim, ViewArgs...>::view_type
using Layout_t = FieldLayout<Dim>
using bound_type = typename Layout_t::bound_type
using databuffer_type = FieldBufferData<T, ViewArgs...>

Public Member Functions

 HaloCells ()
void accumulateHalo (view_type &view, Layout_t *layout)
void accumulateHalo_noghost (view_type &view, Layout_t *layout, int nghost)
void fillHalo (view_type &, Layout_t *layout)
void pack (const bound_type &range, const view_type &view, databuffer_type &fd, size_type &nsends)
template<typename Op>
void unpack (const bound_type &range, const view_type &view, databuffer_type &fd)
template<typename Op>
void applyPeriodicSerialDim (view_type &view, const Layout_t *layout, const int nghost)

Private Member Functions

template<class Op>
void exchangeBoundaries (view_type &view, Layout_t *layout, SendOrder order, int nghost=1)
auto makeSubview (const view_type &view, const bound_type &intersect)

Private Attributes

databuffer_type haloData_m

Detailed Description

template<typename T, unsigned Dim, class... ViewArgs>
class ippl::detail::HaloCells< T, Dim, ViewArgs >

Definition at line 39 of file HaloCells.h.

Member Typedef Documentation

◆ bound_type

template<typename T, unsigned Dim, class... ViewArgs>
using ippl::detail::HaloCells< T, Dim, ViewArgs >::bound_type = typename Layout_t::bound_type

Definition at line 43 of file HaloCells.h.

◆ databuffer_type

template<typename T, unsigned Dim, class... ViewArgs>
using ippl::detail::HaloCells< T, Dim, ViewArgs >::databuffer_type = FieldBufferData<T, ViewArgs...>

Definition at line 44 of file HaloCells.h.

◆ Layout_t

template<typename T, unsigned Dim, class... ViewArgs>
using ippl::detail::HaloCells< T, Dim, ViewArgs >::Layout_t = FieldLayout<Dim>

Definition at line 42 of file HaloCells.h.

◆ view_type

template<typename T, unsigned Dim, class... ViewArgs>
using ippl::detail::HaloCells< T, Dim, ViewArgs >::view_type = typename detail::ViewType<T, Dim, ViewArgs...>::view_type

Definition at line 41 of file HaloCells.h.

Member Enumeration Documentation

◆ SendOrder

template<typename T, unsigned Dim, class... ViewArgs>
enum ippl::detail::HaloCells::SendOrder
Enumerator
HALO_TO_INTERNAL 
INTERNAL_TO_HALO 
HALO_TO_INTERNAL_NOGHOST 

Definition at line 46 of file HaloCells.h.

Constructor & Destructor Documentation

◆ HaloCells()

template<typename T, unsigned Dim, class... ViewArgs>
ippl::detail::HaloCells< T, Dim, ViewArgs >::HaloCells ( )

Definition at line 16 of file HaloCells.hpp.

Member Function Documentation

◆ accumulateHalo()

template<typename T, unsigned Dim, class... ViewArgs>
void ippl::detail::HaloCells< T, Dim, ViewArgs >::accumulateHalo ( view_type & view,
Layout_t * layout )

Send halo data to internal cells. This operation uses assign_plus functor to assign the data.

Parameters
viewthe original field data
layoutthe field layout storing the domain decomposition

Definition at line 19 of file HaloCells.hpp.

References exchangeBoundaries(), and HALO_TO_INTERNAL.

Here is the call graph for this function:

◆ accumulateHalo_noghost()

template<typename T, unsigned Dim, class... ViewArgs>
void ippl::detail::HaloCells< T, Dim, ViewArgs >::accumulateHalo_noghost ( view_type & view,
Layout_t * layout,
int nghost )

Send halo data to internal cells for only the physical cells along that dimension. The halo cells on the corners are not sent. This operation uses assign_plus functor to assign the data.

Parameters
viewthe original field data
layoutthe field layout storing the domain decomposition
nghostthe number of ghost cells

Definition at line 24 of file HaloCells.hpp.

References exchangeBoundaries(), and HALO_TO_INTERNAL_NOGHOST.

Here is the call graph for this function:

◆ applyPeriodicSerialDim()

template<typename T, unsigned Dim, class... ViewArgs>
template<typename Op>
void ippl::detail::HaloCells< T, Dim, ViewArgs >::applyPeriodicSerialDim ( view_type & view,
const Layout_t * layout,
const int nghost )

Apply all periodic boundary conditions for the serial dimensions. Used in case of both fillHalo and accumulateHalo with the help of operator as template parameter.

Definition at line 234 of file HaloCells.hpp.

References ippl::apply(), ippl::FieldLayout< Dim >::comm, ippl::createRangePolicy(), Dim, ippl::FieldLayout< Dim >::getDomain(), ippl::FieldLayout< Dim >::getHostLocalDomains(), ippl::parallel_for(), and ippl::mpi::Communicator::rank().

Here is the call graph for this function:

◆ exchangeBoundaries()

template<typename T, unsigned Dim, class... ViewArgs>
template<class Op>
void ippl::detail::HaloCells< T, Dim, ViewArgs >::exchangeBoundaries ( view_type & view,
Layout_t * layout,
SendOrder order,
int nghost = 1 )
private

Exchange the data of halo cells.

Parameters
viewis the original field data
layoutthe field layout storing the domain decomposition
orderthe data send orientation
Template Parameters
Opthe data assigment operator of the unpack function call

Definition at line 34 of file HaloCells.hpp.

References ippl::Comm, ippl::FieldLayout< Dim >::comm, ippl::detail::countHypercubes(), Dim, ippl::FieldLayout< Dim >::getDomain(), ippl::FieldLayout< Dim >::getHostLocalDomains(), ippl::FieldLayout< Dim >::getLocalNDIndex(), ippl::FieldLayout< Dim >::getMatchingIndex(), ippl::FieldLayout< Dim >::getNeighbors(), ippl::FieldLayout< Dim >::getNeighborsRecvRange(), ippl::FieldLayout< Dim >::getNeighborsSendRange(), ippl::mpi::tag::HALO, HALO_TO_INTERNAL_NOGHOST, haloData_m, INTERNAL_TO_HALO, ippl::detail::isUpper(), ippl::max, ippl::min(), pack(), and unpack().

Referenced by accumulateHalo(), accumulateHalo_noghost(), and fillHalo().

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

◆ fillHalo()

template<typename T, unsigned Dim, class... ViewArgs>
void ippl::detail::HaloCells< T, Dim, ViewArgs >::fillHalo ( view_type & view,
Layout_t * layout )

Send interal data to halo cells. This operation uses assign functor to assign the data.

Parameters
viewthe original field data
layoutthe field layout storing the domain decomposition

Definition at line 28 of file HaloCells.hpp.

References exchangeBoundaries(), and INTERNAL_TO_HALO.

Here is the call graph for this function:

◆ makeSubview()

template<typename T, unsigned Dim, class... ViewArgs>
auto ippl::detail::HaloCells< T, Dim, ViewArgs >::makeSubview ( const view_type & view,
const bound_type & intersect )
private

Extract the subview of the original data. This does not copy. A subview points to the same memory.

Parameters
viewis the original field data
intersectthe bounds of the intersection

Definition at line 223 of file HaloCells.hpp.

Referenced by pack(), and unpack().

Here is the caller graph for this function:

◆ pack()

template<typename T, unsigned Dim, class... ViewArgs>
void ippl::detail::HaloCells< T, Dim, ViewArgs >::pack ( const bound_type & range,
const view_type & view,
databuffer_type & fd,
size_type & nsends )

Pack the field data to be sent into a contiguous array.

Parameters
rangethe bounds of the subdomain to be sent
viewthe original view
fdthe buffer to pack into

Definition at line 158 of file HaloCells.hpp.

References ippl::apply(), ippl::detail::FieldBufferData< T, ViewArgs >::buffer, ippl::Comm, Dim, ippl::getRangePolicy(), makeSubview(), and ippl::parallel_for().

Here is the call graph for this function:

◆ unpack()

template<typename T, unsigned Dim, class... ViewArgs>
template<typename Op>
void ippl::detail::HaloCells< T, Dim, ViewArgs >::unpack ( const bound_type & range,
const view_type & view,
databuffer_type & fd )

Unpack the received field data and assign it.

Parameters
rangethe bounds of the subdomain to be received
viewthe original view
fdthe buffer to unpack from (received data)
Template Parameters
Opthe data assigment operator

Definition at line 193 of file HaloCells.hpp.

References ippl::apply(), ippl::detail::FieldBufferData< T, ViewArgs >::buffer, Dim, ippl::getRangePolicy(), makeSubview(), and ippl::parallel_for().

Here is the call graph for this function:

Member Data Documentation

◆ haloData_m

template<typename T, unsigned Dim, class... ViewArgs>
databuffer_type ippl::detail::HaloCells< T, Dim, ViewArgs >::haloData_m
private

Definition at line 152 of file HaloCells.h.

Referenced by exchangeBoundaries().


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