Isorropia: Partitioning, Load Balancing and more
|
An implementation of the Partitioner interface that operates on Epetra matrices and linear systems. More...
#include <Isorropia_EpetraPartitioner2D.hpp>
Public Member Functions | |
Partitioner2D (Teuchos::RCP< const Epetra_CrsGraph > input_graph, const Teuchos::ParameterList ¶mlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true) | |
Constructor that accepts an Epetra_CrsGraph object, called by API function create_partitioner(). More... | |
Partitioner2D (Teuchos::RCP< const Epetra_RowMatrix > input_matrix, const Teuchos::ParameterList ¶mlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_partitioning_now=true) | |
Constructor that accepts an Epetra_RowMatrix object, called by API function create_partitioner(). More... | |
virtual | ~Partitioner2D () |
Destructor. More... | |
void | partition (bool force_repartitioning=false) |
partition is a 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... | |
int | getNZIndx (int row, int column) const |
void | elemsInPart (int part, int *elementList, int len) const |
global element ids to be located in the given partition. More... | |
int | createDomainAndRangeMaps (Epetra_Map *domainMap, Epetra_Map *rangeMap) |
int | createColumnMap (Epetra_Map *colMap) |
int | createRowMap (Epetra_Map *rowMap) |
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 ¶mlist)=0 |
Set parameters for the Operator instance. More... | |
void | setParameters (const Teuchos::ParameterList ¶mlist) |
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< Library > | lib_ |
int | base_ |
An implementation of the Partitioner interface that operates on Epetra matrices and linear systems.
Isorropia::Epetra::Partitioner2D::Partitioner2D | ( | Teuchos::RCP< const Epetra_CrsGraph > | input_graph, |
const Teuchos::ParameterList & | paramlist = Teuchos::ParameterList("EmptyParameterList") , |
||
bool | compute_partitioning_now = true |
||
) |
Constructor that accepts an Epetra_CrsGraph object, called by API function create_partitioner().
input_graph | Matrix-graph object for which a new partitioning is to be computed. A Teuchos::RefCountPtr is used here because a reference to the input object may be held by this object after this constructor completes and returns. |
paramlist | Teuchos::ParameterList which will be copied to an internal ParameterList attribute. No reference to this input object is held after this constructor completes. If the ParameterList object contains a sublist named "Zoltan", then the Zoltan library is used to perform the balancing. Also, any parameters in the "Zoltan" sublist will be relayed directly to Zoltan. Refer to the Zoltan users guide for specific parameters that Zoltan recognizes. A couple of important ones are "LB_METHOD" (valid values include "GRAPH", "HYPERGRAPH"), "DEBUG_LEVEL" (valid values are 0 to 10, default is 1), etc. |
compute_partitioning_now | Optional argument defaults to true. If true, the method compute_partitioning() will be called before this constructor returns. |
Isorropia::Epetra::Partitioner2D::Partitioner2D | ( | Teuchos::RCP< const Epetra_RowMatrix > | input_matrix, |
const Teuchos::ParameterList & | paramlist = Teuchos::ParameterList("EmptyParameterList") , |
||
bool | compute_partitioning_now = true |
||
) |
Constructor that accepts an Epetra_RowMatrix object, called by API function create_partitioner().
input_matrix | Matrix object for which a new partitioning is to be computed. A Teuchos::RefCountPtr is used here because a reference to the input object may be held by this object after this constructor completes and returns. |
paramlist | Teuchos::ParameterList which will be copied to an internal ParameterList attribute. No reference to this input object is held after this constructor completes. If the ParameterList object contains a sublist named "Zoltan", then the Zoltan library is used to perform the balancing. Also, any parameters in the "Zoltan" sublist will be relayed directly to Zoltan. Refer to the Zoltan users guide for specific parameters that Zoltan recognizes. A couple of important ones are "LB_METHOD" (valid values include "GRAPH", "HYPERGRAPH"), "DEBUG_LEVEL" (valid values are 0 to 10, default is 1), etc. |
compute_partitioning_now | Optional argument defaults to true. If true, the method compute_partitioning() will be called before this constructor returns. |
|
virtual |
Destructor.
Reimplemented from Isorropia::Partitioner2D.
|
virtual |
partition is a method that computes a rebalanced partitioning for the data in the object that this class was constructed with.
force_repartitioning | Optional argument defaults to false. By default, compute_partitioning() only does anything the first time it is called, and subsequent repeated calls are no-ops. If the user's intent is to re-compute the partitioning (e.g., if parameters or other inputs have been changed), then setting this flag to true will force a new partitioning to be computed. |
Implements Isorropia::Partitioner2D.
|
virtual |
Method which does the work of computing a new partitioning/coloring/ordering, depending on the child class used.
forceRecomputing | Optional argument defaults to false. Depending on the implementation, compute() should only perform a computation the first time it is called, and subsequent repeated calls are no-ops. If the user's intent is to re-compute the results (e.g., if parameters or other inputs have been changed), then setting this flag to true will force a new result to be computed. |
Implements Isorropia::Epetra::Operator.
|
virtual |
Return the number of LOCAL elements in a given part.
[in] | part | the part ID we want to know the number of local elements. |
Implements Isorropia::Partitioner2D.
int Isorropia::Epetra::Partitioner2D::getNZIndx | ( | int | row, |
int | column | ||
) | const |
|
virtual |
global element ids to be located in the given partition.
Implements Isorropia::Partitioner2D.
int Isorropia::Epetra::Partitioner2D::createDomainAndRangeMaps | ( | Epetra_Map * | domainMap, |
Epetra_Map * | rangeMap | ||
) |
int Isorropia::Epetra::Partitioner2D::createColumnMap | ( | Epetra_Map * | colMap | ) |
int Isorropia::Epetra::Partitioner2D::createRowMap | ( | Epetra_Map * | rowMap | ) |
|
inlinevirtualinherited |
Give access of the part assignments array that is owned by the current processor.
[out] | size | Number of elements in the array. |
[out] | array | Pointer to the the part assignements array inside the object. |
|
inlinevirtualinherited |
Copy a part of the part assignment array.
[in] | len | of the array given by the user. |
[out] | size | Number of elements in the array. |
[out] | array | Array of part assignments. Allocated by the user with a size of at least len elements. |
|
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.
[in] | paramlist | List of parameters that the user wants to use. |
Implemented in Isorropia::Epetra::Operator.
|
pure virtualinherited |
Query whether the computation has already been called.
True
if the computation has already been done, False
otherwise. Implemented in Isorropia::Epetra::Operator.
|
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.
Implemented in Isorropia::Epetra::Operator.
|
pure virtualinherited |
Return the number of different values used for "properties" for this process only.
Implemented in Isorropia::Epetra::Operator.
|
pure virtualinherited |
Return the "property" for a given element that resided locally.
[in] | myElem | the local ID of the element we want to know the property. |
Implemented in Isorropia::Epetra::Operator.
|
pure virtualinherited |
Return the number of LOCAL elements with the given property.
[in] | property | Value of the property to consider. |
Implemented in Isorropia::Epetra::Operator.
|
pure virtualinherited |
Fill user-allocated list (of length len) with the local element ids of the LOCAL elements with the given property.
[in] | property | Value of the property to consider. |
[out] | elementList | User allocated array (of size at least len ) of local ID that have the asked property. |
[in] | len | Maximum lenght for the array. If len is greater than the result of numElemsWithProperty() for property , only the first and relevant elements are filled. |
Implemented in Isorropia::Epetra::Operator.
|
pure virtualinherited |
Give access of the property array that is owned by the current processor.
[out] | size | Number of elements in the array. |
[out] | array | Pointer to the the properties array inside the object. |
Implemented in Isorropia::Epetra::Operator.
|
pure virtualinherited |
Copy a part of the property array.
[in] | len | of the array given by the user. |
[out] | size | Number of elements in the array. |
[out] | array | Array of properties. Allocated by the user with a size of at least len elements. |
Implemented in Isorropia::Epetra::Operator.
|
virtualinherited |
setParameters() is an internal method which handles the parameters from a Teuchos::ParameterList object.
Implements Isorropia::Operator.
|
inlineinherited |
Get the cost object.
|
inlinevirtualinherited |
Query whether compute_operation() has already been called.
Implements Isorropia::Operator.
|
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.
Implements Isorropia::Operator.
|
inlinevirtualinherited |
Return the number of different values used for "properties" for this process only.
Implements Isorropia::Operator.
|
virtualinherited |
Return the new partition ID for a given element that resided locally in the old operation.
Implements Isorropia::Operator.
|
virtualinherited |
Return the number of elements in a given partition.
Implements Isorropia::Operator.
|
virtualinherited |
Fill user-allocated list (of length len) with the global element ids to be located in the given partition.
Implements Isorropia::Operator.
|
virtualinherited |
Copy a part of the property array.
[in] | len | of the array given by the user. |
[out] | size | Number of elements in the array. |
[out] | array | Array of properties. Allocated by the user with a size of at least len elements. |
Implements Isorropia::Operator.
|
virtualinherited |
Give access of the property array that is owned by the current processor.
[out] | size | Number of elements in the array. |
[out] | array | Pointer to the the properties array inside the object. |
Implements Isorropia::Operator.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |