Ewoms::Linear::ForeignOverlapFromBCRSMatrix< 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 <foreignoverlapfrombcrsmatrix.hh>

Public Member Functions

 ForeignOverlapFromBCRSMatrix (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...
 
int overlapSize () const
 Returns the size of the overlap region. More...
 
bool isBorder (Index localIdx) const
 Returns true iff a local index is a border index. More...
 
bool isBorderWith (Index localIdx, int peerRank) const
 Returns true iff a local index is a border index shared with a given peer process. More...
 
ProcessRank masterRank (Index localIdx) const
 Return the rank of the master process of an index. More...
 
bool iAmMasterOf (Index localIdx) const
 Return true if the current rank is the "master" of an index. More...
 
const BorderListborderList () const
 Returns the list of indices which intersect the process border. More...
 
const OverlapWithPeerforeignOverlapWithPeer (int peerRank) const
 Return the list of (local indices, border distance, number of processes) triples which are in the overlap of a given peer rank. More...
 
const std::map< ProcessRank,
BorderDistance > & 
foreignOverlapByLocalIndex (Index localIdx) const
 Return the map of (peer rank, border distance) for a given local index. More...
 
bool peerHasIndex (int peerRank, Index localIdx) const
 Returns true iff a local index is seen by a peer rank. More...
 
int numFront (int peerRank) const
 Returns the number of front indices of a peer process in the local partition. More...
 
bool isFrontFor (int peerRank, Index localIdx) const
 Returns whether a given local index is on the front of a given peer rank. More...
 
const PeerSetpeerSet () const
 Return the set of process ranks which share an overlap with the current process. More...
 
const PeerSetneighborPeerSet () const
 Return the set of process ranks which share a border index with the current process. More...
 
int numNative () const
 Returns the number of native indices. More...
 
int numLocal () const
 Returns the number of local indices. More...
 
bool isLocal (Index domesticIdx) const
 Returns true iff a domestic index is local. More...
 
int nativeToLocal (Index nativeIdx) const
 Convert a native index to a local one. More...
 
int localToNative (Index localIdx) const
 Convert a local index to a native one. More...
 
const BlackListblackList () const
 Returns the object which represents the black-listed native indices. More...
 
int numPeers (Index localIdx) const
 Return the number of peer ranks for which a given local index is visible. More...
 
bool isInOverlap (Index localIdx) const
 Returns true if a given local index is in the foreign overlap of any rank. More...
 
void print () const
 Print the foreign overlap for debugging purposes. More...
 

Protected Member Functions

void extendForeignOverlap_ (const BCRSMatrix &A, SeedList &seedList, int borderDistance, int overlapSize)
 
void createLocalIndices_ ()
 
Index localToPeerIdx_ (Index localIdx, ProcessRank peerRank) const
 
void addNonNeighborOverlapIndices_ (const BCRSMatrix &A, SeedList &seedList, int borderDist)
 
void computeMasterRanks_ ()
 
void groupForeignOverlapByRank_ ()
 

Protected Attributes

PeerSet peerSet_
 
PeerSet neighborPeerSet_
 
const BorderListborderList_
 
const BlackListblackList_
 
std::vector< IndexnativeToLocalIndices_
 
std::vector< IndexlocalToNativeIndices_
 
std::vector< ProcessRankmasterRank_
 
std::set< IndexlocalBorderIndices_
 
OverlapByIndex foreignOverlapByLocalIndex_
 
OverlapByRank foreignOverlapByRank_
 
BorderDistance overlapSize_
 
Index numLocal_
 
Index numNative_
 
ProcessRank myRank_
 

Detailed Description

template<class BCRSMatrix>
class Ewoms::Linear::ForeignOverlapFromBCRSMatrix< 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::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::blackList ( ) const
inline

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

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

template<class BCRSMatrix >
const BorderList& Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::borderList ( ) const
inline

Returns the list of indices which intersect the process border.

References Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::borderList_.

template<class BCRSMatrix >
const std::map<ProcessRank, BorderDistance>& Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::foreignOverlapByLocalIndex ( Index  localIdx) const
inline
template<class BCRSMatrix >
bool Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::iAmMasterOf ( Index  localIdx) const
inline

Return true if the current rank is the "master" of an index.

If the index is at the interior of some process, we define this process as its master, if the index is on the boundary, then the master is defined as the process with the lowest rank.

References Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::masterRank_, and Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::myRank_.

Referenced by Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::iAmMasterOf().

template<class BCRSMatrix >
bool Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::isBorderWith ( Index  localIdx,
int  peerRank 
) const
inline

Returns true iff a local index is a border index shared with a given peer process.

References Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::foreignOverlapByLocalIndex_.

Referenced by Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::isBorderWith().

template<class BCRSMatrix >
bool Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::isFrontFor ( int  peerRank,
Index  localIdx 
) const
inline
template<class BCRSMatrix >
bool Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::isInOverlap ( Index  localIdx) const
inline
template<class BCRSMatrix >
int Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::localToNative ( Index  localIdx) const
inline
template<class BCRSMatrix >
const PeerSet& Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::neighborPeerSet ( ) const
inline

Return the set of process ranks which share a border index with the current process.

References Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::neighborPeerSet_.

Referenced by Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::addNonNeighborOverlapIndices_().

template<class BCRSMatrix >
int Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::numFront ( int  peerRank) const
inline
template<class BCRSMatrix >
int Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::numNative ( ) const
inline
template<class BCRSMatrix >
int Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::numPeers ( Index  localIdx) const
inline

Return the number of peer ranks for which a given local index is visible.

References Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::foreignOverlapByLocalIndex_.

template<class BCRSMatrix >
bool Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::peerHasIndex ( int  peerRank,
Index  localIdx 
) const
inline
template<class BCRSMatrix >
const PeerSet& Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::peerSet ( ) const
inline

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

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

Referenced by Ewoms::Linear::DomesticOverlapFromBCRSMatrix< BCRSMatrix >::buildDomesticOverlap_().

template<class BCRSMatrix >
void Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::print ( ) const
inline

Print the foreign overlap for debugging purposes.

References Ewoms::Linear::ForeignOverlapFromBCRSMatrix< BCRSMatrix >::foreignOverlapByRank_.

Member Data Documentation


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