Cabana 0.8.0-dev
Loading...
Searching...
No Matches
Cabana::Scatter< HaloType, SliceType > Class Template Reference

Synchronously scatter data from the ghosts to the local decomposition of a slice using the halo reverse communication plan. This is a multiply-owned to uniquely owned communication. More...

#include <Cabana_Halo.hpp>

Inheritance diagram for Cabana::Scatter< HaloType, SliceType >:
Collaboration diagram for Cabana::Scatter< HaloType, SliceType >:

Public Types

using commspace_type = typename HaloType::commspace_type
 Communication space type.
using base_type
 Base type.
using plan_type = typename base_type::plan_type
 Communication plan type (Halo).
using execution_space = typename base_type::execution_space
 Kokkos execution space.
using memory_space = typename base_type::memory_space
 Kokkos memory space.
using data_type = typename base_type::data_type
 Communication data type.
using buffer_type = typename base_type::buffer_type
 Communication buffer type.

Public Member Functions

 Scatter (HaloType halo, SliceType slice, const double overallocation=1.0)
auto totalSend ()
 Total scatter send size for this rank.
auto totalReceive ()
 Total scatter receive size for this rank.
auto totalSend (const HaloType &halo)
 Total gather send size for this rank.
auto totalReceive (const HaloType &halo)
 Total gather receive size for this rank.
void apply () override
 Perform the scatter operation.
template<class ExecutionSpace, class CommSpaceType>
std::enable_if_t< std::is_same< CommSpaceType, Mpi >::value, void > applyImpl (ExecutionSpace, CommSpaceType)
 Vanilla Mpi implementation of the scatter operation.
void reserve (const HaloType &halo, const SliceType &slice, const double overallocation)
 Reserve new buffers as needed and update the halo and slice data. Reallocation only occurs if there is not enough space in the buffers.
void reserve (const HaloType &halo, const SliceType &slice)
 Reserve new buffers as needed and update the halo and slice data.

Detailed Description

template<class HaloType, class SliceType>
class Cabana::Scatter< HaloType, SliceType >

Synchronously scatter data from the ghosts to the local decomposition of a slice using the halo reverse communication plan. This is a multiply-owned to uniquely owned communication.

In a scatter operation results from ghosted values on other processors are scattered back to the owning processor of the ghost and the value associated with the ghost is summed into the locally owned value the ghost represents. If a locally owned element is ghosted on multiple ranks, then multiple contributions will be made to the sum, one for each rank.

Member Typedef Documentation

◆ base_type

template<class HaloType, class SliceType>
using Cabana::Scatter< HaloType, SliceType >::base_type
Initial value:

Base type.

Constructor & Destructor Documentation

◆ Scatter()

template<class HaloType, class SliceType>
Cabana::Scatter< HaloType, SliceType >::Scatter ( HaloType halo,
SliceType slice,
const double overallocation = 1.0 )
inline
Parameters
haloThe Halo to be used for the gather.
sliceThe slice on which to perform the gather. The slice should have a size equivalent to halo.numGhost() + halo.numLocal(). The locally owned elements are expected to appear first (i.e. in the first halo.numLocal() elements) and the ghosted elements are expected to appear second (i.e. in the next halo.numGhost() elements()).
overallocationAn optional factor to keep extra space in the buffers to avoid frequent resizing.

Member Function Documentation

◆ reserve() [1/2]

template<class HaloType, class SliceType>
void Cabana::Scatter< HaloType, SliceType >::reserve ( const HaloType & halo,
const SliceType & slice )
inline

Reserve new buffers as needed and update the halo and slice data.

Parameters
haloThe Halo to be used for the scatter.
sliceThe slice on which to perform the scatter.

◆ reserve() [2/2]

template<class HaloType, class SliceType>
void Cabana::Scatter< HaloType, SliceType >::reserve ( const HaloType & halo,
const SliceType & slice,
const double overallocation )
inline

Reserve new buffers as needed and update the halo and slice data. Reallocation only occurs if there is not enough space in the buffers.

Parameters
haloThe Halo to be used for the scatter.
sliceThe slice on which to perform the scatter.
overallocationAn optional factor to keep extra space in the buffers to avoid frequent resizing.

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