Nektar++
|
Implements communication for populating forward and backwards spaces across processors in the discontinuous Galerkin routines. More...
#include <AssemblyCommDG.h>
Public Member Functions | |
~AssemblyCommDG ()=default | |
Default destructor. More... | |
AssemblyCommDG (const ExpList &locExp, const ExpListSharedPtr &trace, const Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > &elmtToTrace, const Array< OneD, const ExpListSharedPtr > &bndCondExp, const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > &bndCond, const PeriodicMap &perMap) | |
void | PerformExchange (const Array< OneD, NekDouble > &testFwd, Array< OneD, NekDouble > &testBwd) |
Perform the trace exchange between processors, given the forwards and backwards spaces. More... | |
Private Member Functions | |
void | InitialiseStructure (const ExpList &locExp, const ExpListSharedPtr &trace, const Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > &elmtToTrace, const Array< OneD, const ExpListSharedPtr > &bndCondExp, const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > &bndCond, const PeriodicMap &perMap, const LibUtilities::CommSharedPtr &comm) |
Initalises the structure for the MPI communication. More... | |
Static Private Member Functions | |
static std::tuple< NekDouble, NekDouble, NekDouble > | Timing (const LibUtilities::CommSharedPtr &comm, const int &count, const int &num, const ExchangeMethodSharedPtr &f) |
Timing of the MPI exchange method. More... | |
Private Attributes | |
ExchangeMethodSharedPtr | m_exchange |
Chosen exchange method (either fastest parallel or serial) More... | |
int | m_maxQuad = 0 |
Max number of quadrature points in an element. More... | |
int | m_nRanks = 0 |
Number of ranks/processes/partitions. More... | |
std::map< int, std::vector< int > > | m_rankSharedEdges |
Map of process to shared edge IDs. More... | |
std::map< int, std::vector< int > > | m_edgeToTrace |
Map of edge ID to quad point trace indices. More... | |
Implements communication for populating forward and backwards spaces across processors in the discontinuous Galerkin routines.
The AssemblyCommDG class constructs various exchange methods for performing the action of communicating trace data from the forwards space of one processor to the backwards space of the corresponding neighbour element, and vice versa.
This class initialises the structure for all exchange methods and then times to determine the fastest method for the particular system configuration, if running in serial configuration it assigns the #Serial exchange method. It then acts as a pass through to the chosen exchange method for the PerformExchange function.
Definition at line 241 of file AssemblyCommDG.h.
|
default |
Default destructor.
Nektar::MultiRegions::AssemblyCommDG::AssemblyCommDG | ( | const ExpList & | locExp, |
const ExpListSharedPtr & | trace, | ||
const Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > & | elmtToTrace, | ||
const Array< OneD, const ExpListSharedPtr > & | bndCondExp, | ||
const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & | bndCond, | ||
const PeriodicMap & | perMap | ||
) |
Definition at line 325 of file AssemblyCommDG.cpp.
References Nektar::MultiRegions::ExpList::GetComm(), Nektar::MultiRegions::ExpList::GetSession(), InitialiseStructure(), m_edgeToTrace, m_exchange, m_maxQuad, m_nRanks, m_rankSharedEdges, and Timing().
|
private |
Initalises the structure for the MPI communication.
This function sets up the initial structure to allow for the exchange methods to be created. This structure is contained within the member variable m_rankSharedEdges which is a map of rank to vector of the shared edges with that rank. This is filled by:
Definition at line 456 of file AssemblyCommDG.cpp.
References Nektar::StdRegions::eDir1BwdDir2_Dir2FwdDir1, Nektar::StdRegions::eDir1FwdDir2_Dir2BwdDir1, Nektar::SpatialDomains::ePeriodic, Nektar::StdRegions::find(), Nektar::MultiRegions::ExpList::GetExp(), Nektar::MultiRegions::PeriodicEntity::id, Nektar::MultiRegions::PeriodicEntity::isLocal, m_edgeToTrace, m_maxQuad, m_nRanks, m_rankSharedEdges, Nektar::MultiRegions::AssemblyMapDG::RealignTraceElement(), and Nektar::LibUtilities::ReduceMax.
Referenced by AssemblyCommDG().
|
inline |
Perform the trace exchange between processors, given the forwards and backwards spaces.
testFwd | Local forwards space of the trace (which will be sent) |
testBwd | Local backwards space of the trace (which will receive contributions) |
Definition at line 265 of file AssemblyCommDG.h.
References m_exchange.
|
staticprivate |
Timing of the MPI exchange method.
Timing of the exchange method f
, performing the exchange count
times for array of length num
.
comm | Communicator |
count | Number of timing iterations to run |
num | Number of quadrature points to communicate |
f | #ExchangeMethod to time |
Definition at line 706 of file AssemblyCommDG.cpp.
References Nektar::LibUtilities::ReduceMax, Nektar::LibUtilities::ReduceMin, Nektar::LibUtilities::ReduceSum, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), and Nektar::LibUtilities::Timer::TimePerTest().
Referenced by AssemblyCommDG().
|
private |
Map of edge ID to quad point trace indices.
Definition at line 281 of file AssemblyCommDG.h.
Referenced by AssemblyCommDG(), and InitialiseStructure().
|
private |
Chosen exchange method (either fastest parallel or serial)
Definition at line 273 of file AssemblyCommDG.h.
Referenced by AssemblyCommDG(), and PerformExchange().
|
private |
Max number of quadrature points in an element.
Definition at line 275 of file AssemblyCommDG.h.
Referenced by AssemblyCommDG(), and InitialiseStructure().
|
private |
Number of ranks/processes/partitions.
Definition at line 277 of file AssemblyCommDG.h.
Referenced by AssemblyCommDG(), and InitialiseStructure().
|
private |
Map of process to shared edge IDs.
Definition at line 279 of file AssemblyCommDG.h.
Referenced by AssemblyCommDG(), and InitialiseStructure().