Isorropia: Partitioning, Load Balancing and more
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members

An implementation of the Partitioner interface that operates on Epetra matrices and linear systems. More...

#include <Isorropia_EpetraPartitioner.hpp>

Inheritance diagram for Isorropia::Epetra::Partitioner:
Inheritance graph
[legend]
Collaboration diagram for Isorropia::Epetra::Partitioner:
Collaboration graph
[legend]

Public Member Functions

 Partitioner (Teuchos::RCP< const Epetra_CrsGraph > inputGraph, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (const Epetra_CrsGraph *inputGraph, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (Teuchos::RCP< const Epetra_CrsGraph > inputGraph, Teuchos::RCP< CostDescriber > costs, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (const Epetra_CrsGraph *inputGraph, CostDescriber *costs, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (Teuchos::RCP< const Epetra_RowMatrix > inputMatrix, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (const Epetra_RowMatrix *inputMatrix, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (Teuchos::RCP< const Epetra_RowMatrix > inputMatrix, Teuchos::RCP< CostDescriber > costs, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (const Epetra_RowMatrix *inputMatrix, CostDescriber *costs, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (Teuchos::RCP< const Epetra_MultiVector > coords, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (const Epetra_MultiVector *coords, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (Teuchos::RCP< const Epetra_MultiVector > coords, Teuchos::RCP< const Epetra_MultiVector > weights, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (const Epetra_MultiVector *coords, const Epetra_MultiVector *weights, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (Teuchos::RCP< const Epetra_BlockMap > inputMap, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (const Epetra_BlockMap *inputMap, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (Teuchos::RCP< const Epetra_CrsGraph > inputGraph, Teuchos::RCP< const Epetra_MultiVector > coords, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (const Epetra_CrsGraph *inputGraph, const Epetra_MultiVector *coords, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (Teuchos::RCP< const Epetra_CrsGraph > inputGraph, Teuchos::RCP< CostDescriber > costs, Teuchos::RCP< const Epetra_MultiVector > coords, Teuchos::RCP< const Epetra_MultiVector > weights, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (const Epetra_CrsGraph *inputGraph, CostDescriber *costs, const Epetra_MultiVector *coords, const Epetra_MultiVector *weights, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (Teuchos::RCP< const Epetra_RowMatrix > inputMatrix, Teuchos::RCP< const Epetra_MultiVector > coords, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (const Epetra_RowMatrix *inputMatrix, const Epetra_MultiVector *coords, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (Teuchos::RCP< const Epetra_RowMatrix > inputMatrix, Teuchos::RCP< CostDescriber > costs, Teuchos::RCP< const Epetra_MultiVector > coords, Teuchos::RCP< const Epetra_MultiVector > weights, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
 Partitioner (const Epetra_RowMatrix *inputMatrix, CostDescriber *costs, const Epetra_MultiVector *coords, const Epetra_MultiVector *weights, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true)
 
virtual ~Partitioner ()
 Destructor. More...
 
void setPartSizes (int len, int *global_part_id, float *part_size)
 
void clearPartSizes ()
 
void partition (bool force_repartitioning=false)
 partition is the method that computes a rebalanced partitioning for the data in the object that this class was constructed with. More...
 
virtual void compute (bool forceRecomputing=false)
 Method which does the work of computing a new partitioning/coloring/ordering, depending on the child class used. More...
 
int numElemsInPart (int part) const
 Return the number of LOCAL elements in a given part. More...
 
void elemsInPart (int part, int *elementList, int len) const
 Fill user-allocated list (of length len) with the local element ids to be located in the given part. More...
 
Teuchos::RCP< Epetra_Map > createNewMap ()
 Create a new Epetra_Map corresponding to the new partition. More...
 
void createNewMap (Epetra_Map *&outputMap)
 Create a new Epetra_Map corresponding to the new partition. More...
 
int printZoltanMetrics ()
 
virtual int extractPartsView (int &size, const int *&array) const
 Give access of the part assignments array that is owned by the current processor. More...
 
virtual int extractPartsCopy (int len, int &size, int *array) const
 Copy a part of the part assignment array. More...
 
virtual void setParameters (const Teuchos::ParameterList &paramlist)=0
 Set parameters for the Operator instance. More...
 
void setParameters (const Teuchos::ParameterList &paramlist)
 setParameters() is an internal method which handles the parameters from a Teuchos::ParameterList object. More...
 
Teuchos::RCP
< Isorropia::Epetra::CostDescriber > & 
getCosts ()
 Get the cost object. More...
 
bool alreadyComputed () const
 Query whether compute_operation() has already been called. More...
 
int numProperties () const
 Return the number of different values used for "properties". More...
 
int numLocalProperties () const
 Return the number of different values used for "properties" for this process only. More...
 
virtual const int & operator[] (int myElem) const
 Return the new partition ID for a given element that resided locally in the old operation. More...
 
virtual int numElemsWithProperty (int property) const
 Return the number of elements in a given partition. More...
 
virtual void elemsWithProperty (int property, int *elementList, int len) const
 Fill user-allocated list (of length len) with the global element ids to be located in the given partition. More...
 
virtual int extractPropertiesCopy (int len, int &size, int *array) const
 Copy a part of the property array. More...
 
virtual int extractPropertiesView (int &size, const int *&array) const
 Give access of the property array that is owned by the current processor. More...
 
virtual bool alreadyComputed () const =0
 Query whether the computation has already been called. More...
 
virtual int numProperties () const =0
 Return the number of different values used for "properties". More...
 
virtual int numLocalProperties () const =0
 Return the number of different values used for "properties" for this process only. More...
 
virtual const int & operator[] (int myElem) const =0
 Return the "property" for a given element that resided locally. More...
 
virtual int numElemsWithProperty (int property) const =0
 Return the number of LOCAL elements with the given property. More...
 
virtual void elemsWithProperty (int property, int *elementList, int len) const =0
 Fill user-allocated list (of length len) with the local element ids of the LOCAL elements with the given property. More...
 
virtual int extractPropertiesView (int &size, const int *&array) const =0
 Give access of the property array that is owned by the current processor. More...
 
virtual int extractPropertiesCopy (int len, int &size, int *array) const =0
 Copy a part of the property array. More...
 

Protected Member Functions

void computeNumberOfProperties ()
 

Protected Attributes

Teuchos::RCP< const
Epetra_BlockMap > 
input_map_
 
Teuchos::RCP< const
Epetra_CrsGraph > 
input_graph_
 
Teuchos::RCP< const
Epetra_RowMatrix > 
input_matrix_
 
Teuchos::RCP< const
Epetra_MultiVector > 
input_coords_
 
Teuchos::RCP
< Isorropia::Epetra::CostDescriber
costs_
 
Teuchos::RCP< const
Epetra_MultiVector > 
weights_
 
Teuchos::ParameterList paramlist_
 
int exportsSize_
 
std::vector< int > imports_
 
std::vector< int > properties_
 
bool operation_already_computed_
 
int global_num_vertex_weights_
 
int global_num_graph_edge_weights_
 
int global_num_hg_edge_weights_
 
Teuchos::RCP< Librarylib_
 
int base_
 

Private Attributes

int * partGIDs
 
float * partSizes
 
int numPartSizes
 
int printMetrics
 

Detailed Description

An implementation of the Partitioner interface that operates on Epetra matrices and linear systems.

Examples:
geometric/example_rcb.cpp, graphedge_weights.cpp, hgedge_weights.cpp, part_redist.cpp, and vert_weights.cpp.

Member Function Documentation

void Isorropia::Epetra::Partitioner::setPartSizes ( int  len,
int *  global_part_id,
float *  part_size 
)
void Isorropia::Epetra::Partitioner::clearPartSizes ( )
int Isorropia::Epetra::Partitioner::printZoltanMetrics ( )
inline
virtual int Isorropia::Partitioner::extractPartsView ( int &  size,
const int *&  array 
) const
inlinevirtualinherited

Give access of the part assignments array that is owned by the current processor.

Parameters
[out]sizeNumber of elements in the array.
[out]arrayPointer to the the part assignements array inside the object.
Remarks
This pointer is only significant if the object still exists. Otherwise, you must use
See Also
Isorropia::Operator::extractPartsCopy()
Isorropia::Operator::extractPropertiesView()
virtual int Isorropia::Partitioner::extractPartsCopy ( int  len,
int &  size,
int *  array 
) const
inlinevirtualinherited

Copy a part of the part assignment array.

Parameters
[in]lenof the array given by the user.
[out]sizeNumber of elements in the array.
[out]arrayArray of part assignments. Allocated by the user with a size of at least len elements.
Remarks
Memory space which is not useful in the array is not initialized or used in this method.
See Also
Isorropia::Operator::extractPropertiesCopy()
virtual void Isorropia::Operator::setParameters ( const Teuchos::ParameterList &  paramlist)
pure virtualinherited

Set parameters for the Operator instance.

The contents of the input paramlist object are copied into an internal ParameterList attribute. Instances of this interface should not retain a reference to the input ParameterList after this method returns.

Parameters
[in]paramlistList of parameters that the user wants to use.

Implemented in Isorropia::Epetra::Operator.

virtual bool Isorropia::Operator::alreadyComputed ( ) const
pure virtualinherited

Query whether the computation has already been called.

Returns
True if the computation has already been done, False otherwise.

Implemented in Isorropia::Epetra::Operator.

virtual int Isorropia::Operator::numProperties ( ) const
pure virtualinherited

Return the number of different values used for "properties".

For example, the number of colors or the number of parts used for the overall graph/matrix.

Returns
Global number of values for properties
Remarks
Infact, it returns the upper bound of the interval of taken values. For example, for the colors "1,2,4" , it will return "4"

Implemented in Isorropia::Epetra::Operator.

virtual int Isorropia::Operator::numLocalProperties ( ) const
pure virtualinherited

Return the number of different values used for "properties" for this process only.

Returns
Local number of values for properties

Implemented in Isorropia::Epetra::Operator.

virtual const int& Isorropia::Operator::operator[] ( int  myElem) const
pure virtualinherited

Return the "property" for a given element that resided locally.

Parameters
[in]myElemthe local ID of the element we want to know the property.
Returns
property associated to the local element.

Implemented in Isorropia::Epetra::Operator.

virtual int Isorropia::Operator::numElemsWithProperty ( int  property) const
pure virtualinherited

Return the number of LOCAL elements with the given property.

Parameters
[in]propertyValue of the property to consider.
Returns
Number of local elems which have this property.

Implemented in Isorropia::Epetra::Operator.

virtual void Isorropia::Operator::elemsWithProperty ( int  property,
int *  elementList,
int  len 
) const
pure virtualinherited

Fill user-allocated list (of length len) with the local element ids of the LOCAL elements with the given property.

Parameters
[in]propertyValue of the property to consider.
[out]elementListUser allocated array (of size at least len) of local ID that have the asked property.
[in]lenMaximum lenght for the array. If len is greater than the result of numElemsWithProperty() for property, only the first and relevant elements are filled.
Remarks
Memory space which is not useful in the array is not initialized or used in this method.

Implemented in Isorropia::Epetra::Operator.

virtual int Isorropia::Operator::extractPropertiesView ( int &  size,
const int *&  array 
) const
pure virtualinherited

Give access of the property array that is owned by the current processor.

Parameters
[out]sizeNumber of elements in the array.
[out]arrayPointer to the the properties array inside the object.
Remarks
This pointer is only significant if the object still exists. Otherwise, you must use
See Also
Isorropia::Operator::extractPropertiesCopy().
Isorropia::Operator::extractPropertiesCopy()

Implemented in Isorropia::Epetra::Operator.

virtual int Isorropia::Operator::extractPropertiesCopy ( int  len,
int &  size,
int *  array 
) const
pure virtualinherited

Copy a part of the property array.

Parameters
[in]lenof the array given by the user.
[out]sizeNumber of elements in the array.
[out]arrayArray of properties. Allocated by the user with a size of at least len elements.
Remarks
Memory space which is not useful in the array is not initialized or used in this method.
See Also
Isorropia::Operator::extractPropertiesView()

Implemented in Isorropia::Epetra::Operator.

void Isorropia::Epetra::Operator::setParameters ( const Teuchos::ParameterList &  paramlist)
virtualinherited

setParameters() is an internal method which handles the parameters from a Teuchos::ParameterList object.

Implements Isorropia::Operator.

Teuchos::RCP<Isorropia::Epetra::CostDescriber>& Isorropia::Epetra::Operator::getCosts ( )
inlineinherited

Get the cost object.

bool Isorropia::Epetra::Operator::alreadyComputed ( ) const
inlinevirtualinherited

Query whether compute_operation() has already been called.

Implements Isorropia::Operator.

int Isorropia::Epetra::Operator::numProperties ( ) const
inlinevirtualinherited

Return the number of different values used for "properties".

For example, the number of colors or the number of parts used for the overall graph/matrix.

Returns
Global number of values for properties
Remarks
Infact, it returns the upper bound of the interval of taken values. For example, for the colors "1,2,4" , it will return "4"

Implements Isorropia::Operator.

int Isorropia::Epetra::Operator::numLocalProperties ( ) const
inlinevirtualinherited

Return the number of different values used for "properties" for this process only.

Returns
Local number of values for properties

Implements Isorropia::Operator.

virtual const int& Isorropia::Epetra::Operator::operator[] ( int  myElem) const
virtualinherited

Return the new partition ID for a given element that resided locally in the old operation.

Implements Isorropia::Operator.

virtual int Isorropia::Epetra::Operator::numElemsWithProperty ( int  property) const
virtualinherited

Return the number of elements in a given partition.

Implements Isorropia::Operator.

virtual void Isorropia::Epetra::Operator::elemsWithProperty ( int  property,
int *  elementList,
int  len 
) const
virtualinherited

Fill user-allocated list (of length len) with the global element ids to be located in the given partition.

Implements Isorropia::Operator.

virtual int Isorropia::Epetra::Operator::extractPropertiesCopy ( int  len,
int &  size,
int *  array 
) const
virtualinherited

Copy a part of the property array.

Parameters
[in]lenof the array given by the user.
[out]sizeNumber of elements in the array.
[out]arrayArray of properties. Allocated by the user with a size of at least len elements.
Remarks
Memory space which is not useful in the array is not initialized or used in this method.
See Also
Isorropia::Operator::extractPropertiesView()

Implements Isorropia::Operator.

virtual int Isorropia::Epetra::Operator::extractPropertiesView ( int &  size,
const int *&  array 
) const
virtualinherited

Give access of the property array that is owned by the current processor.

Parameters
[out]sizeNumber of elements in the array.
[out]arrayPointer to the the properties array inside the object.
Remarks
This pointer is only significant if the object still exists. Otherwise, you must use
See Also
Isorropia::Operator::extractPropertiesCopy().
Isorropia::Operator::extractPropertiesCopy()

Implements Isorropia::Operator.

void Isorropia::Epetra::Operator::computeNumberOfProperties ( )
protectedinherited

Member Data Documentation

int* Isorropia::Epetra::Partitioner::partGIDs
private
float* Isorropia::Epetra::Partitioner::partSizes
private
int Isorropia::Epetra::Partitioner::numPartSizes
private
int Isorropia::Epetra::Partitioner::printMetrics
private
Teuchos::RCP<const Epetra_BlockMap> Isorropia::Epetra::Operator::input_map_
protectedinherited
Teuchos::RCP<const Epetra_CrsGraph> Isorropia::Epetra::Operator::input_graph_
protectedinherited
Teuchos::RCP<const Epetra_RowMatrix> Isorropia::Epetra::Operator::input_matrix_
protectedinherited
Teuchos::RCP<const Epetra_MultiVector> Isorropia::Epetra::Operator::input_coords_
protectedinherited
Teuchos::RCP<Isorropia::Epetra::CostDescriber> Isorropia::Epetra::Operator::costs_
protectedinherited
Teuchos::RCP<const Epetra_MultiVector> Isorropia::Epetra::Operator::weights_
protectedinherited
Teuchos::ParameterList Isorropia::Epetra::Operator::paramlist_
protectedinherited
int Isorropia::Epetra::Operator::exportsSize_
protectedinherited
std::vector<int> Isorropia::Epetra::Operator::imports_
protectedinherited
std::vector<int> Isorropia::Epetra::Operator::properties_
protectedinherited
bool Isorropia::Epetra::Operator::operation_already_computed_
protectedinherited
int Isorropia::Epetra::Operator::global_num_vertex_weights_
protectedinherited
int Isorropia::Epetra::Operator::global_num_graph_edge_weights_
protectedinherited
int Isorropia::Epetra::Operator::global_num_hg_edge_weights_
protectedinherited
Teuchos::RCP<Library> Isorropia::Epetra::Operator::lib_
protectedinherited
int Isorropia::Epetra::Operator::base_
protectedinherited

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