MueLu
Version of the Day
|
Helper class for providing arbitrated communication across processors. More...
#include <MueLu_CoupledAggregationCommHelper_decl.hpp>
Public Member Functions | |
void | ArbitrateAndCommunicate (Vector &weights, Aggregates &aggregates, const bool perturb) const |
This method assigns unknowns to aggregates. More... | |
void | ArbitrateAndCommunicate (Vector &weight, LOVector &procWinner, LOVector *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. More... | |
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. More... | |
![]() | |
virtual | ~BaseClass () |
Destructor. More... | |
![]() | |
VerbLevel | GetVerbLevel () const |
Get the verbosity level. More... | |
void | SetVerbLevel (const VerbLevel verbLevel) |
Set the verbosity level of this object. More... | |
int | GetProcRankVerbose () const |
Get proc rank used for printing. Do not use this information for any other purpose. More... | |
int | SetProcRankVerbose (int procRank) const |
Set proc rank used for printing. More... | |
bool | IsPrint (MsgType type, int thisProcRankOnly=-1) const |
Find out whether we need to print out information for a specific message type. More... | |
Teuchos::FancyOStream & | GetOStream (MsgType type, int thisProcRankOnly=0) const |
Get an output stream for outputting the input message type. More... | |
Teuchos::FancyOStream & | GetBlackHole () const |
VerboseObject () | |
virtual | ~VerboseObject () |
Destructor. More... | |
![]() | |
virtual | ~Describable () |
Destructor. More... | |
virtual std::string | ShortClassName () const |
Return the class name of the object, without template parameters and without namespace. More... | |
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. More... | |
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. More... | |
Private Types | |
typedef double | Scalar |
Private Attributes | |
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_ |
Constructors/Destructors. | |
CoupledAggregationCommHelper (const RCP< const Map > &uniqueMap, const RCP< const Map > &nonUniqueMap) | |
Constructor. More... | |
~CoupledAggregationCommHelper () | |
Destructor. More... | |
Additional Inherited Members | |
![]() | |
static void | SetDefaultOStream (const Teuchos::RCP< Teuchos::FancyOStream > &defaultOStream) |
static Teuchos::RCP< Teuchos::FancyOStream > | GetDefaultOStream () |
static void | SetDefaultVerbLevel (const VerbLevel defaultVerbLevel) |
Set the default (global) verbosity level. More... | |
static VerbLevel | GetDefaultVerbLevel () |
Get the default (global) verbosity level. More... | |
Helper class for providing arbitrated communication across processors.
For more details, see the comments for the ArbitrateAndCommunicate methods.
Definition at line 69 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
private |
Definition at line 71 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 61 of file MueLu_CoupledAggregationCommHelper_def.hpp.
|
inline |
Destructor.
Definition at line 84 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
inline |
This method assigns unknowns to aggregates.
Tie-breaking is possible is using random weights.
[in] | weights | vector of weights that help determine ownership. |
[in,out] | aggregates | aggregate data structure |
[in] | perturb | flag indicating whether weights should be randomly perturbed for tie-breaking purposes. |
Definition at line 99 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
void MueLu::CoupledAggregationCommHelper< LocalOrdinal, GlobalOrdinal, Node >::ArbitrateAndCommunicate | ( | Vector & | weight, |
LOVector & | procWinner, | ||
LOVector * | 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 \form#4 across all processors and assign this to all local elements of weight[] (across processors) that are associated with \form#3. -# 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, \form#5 where \form#6 is processor \form#7's value for GID \form#8. @param procWinner[in,out] - On input, allocated but contents ignored. - On output, \form#9 such that
\(\mbox{weight}[k_{pj}] = \max(\mbox{weight}[k_{p1}],...,\mbox{weight}[k_{pn}])\), where \( \mbox{weight}[k_{pj}] \) is processor \(pj\)'s value for GID \(k\). NOTE: If all input \(\mbox{weight}[k_{pi}]\)'s are zero, then \(\mbox{procWinner}[k]\) is left untouched.
companion[in,out] |
|
@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 70 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 472 of file MueLu_CoupledAggregationCommHelper_def.hpp.
|
private |
Definition at line 208 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
mutableprivate |
Definition at line 209 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
mutableprivate |
Definition at line 210 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
private |
Definition at line 211 of file MueLu_CoupledAggregationCommHelper_decl.hpp.
|
mutableprivate |
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.
|
mutableprivate |
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.
|
private |
Definition at line 219 of file MueLu_CoupledAggregationCommHelper_decl.hpp.