Ifpack2 Templated Preconditioning Package Version 1.0

Ifpack2::Partitioner: A class to decompose local Ifpack2::Graph objects. More...
#include <Ifpack2_Partitioner.hpp>
Public Member Functions  
virtual  ~Partitioner () 
Destructor.  
virtual size_t  numLocalParts () const =0 
Returns the number of computed local partitions.  
virtual size_t  overlappingLevel () const =0 
Returns the overlapping level.  
virtual LocalOrdinal  operator() (LocalOrdinal MyRow) const =0 
Returns the local nonoverlapping partition ID of the specified row.  
virtual LocalOrdinal  operator() (LocalOrdinal i, LocalOrdinal j) const =0 
Returns the local overlapping partition ID of the jth node in partition i.  
virtual size_t  numRowsInPart (const LocalOrdinal Part) const =0 
Returns the number of rows contained in specified partition.  
virtual void  rowsInPart (const LocalOrdinal Part, Teuchos::ArrayRCP< LocalOrdinal > &List) const =0 
Copies into List the rows in the (overlapping) partition Part.  
virtual Teuchos::ArrayView < const LocalOrdinal >  nonOverlappingPartition () const =0 
Returns an ArrayRCP to the integer vector containing the nonoverlapping partition ID of each local row.  
virtual void  setParameters (Teuchos::ParameterList &List)=0 
Sets all the parameters for the partitioner.  
virtual void  compute ()=0 
Computes the partitions. Returns 0 if successful.  
virtual bool  isComputed () const =0 
Returns true if partitions have been computed successfully.  
virtual std::ostream &  print (std::ostream &os) const =0 
Prints basic information about the partitioning object. 
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 nonoverlapping 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 nonoverlapping 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 nonoverlapping 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 nonoverlapping 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.
virtual Ifpack2::Partitioner< GraphType >::~Partitioner  (  )  [inline, virtual] 
Destructor.
virtual size_t Ifpack2::Partitioner< GraphType >::numLocalParts  (  )  const [pure virtual] 
Returns the number of computed local partitions.
virtual size_t Ifpack2::Partitioner< GraphType >::overlappingLevel  (  )  const [pure virtual] 
Returns the overlapping level.
virtual LocalOrdinal Ifpack2::Partitioner< GraphType >::operator()  (  LocalOrdinal  MyRow  )  const [pure virtual] 
Returns the local nonoverlapping partition ID of the specified row.
Returns the nonoverlapping partition ID of the specified row.
MyRow   (In) local row number 
virtual LocalOrdinal Ifpack2::Partitioner< GraphType >::operator()  (  LocalOrdinal  i, 
LocalOrdinal  j  
)  const [pure virtual] 
Returns the local overlapping partition ID of the jth node in partition i.
virtual size_t Ifpack2::Partitioner< GraphType >::numRowsInPart  (  const LocalOrdinal  Part  )  const [pure virtual] 
Returns the number of rows contained in specified partition.
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.
virtual Teuchos::ArrayView<const LocalOrdinal> Ifpack2::Partitioner< GraphType >::nonOverlappingPartition  (  )  const [pure virtual] 
Returns an ArrayRCP to the integer vector containing the nonoverlapping partition ID of each local row.
virtual void Ifpack2::Partitioner< GraphType >::setParameters  (  Teuchos::ParameterList &  List  )  [pure virtual] 
Sets all the parameters for the partitioner.
virtual void Ifpack2::Partitioner< GraphType >::compute  (  )  [pure virtual] 
Computes the partitions. Returns 0 if successful.
virtual bool Ifpack2::Partitioner< GraphType >::isComputed  (  )  const [pure virtual] 
Returns true if partitions have been computed successfully.
virtual std::ostream& Ifpack2::Partitioner< GraphType >::print  (  std::ostream &  os  )  const [pure virtual] 
Prints basic information about the partitioning object.