Block-Structured AMR Software Framework
AMReX_NonLocalBC.H File Reference
#include <AMReX_Config.H>
#include <AMReX_TypeTraits.H>
#include <AMReX_FabArray.H>
#include <AMReX_FArrayBox.H>
#include <AMReX_NonLocalBCImpl.H>

Go to the source code of this file.

Classes

struct  amrex::NonLocalBC::HasInverseMemFn< T >
 Type trait that tests if T has an InverseImage class member function. More...
 
struct  amrex::NonLocalBC::IsIndexMapping< IndexMap >
 Tests if a given type IndexMap is usable as an index mapping between two index based coordinate systems. More...
 
struct  amrex::NonLocalBC::MultiBlockIndexMapping
 This struct describes an affine index transformation for two coordinate systems. More...
 
struct  amrex::NonLocalBC::MultiBlockCommMetaData
 This is the index mapping based on the DTOS MultiBlockDestToSrc. More...
 
struct  amrex::NonLocalBC::IsFabProjection< P, FAB >
 This type trait tests if a type P is a projection for FAB. More...
 
struct  amrex::NonLocalBC::Identity
 This class acts as a default no-op operator. More...
 
struct  amrex::NonLocalBC::MapComponents< Base, Map >
 This class takes a projection and a component map and combines them to form a new projection. More...
 
struct  amrex::NonLocalBC::SwapComponents< I, J >
 This is a permutation where only two components are swapped. More...
 
struct  amrex::NonLocalBC::SwapComponents< I, -1 >
 
struct  amrex::NonLocalBC::SwapComponents<-1, J >
 
struct  amrex::NonLocalBC::SwapComponents<-1, -1 >
 
struct  amrex::NonLocalBC::CommData
 This class holds data buffers for either immediate MPI send or recv calls. More...
 
struct  amrex::NonLocalBC::CommHandler
 This class stores both recv and send buffers with an associated MPI tag. More...
 
struct  amrex::NonLocalBC::IsDataPacking< DP, FAB >
 This type trait tests if a given type DP satisfies the DataPacking concept for type FAB. More...
 
struct  amrex::NonLocalBC::PackComponents
 Contains information about which components take part of the data transaction. More...
 
struct  amrex::NonLocalBC::ApplyDtosAndProjectionOnReciever< DTOS, FabProj >
 This class specializes behaviour on local copies and unpacking receive buffers. More...
 
struct  amrex::NonLocalBC::NoLocalCopy
 
struct  amrex::NonLocalBC::DoLocalCopy
 

Namespaces

 amrex
 
 amrex::NonLocalBC
 

Typedefs

template<typename T , typename... Args>
using amrex::NonLocalBC::Inverse_t = decltype(std::declval< T >().Inverse(std::declval< Args >()...))
 Return type of an InverseImage class member function. More...
 
using amrex::NonLocalBC::DynamicSwapComponents = SwapComponents<-1, -1 >
 
template<typename... Args>
using amrex::NonLocalBC::PrepareSendBuffers_t = decltype(PrepareSendBuffers(std::declval< Args >()...))
 
template<typename... Args>
using amrex::NonLocalBC::PrepareRecvBuffers_t = decltype(PrepareRecvBuffers(std::declval< Args >()...))
 
template<typename... Args>
using amrex::NonLocalBC::PackSendBuffers_t = decltype(PackSendBuffers(std::declval< Args >()...))
 
template<typename... Args>
using amrex::NonLocalBC::UnpackRecvBuffers_t = decltype(UnpackRecvBuffers(std::declval< Args >()...))
 
template<typename... Args>
using amrex::NonLocalBC::LocalCopy_t = decltype(LocalCopy(std::declval< Args >()...))
 

Functions

template<typename DTOS >
std::enable_if_t< IsCallableR< Dim3, DTOS, Dim3 >::value, IntVect > amrex::NonLocalBC::Apply (DTOS const &dtos, const IntVect &iv)
 Applies the Dim3 to Dim3 mapping onto IntVects. More...
 
template<typename DTOS >
std::enable_if_t< IsCallableR< Dim3, DTOS, Dim3 >::value &&!IsCallableR< IndexType, DTOS, IndexType >::value, Box > amrex::NonLocalBC::Image (DTOS const &dtos, const Box &box)
 Applies the Dim3 to Dim3 mapping onto Boxes but does not change the index type. More...
 
template<typename DTOS >
std::enable_if_t< IsCallableR< Dim3, DTOS, Dim3 >::value &&IsCallableR< IndexType, DTOS, IndexType >::value, Box > amrex::NonLocalBC::Image (DTOS const &dtos, const Box &box)
 Applies the Dim3 to Dim3 mapping onto Boxes and maps the index type. More...
 
template<typename DTOS >
std::enable_if_t< HasInverseMemFn< DTOS >::value, IntVect > amrex::NonLocalBC::ApplyInverse (DTOS const &dtos, const IntVect &iv)
 Applies the Dim3 to Dim3 invserse mapping onto IntVects. More...
 
template<typename DTOS >
std::enable_if_t< HasInverseMemFn< DTOS >::value &&!IsCallableR< IndexType, DTOS, IndexType >::value, Box > amrex::NonLocalBC::InverseImage (DTOS const &dtos, const Box &box)
 Applies the inverse Dim3 to Dim3 mapping onto Boxes without changing the index type. More...
 
template<typename DTOS >
std::enable_if_t< HasInverseMemFn< DTOS >::value &&IsCallableR< IndexType, DTOS, IndexType >::value, Box > amrex::NonLocalBC::InverseImage (DTOS const &dtos, const Box &box)
 Applies the inverse Dim3 to Dim3 mapping onto Boxes. More...
 
void amrex::NonLocalBC::PrepareCommBuffers (CommData &comm, const FabArrayBase::MapOfCopyComTagContainers &cctc, int n_components, std::size_t object_size, std::size_t align)
 Fill all class member variables of comm but the request and the stats vector. More...
 
void amrex::NonLocalBC::PostRecvs (CommData &recv, int mpi_tag)
 Initiate all recvieves with MPI_Irecv calls associated with tag mpi_tag. More...
 
void amrex::NonLocalBC::PostSends (CommData &send, int mpi_tag)
 Initiate all sends with MPI_Isend calls associated with tag mpi_tag. More...
 
template<class FAB , class DTOS = Identity, class Proj = Identity>
std::enable_if_t< IsBaseFab< FAB >) &&IsCallableR< Dim3, DTOS, Dim3 >) &&IsFabProjection< Proj, FAB >)> amrex::NonLocalBC::local_copy_cpu (FabArray< FAB > &dest, const FabArray< FAB > &src, int dcomp, int scomp, int ncomp, FabArrayBase::CopyComTagsContainer const &local_tags, DTOS const &dtos=DTOS{}, Proj const &proj=Proj{}) noexcept
 
template<class FAB , class DTOS = Identity, class Proj = Identity>
std::enable_if_t< IsBaseFab< FAB >) &&IsCallableR< Dim3, DTOS, Dim3 >) &&IsFabProjection< Proj, FAB >)> amrex::NonLocalBC::unpack_recv_buffer_cpu (FabArray< FAB > &mf, int dcomp, int ncomp, Vector< char * > const &recv_data, Vector< std::size_t > const &recv_size, Vector< FabArrayBase::CopyComTagsContainer const * > const &recv_cctc, DTOS const &dtos=DTOS{}, Proj const &proj=Proj{}) noexcept
 
template<class FAB , class DTOS = Identity, class Proj = Identity>
std::enable_if_t< IsBaseFab< FAB >) &&IsCallableR< Dim3, DTOS, Dim3 >) &&IsFabProjection< Proj, FAB >)> amrex::NonLocalBC::local_copy_gpu (FabArray< FAB > &dest, const FabArray< FAB > &src, int dcomp, int scomp, int ncomp, FabArrayBase::CopyComTagsContainer const &local_tags, DTOS const &dtos=DTOS{}, Proj const &proj=Proj{}) noexcept
 
template<class FAB , class DTOS = Identity, class Proj = Identity>
std::enable_if_t< IsBaseFab< FAB >) &&IsCallableR< Dim3, DTOS, Dim3 >) &&IsFabProjection< Proj, FAB >)> amrex::NonLocalBC::unpack_recv_buffer_gpu (FabArray< FAB > &mf, int scomp, int ncomp, Vector< char * > const &recv_data, Vector< std::size_t > const &recv_size, Vector< FabArrayBase::CopyComTagsContainer const * > const &recv_cctc, DTOS const &dtos=DTOS{}, Proj const &proj=Proj{})
 
template<typename FAB >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::LocalCopy (const PackComponents &components, FabArray< FAB > &dest, const FabArray< FAB > &src, const FabArrayBase::CopyComTagsContainer &local_tags)
 Dispatch local copies to the default behaviour that knows no DTOS nor projection. More...
 
template<typename FAB >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::PrepareSendBuffers (const PackComponents &components, FabArray< FAB > &dest, const FabArray< FAB > &src, CommData &comm, const FabArrayBase::MapOfCopyComTagContainers &cctc)
 Calls PrepareComBuffers. More...
 
template<typename FAB >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::PrepareRecvBuffers (const PackComponents &components, FabArray< FAB > &dest, const FabArray< FAB > &src, CommData &comm, const FabArrayBase::MapOfCopyComTagContainers &cctc)
 Calls PrepareComBuffers. More...
 
template<typename FAB >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::PackSendBuffers (const PackComponents &components, const FabArray< FAB > &src, CommData &send)
 Serializes FAB data without any knowledge of a DTOS nor a projection. More...
 
template<typename FAB >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::UnpackRecvBuffers (const PackComponents &components, FabArray< FAB > &dest, const CommData &recv)
 De-serializes FAB data without any knowledge of a DTOS nor a projection. More...
 
template<typename FAB , typename DTOS , typename FabProj >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::LocalCopy (const ApplyDtosAndProjectionOnReciever< DTOS, FabProj > &packing, FabArray< FAB > &dest, const FabArray< FAB > &src, const FabArrayBase::CopyComTagsContainer &local_tags)
 Do local copies of FABs using DTOS and projection. More...
 
template<typename FAB , typename DTOS , typename FabProj >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::UnpackRecvBuffers (const ApplyDtosAndProjectionOnReciever< DTOS, FabProj > &packing, FabArray< FAB > &dest, const CommData &recv)
 Copy from received data in the buffer to destination FABs using DTOS and projection. More...
 
template<typename FAB , typename DataPacking , typename = std::enable_if_t<IsBaseFab<FAB>::value>, typename = std::enable_if_t<IsDataPacking<DataPacking, FAB>::value>>
AMREX_NODISCARD CommHandler amrex::NonLocalBC::ParallelCopy_nowait (NoLocalCopy, FabArray< FAB > &dest, const FabArray< FAB > &src, const FabArrayBase::CommMetaData &cmd, const DataPacking &data_packing)
 
template<typename FAB , typename DataPacking , typename = std::enable_if_t<IsBaseFab<FAB>::value>, typename = std::enable_if_t<IsDataPacking<DataPacking, FAB>::value>>
AMREX_NODISCARD CommHandler amrex::NonLocalBC::ParallelCopy_nowait (FabArray< FAB > &dest, const FabArray< FAB > &src, const FabArrayBase::CommMetaData &cmd, const DataPacking &data_packing)
 
template<typename FAB , typename DataPacking >
std::enable_if_t< IsBaseFab< FAB >) &&IsDataPacking< DataPacking, FAB >)> amrex::NonLocalBC::ParallelCopy_finish (FabArray< FAB > &dest, CommHandler handler, const FabArrayBase::CommMetaData &cmd, const DataPacking &data_packing)
 
template<typename FAB , typename DataPacking >
std::enable_if_t< IsBaseFab< FAB >) &&IsDataPacking< DataPacking, FAB >)> amrex::NonLocalBC::ParallelCopy_finish (DoLocalCopy, FabArray< FAB > &dest, const FabArray< FAB > &src, CommHandler handler, const FabArrayBase::CommMetaData &cmd, const DataPacking &data_packing)
 
template<typename FAB , typename DTOS = Identity, typename Proj = Identity>
std::enable_if_t< IsBaseFab< FAB >) &&IsCallableR< Dim3, DTOS, Dim3 >) &&IsFabProjection< Proj, FAB >)> amrex::NonLocalBC::ParallelCopy (FabArray< FAB > &dest, const FabArray< FAB > &src, const FabArrayBase::CommMetaData &cmd, SrcComp srccomp, DestComp destcomp, NumComps numcomp, DTOS const &dtos=DTOS{}, Proj const &proj=Proj{})
 Call ParallelCopy_nowait followed by ParallelCopy_finish, strong typed version. More...
 
template<typename FAB , typename DTOS = Identity, typename Proj = Identity>
std::enable_if_t< IsBaseFab< FAB >) &&IsCallableR< Dim3, DTOS, Dim3 >) &&IsFabProjection< Proj, FAB >)> amrex::NonLocalBC::ParallelCopy (FabArray< FAB > &dest, const FabArray< FAB > &src, const FabArrayBase::CommMetaData &cmd, int srccomp, int destcomp, int numcomp, DTOS const &dtos=DTOS{}, Proj const &proj=Proj{})
 Call ParallelCopy_nowait followed by ParallelCopy_finish. More...
 
template<typename FAB , typename DTOS = Identity, typename Proj = Identity>
std::enable_if_t< IsBaseFab< FAB >) &&IsIndexMapping< DTOS >) &&IsFabProjection< Proj, FAB >), MultiBlockCommMetaData > amrex::NonLocalBC::ParallelCopy (FabArray< FAB > &dest, const Box &destbox, const FabArray< FAB > &src, SrcComp srccomp, DestComp destcomp, NumComps numcomp, const IntVect &ngrow, DTOS const &dtos=DTOS{}, Proj const &proj=Proj{})
 Call ParallelCopy_nowait followed by ParallelCopy_finish, strong typed version. More...
 
template<typename FAB , typename DTOS = Identity, typename Proj = Identity>
std::enable_if_t< IsBaseFab< FAB >) &&IsIndexMapping< DTOS >) &&IsFabProjection< Proj, FAB >), MultiBlockCommMetaData > amrex::NonLocalBC::ParallelCopy (FabArray< FAB > &dest, const Box &destbox, const FabArray< FAB > &src, int srccomp, int destcomp, int numcomp, const IntVect &ngrow, DTOS const &dtos=DTOS{}, Proj const &proj=Proj{})
 Call ParallelCopy_nowait followed by ParallelCopy_finish. More...
 
template<class FAB >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::Rotate90 (FabArray< FAB > &mf, int scomp, int ncomp, IntVect const &nghost, Box const &domain)
 
template<class FAB >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::Rotate90 (FabArray< FAB > &mf, Box const &domain)
 
template<class FAB >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::Rotate180 (FabArray< FAB > &mf, int scomp, int ncomp, IntVect const &nghost, Box const &domain)
 
template<class FAB >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::Rotate180 (FabArray< FAB > &mf, Box const &domain)
 
template<class FAB >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::FillPolar (FabArray< FAB > &mf, int scomp, int ncomp, IntVect const &nghost, Box const &domain)
 
template<class FAB >
std::enable_if_t< IsBaseFab< FAB >::value > amrex::NonLocalBC::FillPolar (FabArray< FAB > &mf, Box const &domain)
 
template<typename FAB , typename DTOS , typename Proj = Identity>
std::enable_if_t< IsBaseFab< FAB >) &&IsCallableR< Dim3, DTOS, Dim3 >) &&IsFabProjection< Proj, FAB >), CommHandler > amrex::NonLocalBC::FillBoundary_nowait (FabArray< FAB > &mf, const FabArrayBase::CommMetaData &cmd, int scomp, int ncomp, DTOS const &dtos, Proj const &proj=Proj{})
 Start communication to fill boundary. More...
 
template<typename FAB , typename DTOS , typename Proj = Identity>
std::enable_if_t< IsBaseFab< FAB >) &&IsCallableR< Dim3, DTOS, Dim3 >) &&IsFabProjection< Proj, FAB >)> amrex::NonLocalBC::FillBoundary_finish (CommHandler handler, FabArray< FAB > &mf, const FabArrayBase::CommMetaData &cmd, int scomp, int ncomp, DTOS const &dtos, Proj const &proj=Proj{})
 Finish communication started by FillBoundary_nowait. More...
 
template<typename FAB , typename DTOS , typename Proj = Identity>
std::enable_if_t< IsBaseFab< FAB >) &&IsCallableR< Dim3, DTOS, Dim3 >) &&IsFabProjection< Proj, FAB >)> amrex::NonLocalBC::FillBoundary (FabArray< FAB > &mf, const FabArrayBase::CommMetaData &cmd, int scomp, int ncomp, DTOS const &dtos, Proj const &proj=Proj{})
 Fill ghost cells for FabArray/MultiFab. More...
 
template<typename FAB , typename DTOS >
std::enable_if_t< IsBaseFab< FAB >) &&IsCallableR< Dim3, DTOS, Dim3 >), FabArrayBase::CommMetaData > amrex::NonLocalBC::makeFillBoundaryMetaData (FabArray< FAB > &mf, IntVect const &nghost, Geometry const &geom, DTOS const &dtos)
 Make metadata for FillBoundary. More...
 

Variables

static constexpr Identity amrex::NonLocalBC::identity {}
 
template<int I, int J>
static constexpr SwapComponents< I, J > amrex::NonLocalBC::swap_indices {}
 
static constexpr struct amrex::NonLocalBC::NoLocalCopy amrex::NonLocalBC::no_local_copy
 
static constexpr struct amrex::NonLocalBC::DoLocalCopy amrex::NonLocalBC::do_local_copy