MueLu Version of the Day
|
Helper class for providing arbitrated communication across processors. More...
#include <MueLu_CoupledAggregationCommHelper_decl.hpp>
Private Types | |
typedef DefaultScalar | Scalar |
Constructors/Destructors. | |
RCP< const Import > | import_ |
RCP< const Import > | winnerImport_ |
RCP< Import > | pushWinners_ |
RCP< Vector > | tempVec_ |
RCP< Vector > | perturbWt_ |
RCP< Vector > | postComm_ |
RCP< Vector > | candidateWinners_ |
ArrayRCP< GO > | myWinners_ |
int | numMyWinners_ |
RCP< Map > | winnerMap_ |
int | numCalls_ |
int | myPID_ |
CoupledAggregationCommHelper (const RCP< const Map > &uniqueMap, const RCP< const Map > &nonUniqueMap) | |
Constructor. | |
~CoupledAggregationCommHelper () | |
Destructor. | |
void | ArbitrateAndCommunicate (Vector &weights, Aggregates &aggregates, const bool perturb) const |
This method assigns unknowns to aggregates. | |
void | ArbitrateAndCommunicate (Vector &weight, LOVector &procWinner, LOMultiVector *companion, const bool perturb) const |
This class uses a weighted rendezvous algorithm to do a global reduction on a vector that may be based on a non unique map. | |
void | NonUnique2NonUnique (const Vector &source, Vector &dest, const Xpetra::CombineMode what) const |
Redistribute data in source to dest where both source and dest might have multiple copies of the same global id across many processors. | |
Additional Inherited Members | |
![]() | |
virtual | ~BaseClass () |
Destructor. | |
![]() | |
VerboseObject () | |
virtual | ~VerboseObject () |
Destructor. | |
VerbLevel | GetVerbLevel () const |
Get the verbosity level. | |
void | SetVerbLevel (const VerbLevel verbLevel) |
Set the verbosity level of this object. | |
int | GetProcRankVerbose () const |
Get proc rank used for printing. Do not use this information for any other purpose. | |
int | SetProcRankVerbose (int procRank) const |
Set proc rank used for printing. | |
bool | IsPrint (MsgType type, int thisProcRankOnly=-1) const |
Find out whether we need to print out information for a specific message type. | |
Teuchos::FancyOStream & | GetOStream (MsgType type, int thisProcRankOnly=0) const |
Get an output stream for outputting the input message type. | |
Teuchos::FancyOStream & | GetBlackHole () const |
![]() | |
virtual | ~Describable () |
Destructor. | |
virtual void | describe (Teuchos::FancyOStream &out_arg, const VerbLevel verbLevel=Default) const |
virtual std::string | description () const |
Return a simple one-line description of this object. | |
void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const |
Print the object with some verbosity level to an FancyOStream object. | |
virtual std::string | ShortClassName () const |
Return the class name of the object, without template parameters and without namespace. | |
![]() | |
static void | SetDefaultVerbLevel (const VerbLevel defaultVerbLevel) |
Set the default (global) verbosity level. | |
static VerbLevel | GetDefaultVerbLevel () |
Get the default (global) verbosity level. | |
static void | SetMueLuOStream (const Teuchos::RCP< Teuchos::FancyOStream > &mueluOStream) |
static void | SetMueLuOFileStream (const std::string &filename) |
static Teuchos::RCP< Teuchos::FancyOStream > | GetMueLuOStream () |
Helper class for providing arbitrated communication across processors.
For more details, see the comments for the ArbitrateAndCommunicate methods.
Definition at line 73 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
private |
Definition at line 74 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
MueLu::CoupledAggregationCommHelper< LocalOrdinal, GlobalOrdinal, Node >::CoupledAggregationCommHelper | ( | const RCP< const Map > & | uniqueMap, |
const RCP< const Map > & | nonUniqueMap ) |
Constructor.
Definition at line 64 of file MueLu_CoupledAggregationCommHelper_def.hpp.
|
inline |
Destructor.
Definition at line 88 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
inline |
This method assigns unknowns to aggregates.
Tie-breaking is possible is using random weights. @param[in] weights vector of weights that help determine ownership. @param[in,out] aggregates aggregate data structure @param[in] perturb flag indicating whether weights should be randomly perturbed for tie-breaking purposes.
Definition at line 103 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
void MueLu::CoupledAggregationCommHelper< LocalOrdinal, GlobalOrdinal, Node >::ArbitrateAndCommunicate | ( | Vector & | weight, |
LOVector & | procWinner, | ||
LOMultiVector * | companion, | ||
const bool | perturb ) const |
This class uses a weighted rendezvous algorithm to do a global reduction on a vector that may be based on a non unique map.
A non-unique map is one that has at least one global ID that occurs on two or more processes. For each repeated ID \(i\), the algorithm finds the maximum value \(v[i]\) in the weight vector \(v\). This value is communicated to all processors that have \(i\) in their local map. More details are below.
For each GlobalId \(K\) associated with weight.getMap():
-# Find the maximum absolute value of \f$weight[K]\f$ across all processors and assign this to all local elements of weight[] (across processors) that are associated with \f$K\f$. -# Set procWinner[] to the MyPid() that had the largest element. procWinner[] is still set if only one processor owns a GlobalId. The ONLY CASE when procWinner[i] is NOT set corresponds to when all local weights associated with a GlobalId are zero. This allows one to effectively skip the maximum/winner calculation for a subset of GlobalId's. This might occur when a processor has already claimed ownership for a GlobalId and so all local copies have the same value. We want to skip the maximum calculation with tiebreaking to avoid another processor claiming ownership. -# Optionally, set companion[] (across all relevant processors) to the local companion value associated with the procWinner[] processor. @param weight[in,out] - On input, vector of NONNEGATIVE weights. - On output, \f$ \mbox{weight}[k] \Leftarrow \max(\mbox{weight}[k_{p1}],\dots,\mbox{weight}[k_{pn}]) \f$ where \f$ \mbox{weight}[k_{pj}] \f$ is processor \f$pj\f$'s value for GID \f$k\f$. @param procWinner[in,out] - On input, allocated but contents ignored. - On output, \f$\mbox{procWinner}[k] \Leftarrow pj\f$ such that \f$\mbox{weight}[k_{pj}] = \max(\mbox{weight}[k_{p1}],...,\mbox{weight}[k_{pn}])\f$, where \f$ \mbox{weight}[k_{pj}] \f$ is processor \f$pj\f$'s value for GID \f$k\f$. NOTE: If all input \f$\mbox{weight}[k_{pi}]\f$'s are zero, then \f$\mbox{procWinner}[k]\f$ is left untouched. @param companion[in,out] - On input, either NULL or allocated but contents ignored. If NULL, step 3 above is skipped. - On output, if not null, \f$\mbox{companion}[k] \Leftarrow \mbox{companion}[k_j]\f$ where \f$\mbox{companion}[k_j]\f$ lives on processor \f$\mbox{procWinner}[k]\f$. and corresponds to the same GlobalId as \f$k\f$. NOTE: If for a particular GlobalId, no processor has a value of procWinner that matches its MyPid, the corresponding companion is not altered. @param perturb[in] Optional arguments that is either true or false (default: true). weight is perturbed and the perturbed values are used in step 1) above. Returned values reflect the perturbed data. This option avoids having lots of tiebreaks where the large MyPid() always wins.
Definition at line 73 of file MueLu_CoupledAggregationCommHelper_def.hpp.
void MueLu::CoupledAggregationCommHelper< LocalOrdinal, GlobalOrdinal, Node >::NonUnique2NonUnique | ( | const Vector & | source, |
Vector & | dest, | ||
const Xpetra::CombineMode | what ) const |
Redistribute data in source to dest where both source and dest might have multiple copies of the same global id across many processors.
The source may not have the same value for all of these multiple copies, but on termination dest will have a unique value for each global id. When multiple copies exist in source, 'what' determines how they are combined to make a unique value in dest (see CombineMode).
Input:
[in] | source | Vector where multiple copies of some GlobalIds might exist and might have different values. |
[in,out] | dest | On input, allocated but contents ignored. On output, contains redistributed data from source where 'what' determines how multiple copies of source values associated with the same GlobalId are combined into a unique value on all processors. |
[in] | what | Determines how multiple copies of the same GlobalId are combined (see CombineMode). |
Definition at line 475 of file MueLu_CoupledAggregationCommHelper_def.hpp.
|
private |
Definition at line 212 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
mutableprivate |
Definition at line 213 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
mutableprivate |
Definition at line 214 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
private |
Definition at line 215 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
mutableprivate |
Definition at line 216 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
mutableprivate |
Definition at line 217 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
mutableprivate |
Definition at line 218 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
mutableprivate |
Definition at line 219 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
mutableprivate |
Definition at line 220 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
mutableprivate |
Definition at line 221 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
mutableprivate |
Definition at line 222 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
private |
Definition at line 223 of file MueLu_CoupledAggregationCommHelper_decl.hpp.