Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix > Class Template Reference

This class creates and manages the foreign overlap given an initial list of border indices and a BCRS matrix. More...

#include <domesticoverlapfrombcrsmatrix.hh>

Public Member Functions

 DomesticOverlapFromBCRSMatrix (const BCRSMatrix &A, const BorderList &borderList, const BlackList &blackList, int overlapSize)
 Constructs the foreign overlap given a BCRS matrix and an initial list of border indices. More...
 
void check () const
 
int myRank () const
 Returns the rank of the current process. More...
 
int worldSize () const
 Returns the number of processes in the global MPI communicator. More...
 
const PeerSetpeerSet () const
 Return the set of process ranks which share an overlap with the current process. More...
 
int numBorder (int peerRank) const
 Returns the number of indices on the border with a given peer rank. More...
 
bool isBorder (int domesticIdx) const
 Returns true iff a domestic index is a border index. More...
 
bool isBorderWith (int domesticIdx, int peerRank) const
 Returns true iff a domestic index is on the border with a given peer process. More...
 
int numFront (int peerRank) const
 Returns the number of indices on the front within a given peer rank's grid partition. More...
 
bool isFront (int domesticIdx) const
 Returns true iff a domestic index is on the front. More...
 
const BlackListblackList () const
 Returns the object which represents the black-listed native indices. More...
 
int numPeers (int domesticIdx) const
 Returns the number of processes which "see" a given index. More...
 
int overlapSize () const
 Returns the size of the overlap region. More...
 
int numNative () const
 Returns the number native indices. More...
 
int numLocal () const
 Returns the number local indices. More...
 
int numDomestic () const
 Returns the number domestic indices. More...
 
bool isLocal (int domesticIdx) const
 Return true if a domestic index is local for the process. More...
 
bool iAmMasterOf (int domesticIdx) const
 Return true iff the current process is the master of a given domestic index. More...
 
int masterRank (int domesticIdx) const
 Return the rank of a master process for a domestic index. More...
 
void print () const
 Print the foreign overlap for debugging purposes. More...
 
Index globalToDomestic (Index globalIdx) const
 Returns a domestic index given a global one. More...
 
Index domesticToGlobal (Index domIdx) const
 Returns a global index given a domestic one. More...
 
Index domesticToNative (Index domIdx) const
 Returns a native index given a domestic one. More...
 
Index nativeToDomestic (Index nativeIdx) const
 Returns a domestic index given a native one. More...
 
bool isInOverlap (Index domesticIdx) const
 Returns true if a given domestic index is either in the foreign or in the domestic overlap. More...
 
bool isFrontFor (ProcessRank peerRank, Index domesticIdx) const
 Returns true if a given domestic index is a front index for a peer rank. More...
 
bool peerHasIndex (int peerRank, int domesticIdx) const
 Returns true iff a domestic index is seen by a peer rank. More...
 
int foreignOverlapSize (ProcessRank peerRank) const
 Returns number of indices which are contained in the foreign overlap with a peer. More...
 
int foreignOverlapOffsetToDomesticIdx (ProcessRank peerRank, int overlapOffset) const
 Returns the domestic index given an offset in the foreign overlap of a peer process with the local process. More...
 
int domesticOverlapSize (ProcessRank peerRank) const
 Returns number of indices which are contained in the domestic overlap with a peer. More...
 
int domesticOverlapOffsetToDomesticIdx (ProcessRank peerRank, int overlapOffset) const
 Returns the domestic index given an offset in the domestic overlap of a peer process with the local process. More...
 

Protected Member Functions

void buildDomesticOverlap_ ()
 
void updateMasterRanks_ ()
 
void sendIndicesToPeer_ (int peerRank)
 
void waitSendIndices_ (int peerRank)
 
void receiveIndicesFromPeer_ (int peerRank)
 
void setupDebugMapping_ ()
 
Index mapInternalToExternal_ (Index internalIdx) const
 
Index mapExternalToInternal_ (Index externalIdx) const
 

Protected Attributes

int myRank_
 
int worldSize_
 
ForeignOverlap foreignOverlap_
 
BlackList blackList_
 
DomesticOverlapByRank domesticOverlapWithPeer_
 
OverlapByIndex domesticOverlapByIndex_
 
std::vector< BorderDistanceborderDistance_
 
std::vector< ProcessRankmasterRank_
 
std::map< ProcessRank,
MpiBuffer< size_t > * > 
numIndicesSendBuffer_
 
std::map< ProcessRank,
MpiBuffer< IndexDistanceNpeers > * > 
indicesSendBuffer_
 
GlobalIndices globalIndices_
 
PeerSet peerSet_
 

Detailed Description

template<class BCRSMatrix>
class Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >

This class creates and manages the foreign overlap given an initial list of border indices and a BCRS matrix.

The foreign overlap are all (row) indices which overlap with the some of the current process's local indices.

Constructor & Destructor Documentation

Member Function Documentation

template<class BCRSMatrix >
const BlackList& Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::blackList ( ) const
inline

Returns the object which represents the black-listed native indices.

References Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::blackList_.

template<class BCRSMatrix >
int Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::domesticOverlapOffsetToDomesticIdx ( ProcessRank  peerRank,
int  overlapOffset 
) const
inline

Returns the domestic index given an offset in the domestic overlap of a peer process with the local process.

References Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::domesticOverlapWithPeer_, and Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::mapInternalToExternal_().

template<class BCRSMatrix >
int Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::domesticOverlapSize ( ProcessRank  peerRank) const
inline

Returns number of indices which are contained in the domestic overlap with a peer.

References Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::domesticOverlapWithPeer_.

template<class BCRSMatrix >
int Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::foreignOverlapOffsetToDomesticIdx ( ProcessRank  peerRank,
int  overlapOffset 
) const
inline
template<class BCRSMatrix >
int Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::foreignOverlapSize ( ProcessRank  peerRank) const
inline
template<class BCRSMatrix >
bool Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::isFrontFor ( ProcessRank  peerRank,
Index  domesticIdx 
) const
inline
template<class BCRSMatrix >
int Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::masterRank ( int  domesticIdx) const
inline
template<class BCRSMatrix >
int Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::myRank ( ) const
inline

Returns the rank of the current process.

References Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::myRank_.

template<class BCRSMatrix >
int Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::numBorder ( int  peerRank) const
inline

Returns the number of indices on the border with a given peer rank.

References Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::foreignOverlap_.

template<class BCRSMatrix >
int Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::numDomestic ( ) const
inline

Returns the number domestic indices.

The domestic indices are defined as the process' local indices plus its domestic overlap (i.e. indices for which it is not neither master nor are on the process border).

References Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::globalIndices_, and Ewoms::Linear::GlobalIndices< ForeignOverlap >::numDomestic().

Referenced by Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::check(), and Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::updateMasterRanks_().

template<class BCRSMatrix >
int Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::numFront ( int  peerRank) const
inline

Returns the number of indices on the front within a given peer rank's grid partition.

References Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::foreignOverlap_, and Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::numFront().

template<class BCRSMatrix >
int Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::numNative ( ) const
inline

Returns the number native indices.

I.e. the number of indices of the "raw" grid partition of the local process (including the indices in ghost and overlap elements).

References Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::foreignOverlap_, and Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::numNative().

template<class BCRSMatrix >
int Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::overlapSize ( ) const
inline
template<class BCRSMatrix >
bool Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::peerHasIndex ( int  peerRank,
int  domesticIdx 
) const
inline
template<class BCRSMatrix >
const PeerSet& Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::peerSet ( ) const
inline

Return the set of process ranks which share an overlap with the current process.

References Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::peerSet_.

template<class BCRSMatrix >
void Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::print ( ) const
inline
template<class BCRSMatrix >
void Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::setupDebugMapping_ ( )
inlineprotected
template<class BCRSMatrix >
int Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::worldSize ( ) const
inline

Returns the number of processes in the global MPI communicator.

References Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::worldSize_.

Member Data Documentation

template<class BCRSMatrix >
ForeignOverlap Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::foreignOverlap_
protected

Referenced by Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::buildDomesticOverlap_(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::check(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::domesticToNative(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::foreignOverlapOffsetToDomesticIdx(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::foreignOverlapSize(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::iAmMasterOf(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::isBorder(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::isBorderWith(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::isFront(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::isFrontFor(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::isInOverlap(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::nativeToDomestic(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::numBorder(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::numFront(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::numLocal(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::numNative(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::overlapSize(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::peerHasIndex(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::receiveIndicesFromPeer_(), Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::sendIndicesToPeer_(), and Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::updateMasterRanks_().


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