Ifpack2 Templated Preconditioning Package  Version 1.0
Public Member Functions | List of all members
Ifpack2::Partitioner< GraphType > Class Template Referenceabstract

Ifpack2::Partitioner: A class to decompose local Ifpack2::Graph objects. More...

#include <Ifpack2_Partitioner.hpp>

Inherits Describable.

Inherited by Ifpack2::OverlappingPartitioner< GraphType >.

Public Member Functions

virtual ~Partitioner ()
 Destructor. More...
 
virtual LocalOrdinal numLocalParts () const =0
 Returns the number of computed local partitions. More...
 
virtual size_t overlappingLevel () const =0
 Returns the overlapping level. More...
 
virtual LocalOrdinal operator() (LocalOrdinal MyRow) const =0
 Returns the local non-overlapping partition ID of the specified row. More...
 
virtual LocalOrdinal operator() (LocalOrdinal i, LocalOrdinal j) const =0
 Returns the local overlapping partition ID of the j-th node in partition i. More...
 
virtual size_t numRowsInPart (const LocalOrdinal Part) const =0
 Returns the number of rows contained in specified partition. More...
 
virtual void rowsInPart (const LocalOrdinal Part, Teuchos::ArrayRCP< LocalOrdinal > &List) const =0
 Copies into List the rows in the (overlapping) partition Part. More...
 
virtual Teuchos::ArrayView< const LocalOrdinal > nonOverlappingPartition () const =0
 Returns an ArrayRCP to the integer vector containing the non-overlapping partition ID of each local row. More...
 
virtual void setParameters (Teuchos::ParameterList &List)=0
 Sets all the parameters for the partitioner. More...
 
virtual void compute ()=0
 Computes the partitions. Returns 0 if successful. More...
 
virtual bool isComputed () const =0
 Returns true if partitions have been computed successfully. More...
 
virtual std::ostream & print (std::ostream &os) const =0
 Prints basic information about the partitioning object. More...
 

Detailed Description

template<class GraphType>
class Ifpack2::Partitioner< GraphType >

Ifpack2::Partitioner: A class to decompose local Ifpack2::Graph objects.

Class Ifpack2::Partitioner enables the decomposition of a local Ifpack2::Graph. It is supposed that the graph refers to a localized matrix (that is, a matrix that has been filtered through Ifpack2::LocalFilter).

The overloaded operator (int i) can be used to extract the local partition ID of local row i.

The partitions created by Ifpack2::Partitioner derived clased are non-overlapping in graph sense. This means that each row (or, more approriately, vertex) of G is assigned to exactly one partition.

Partitioner can be extended using the functionalities of class Ifpack2_OverlappingPartitioner (itself derived from Ifpack2_Partitioner. This class extends the non-overlapping partitions by the required amount of overlap, considering local nodes only (that is, this overlap do not modify the overlap among the processes).

Ifpack2::Partitioner is a pure virtual class. Concrete implementations are:

Generically, a constructor requires a Tpetra::RowGraph object.

An example use of a Ifpack2::Partitioner derived class is as follows:

#include "Ifpack2_Partitioner.hpp"
#include "Ifpack2_LinearPartitioner.hpp"
#include "Ifpack2_Graph.hpp"
#include "Ifpack2_Graph_Tpetra_CrsGraph.hpp"
...
Tpetra_CrsMatrix* A; // A is filled
// create the wrapper from Tpetra_CrsGraph
Ifpack2_Graph* Graph = new Ifpack2_Graph_Tpetra_CrsGraph(A);
// we aim to create non-overlapping partitions only
Ifpack2_Partitioner Partitioner(Graph);
Ifpack2_Partitioner* Partitioner;
Partitioner = new Ifpack2_Graph_Tpetra_CrsGraph(&A);
// we want 16 local parts
List.set("partitioner: local parts", 16);
// and an overlap of 0 among the local parts (default option)
List.set("partitioner: overlap", 0);
// decompose the graph
Partitioner.Create(List);
// now Graph can be deleted, as Partitioner contains all the
// necessary information to use the partitions
delete Graph;
// we can get the number of parts actually created...
int NumParts = Partitioner.NumParts();
// ... and the number of rows in each of them
for (int i = 0 ; i < NumParts ; ++i) {
cout << "rows in " << i << "=" << Partitioner.RowsInPart(i);
}
// .. and, for non-overlapping partitions only, the partition ID
// for each local row simply using:
for (int i = 0 ; i < A->NumMyRows() ; ++i)
cout << "Partition[" << i <<"] = " << Partitioner(i) << endl;

When overlapping partitiones are created, the user can get the row ID contained in each partition as follows:

for (int i = 0 ; i < NumParts ; ++i) {
for (int j = 0 ; j < Partitioner.RowsInPart(i) ; ++j) {
cout << "Partition " << i << ", contains local row "
<< Partitioner(i,j) << endl;
}
}

Ifpack2_Partitioner is used to create the subblocks in Ifpack2_BlockJacobi, Ifpack2_BlockGaussSeidel, and Ifpack2_BlockSymGaussSeidel.

Author
Michael Heroux, SNL 9214.
Date
Last modified on Nov-04.

Constructor & Destructor Documentation

template<class GraphType >
virtual Ifpack2::Partitioner< GraphType >::~Partitioner ( )
inlinevirtual

Destructor.

Member Function Documentation

template<class GraphType >
virtual LocalOrdinal Ifpack2::Partitioner< GraphType >::numLocalParts ( ) const
pure virtual

Returns the number of computed local partitions.

template<class GraphType >
virtual size_t Ifpack2::Partitioner< GraphType >::overlappingLevel ( ) const
pure virtual

Returns the overlapping level.

template<class GraphType >
virtual LocalOrdinal Ifpack2::Partitioner< GraphType >::operator() ( LocalOrdinal  MyRow) const
pure virtual

Returns the local non-overlapping partition ID of the specified row.

Returns the non-overlapping partition ID of the specified row.

Parameters
MyRow- (In) local row number
Returns
Local ID of non-overlapping partition for MyRow.
template<class GraphType >
virtual LocalOrdinal Ifpack2::Partitioner< GraphType >::operator() ( LocalOrdinal  i,
LocalOrdinal  j 
) const
pure virtual

Returns the local overlapping partition ID of the j-th node in partition i.

template<class GraphType >
virtual size_t Ifpack2::Partitioner< GraphType >::numRowsInPart ( const LocalOrdinal  Part) const
pure virtual

Returns the number of rows contained in specified partition.

template<class GraphType >
virtual void Ifpack2::Partitioner< GraphType >::rowsInPart ( const LocalOrdinal  Part,
Teuchos::ArrayRCP< LocalOrdinal > &  List 
) const
pure virtual

Copies into List the rows in the (overlapping) partition Part.

template<class GraphType >
virtual Teuchos::ArrayView<const LocalOrdinal> Ifpack2::Partitioner< GraphType >::nonOverlappingPartition ( ) const
pure virtual

Returns an ArrayRCP to the integer vector containing the non-overlapping partition ID of each local row.

template<class GraphType >
virtual void Ifpack2::Partitioner< GraphType >::setParameters ( Teuchos::ParameterList &  List)
pure virtual

Sets all the parameters for the partitioner.

template<class GraphType >
virtual void Ifpack2::Partitioner< GraphType >::compute ( )
pure virtual

Computes the partitions. Returns 0 if successful.

template<class GraphType >
virtual bool Ifpack2::Partitioner< GraphType >::isComputed ( ) const
pure virtual

Returns true if partitions have been computed successfully.

template<class GraphType >
virtual std::ostream& Ifpack2::Partitioner< GraphType >::print ( std::ostream &  os) const
pure virtual

Prints basic information about the partitioning object.


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