Ifpack2 Templated Preconditioning Package
Version 1.0
|
#include <Ifpack2_Partitioner.hpp>
Public Member Functions | |
virtual | ~Partitioner () |
Destructor. More... | |
virtual int | numLocalParts () const =0 |
Number of computed local partitions. More... | |
virtual int | overlappingLevel () const =0 |
The level of overlap. More... | |
virtual LocalOrdinal | operator() (LocalOrdinal MyRow) const =0 |
The local (nonoverlapping) partition index of the specified local row. More... | |
virtual LocalOrdinal | operator() (LocalOrdinal i, LocalOrdinal j) const =0 |
The local overlapping partition index of the j-th node in partition i. More... | |
virtual size_t | numRowsInPart (const LocalOrdinal Part) const =0 |
The number of rows contained in the specified partition. More... | |
virtual void | rowsInPart (const LocalOrdinal Part, Teuchos::ArrayRCP< LocalOrdinal > &List) const =0 |
Copy into List the rows in the (overlapping) partition Part. More... | |
virtual Teuchos::ArrayView < const LocalOrdinal > | nonOverlappingPartition () const =0 |
The nonoverlapping partition indices of each local row. More... | |
virtual void | setParameters (Teuchos::ParameterList &List)=0 |
Set all the parameters for the partitioner. More... | |
virtual void | compute ()=0 |
Compute the partitions. More... | |
virtual bool | isComputed () const =0 |
Return true if partitions have been computed successfully. More... | |
virtual std::ostream & | print (std::ostream &os) const =0 |
Print basic information about the partitioning object. More... | |
A class to decompose local graphs.
Most Ifpack2 users will not need to create or use a Partitioner instance, or write a Partitioner subclass. However, those implementing their own block relaxation algorithms may need to interact with Partitioner or write their own subclass thereof. Ifpack2's main application of this class is in BlockRelaxation. Partitioner defines the diagonal blocks of the matrix that BlockRelaxation uses. BlockRelaxation creates a Partitioner subclass instance internally.
A Partitioner instance can partition a local graph by rows. A local graph is one for which, on every process, the column Map contains no entries not in the domain Map on that process. You may use LocalFilter on the graph of a matrix to make a local graph; it excludes entries in the column Map not in the domain Map. This class assumes that the graph is local.
The partitions created by Partitioner implementations are nonoverlapping in the graph sense. This means that each row (or, more appropriately, vertex) of the graph belongs to at most one partition. Furthermore, these nonoverlapping partitions are local: partitions do not cross process boundaries.
operator () (LocalOrdinal i)
returns the local partition index corresponding to local row i of the graph. The above implies that the local partition index is unique.
The OverlappingPartitioner subclass extends the nonoverlapping partitions by the required amount of overlap, considering local vertices only. That is, this overlap does not modify the overlap among the processes. (The mathematical definition of "partition" does not allow overlap, but we accept this as a useful extension.)
Partitioner is just an interface; it does not implement any fucntionality. You cannot create an instance of Partitioner; you must instantiate a concrete implementation thereof. Concrete implementations include:
The constructor takes a Tpetra::RowGraph instance, which is the graph to partition.
The following example code shows how to use LinearPartitioner, a subclass of Partitioner. Note that most Ifpack2 users will not need to create or interact with Partitioner instances. We only show this example for the sake of developers who might need to implement or use Preconditioner subclasses, and want an example of a Partitioner "in action."
When overlapping partitions are created, users can get the local indices of the rows in each partition:
|
inlinevirtual |
Destructor.
|
pure virtual |
Number of computed local partitions.
See Ifpack2_OverlappingPartitioner_decl.hpp for explanation of why this is an int
instead of LocalOrdinal
.
Implemented in Ifpack2::OverlappingPartitioner< GraphType >.
|
pure virtual |
The level of overlap.
Implemented in Ifpack2::OverlappingPartitioner< GraphType >.
|
pure virtual |
The local (nonoverlapping) partition index of the specified local row.
MyRow | [in] Local index of the row. |
Implemented in Ifpack2::OverlappingPartitioner< GraphType >.
|
pure virtual |
The local overlapping partition index of the j-th node in partition i.
Implemented in Ifpack2::OverlappingPartitioner< GraphType >.
|
pure virtual |
The number of rows contained in the specified partition.
Implemented in Ifpack2::OverlappingPartitioner< GraphType >.
|
pure virtual |
Copy into List the rows in the (overlapping) partition Part.
Implemented in Ifpack2::OverlappingPartitioner< GraphType >.
|
pure virtual |
The nonoverlapping partition indices of each local row.
Implemented in Ifpack2::OverlappingPartitioner< GraphType >.
|
pure virtual |
Set all the parameters for the partitioner.
Implemented in Ifpack2::OverlappingPartitioner< GraphType >.
|
pure virtual |
Compute the partitions.
Implemented in Ifpack2::OverlappingPartitioner< GraphType >.
|
pure virtual |
Return true if partitions have been computed successfully.
Implemented in Ifpack2::OverlappingPartitioner< GraphType >.
|
pure virtual |
Print basic information about the partitioning object.
Implemented in Ifpack2::OverlappingPartitioner< GraphType >.