Isorropia::Epetra::Partitioner Class Reference

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]
List of all members.

Public Member Functions

 Partitioner (Teuchos::RCP< const Epetra_CrsGraph > input_graph, const Teuchos::ParameterList &paramlist, bool compute_partitioning_now=true)
 Constructor that accepts an Epetra_CrsGraph object, called by API function create_partitioner().
 Partitioner (Teuchos::RCP< const Epetra_CrsGraph > input_graph, Teuchos::RCP< CostDescriber > costs, const Teuchos::ParameterList &paramlist, bool compute_partitioning_now=true)
 Constructor that accepts an Epetra_CrsGraph object and a CostDescriber, called by API function create_partitioner().
 Partitioner (Teuchos::RCP< const Epetra_RowMatrix > input_matrix, const Teuchos::ParameterList &paramlist, bool compute_partitioning_now=true)
 Constructor that accepts an Epetra_RowMatrix object, called by API function create_partitioner().
 Partitioner (Teuchos::RCP< const Epetra_RowMatrix > input_matrix, Teuchos::RCP< CostDescriber > costs, const Teuchos::ParameterList &paramlist, bool compute_partitioning_now=true)
 Constructor that accepts an Epetra_RowMatrix object and a CostDescriber, called by API function create_partitioner().
virtual ~Partitioner ()
 Destructor.
void partition (bool force_repartitioning=false)
 partition is an internal method that computes a rebalanced partitioning for the data in the object that this class was constructed with.
virtual void compute (bool forceRecomputing=false)
 Method which does the work of computing a new partitioning/coloring/ordering, depending on the child class used.
bool partitioning_already_computed () const __deprecated
 Query whether a partitioning as already been successfully computed.
__deprecated int newPartNumber (int myElem) const
 Return the new part ID for a given element that resided locally in the old partitioning.
int numElemsInPart (int part) const
 Return the number of LOCAL elements in a given part.
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.
Teuchos::RCP< Epetra_Map > createNewMap ()
 Create a new Epetra_Map corresponding to the new partition.
virtual void setParameters (const Teuchos::ParameterList &paramlist)=0
 Set parameters for the Operator instance.
void setParameters (const Teuchos::ParameterList &paramlist)
 setParameters() is an internal Partitioner method which handles the parameters from a Teuchos::ParameterList object.
bool alreadyComputed () const
 Query whether compute_partitioning() has already been called.
int numProperties () const
 Return the number of different values used for "properties".
virtual const int & operator[] (int myElem) const
 Return the new partition ID for a given element that resided locally in the old partitioning.
virtual int numElemsWithProperty (int property) const
 Return the number of elements in a given partition.
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.
virtual bool alreadyComputed () const =0
 Query whether the computation has already been called.
virtual int numProperties () const =0
 Return the number of different values used for "properties".
virtual const int & operator[] (int myElem) const =0
 Return the "property" for a given element that resided locally.
virtual int numElemsWithProperty (int property) const =0
 Return the number of LOCAL elements with the given property.
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.
virtual bool alreadyComputed () const =0
 Query whether the computation has already been called.
virtual int numProperties () const =0
 Return the number of different values used for "properties".
virtual const int & operator[] (int myElem) const =0
 Return the "property" for a given element that resided locally.
virtual int numElemsWithProperty (int property) const =0
 Return the number of LOCAL elements with the given property.
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.
virtual bool alreadyComputed () const =0
 Query whether the computation has already been called.
virtual int numProperties () const =0
 Return the number of different values used for "properties".
virtual const int & operator[] (int myElem) const =0
 Return the "property" for a given element that resided locally.
virtual int numElemsWithProperty (int property) const =0
 Return the number of LOCAL elements with the given property.
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.
virtual bool alreadyComputed () const =0
 Query whether the computation has already been called.
virtual int numProperties () const =0
 Return the number of different values used for "properties".
virtual const int & operator[] (int myElem) const =0
 Return the "property" for a given element that resided locally.
virtual int numElemsWithProperty (int property) const =0
 Return the number of LOCAL elements with the given property.
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.
virtual bool alreadyComputed () const =0
 Query whether the computation has already been called.
virtual int numProperties () const =0
 Return the number of different values used for "properties".
virtual const int & operator[] (int myElem) const =0
 Return the "property" for a given element that resided locally.
virtual int numElemsWithProperty (int property) const =0
 Return the number of LOCAL elements with the given property.
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.
virtual bool alreadyComputed () const =0
 Query whether the computation has already been called.
virtual int numProperties () const =0
 Return the number of different values used for "properties".
virtual const int & operator[] (int myElem) const =0
 Return the "property" for a given element that resided locally.
virtual int numElemsWithProperty (int property) const =0
 Return the number of LOCAL elements with the given property.
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.
virtual __deprecated void compute_partitioning (bool forceRepartitioning=false)
 The deprecated way to compute partitioning.
virtual __deprecated int newPartitionNumber (int myElem)
 Return the new partition ID for a given element that resided locally in the old partitioning.
virtual __deprecated int numElemsInPartition (int partition)
 Return the number of LOCAL elements in a given partition.
virtual __deprecated void elemsInPartition (int part, int *elementList, int len)
 Fill user-allocated list (of length len) with the local element ids to be located in the given partition.
virtual bool alreadyComputed () const =0
 Query whether the computation has already been called.
virtual int numProperties () const =0
 Return the number of different values used for "properties".
virtual const int & operator[] (int myElem) const =0
 Return the "property" for a given element that resided locally.
virtual int numElemsWithProperty (int property) const =0
 Return the number of LOCAL elements with the given property.
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.

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< Isorropia::Epetra::CostDescribercosts_
Teuchos::RCP< Epetra_Vector > 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_

Detailed Description

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


Constructor & Destructor Documentation

Isorropia::Epetra::Partitioner::Partitioner ( Teuchos::RCP< const Epetra_CrsGraph >  input_graph,
const Teuchos::ParameterList &  paramlist,
bool  compute_partitioning_now = true 
)

Constructor that accepts an Epetra_CrsGraph object, called by API function create_partitioner().

Parameters:
input_graph Matrix-graph object for which a new partitioning is to be computed. A Teuchos::RCP 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::Partitioner::Partitioner ( Teuchos::RCP< const Epetra_CrsGraph >  input_graph,
Teuchos::RCP< CostDescriber costs,
const Teuchos::ParameterList &  paramlist,
bool  compute_partitioning_now = true 
)

Constructor that accepts an Epetra_CrsGraph object and a CostDescriber, called by API function create_partitioner().

Parameters:
input_graph Matrix-graph object for which a new partitioning is to be computed. A Teuchos::RCP is used here because a reference to the input object may be held by this object after this constructor completes and returns.
costs CostDescriber object which allows for user-specified weights of varying types to be provided to the partitioner.
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::Partitioner::Partitioner ( Teuchos::RCP< const Epetra_RowMatrix >  input_matrix,
const Teuchos::ParameterList &  paramlist,
bool  compute_partitioning_now = true 
)

Constructor that accepts an Epetra_RowMatrix object, called by API function create_partitioner().

Parameters:
input_matrix Matrix object for which a new partitioning is to be computed. A Teuchos::RCP 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::Partitioner::Partitioner ( Teuchos::RCP< const Epetra_RowMatrix >  input_matrix,
Teuchos::RCP< CostDescriber costs,
const Teuchos::ParameterList &  paramlist,
bool  compute_partitioning_now = true 
)

Constructor that accepts an Epetra_RowMatrix object and a CostDescriber, called by API function create_partitioner().

Parameters:
input_matrix Matrix object for which a new partitioning is to be computed. A Teuchos::RCP is used here because a reference to the input object may be held by this object after this constructor completes and returns.
costs CostDescriber object which allows for user-specified weights of varying types to be provided to the partitioner.
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 Isorropia::Epetra::Partitioner::~Partitioner (  )  [virtual]

Destructor.

Reimplemented from Isorropia::Partitioner.


Member Function Documentation

void Isorropia::Epetra::Partitioner::partition ( bool  force_repartitioning = false  )  [virtual]

partition is an internal method that computes a rebalanced partitioning for the data in the object that this class was constructed with.

Parameters:
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::Partitioner.

virtual void Isorropia::Epetra::Partitioner::compute ( bool  forceRecomputing = false  )  [virtual]

Method which does the work of computing a new partitioning/coloring/ordering, depending on the child class used.

Parameters:
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.

bool Isorropia::Epetra::Partitioner::partitioning_already_computed (  )  const [virtual]

Query whether a partitioning as already been successfully computed.

Deprecated:
This method uses the old name and will be removed in next version, use Isorropia::Operator::alreadyComputed()
See also:
Isorropia::Operator::alreadyComputed()

Implements Isorropia::Partitioner.

__deprecated int Isorropia::Epetra::Partitioner::newPartNumber ( int  myElem  )  const [inline, virtual]

Return the new part ID for a given element that resided locally in the old partitioning.

Deprecated:
A better way to have the same results is to use Isorropia::Operator::operator[]
Parameters:
[in] myElem local ID of element we want to know in which part it belongs to.
Returns:
new part number
See also:
Isorropia::Operator::operator[]

Implements Isorropia::Partitioner.

int Isorropia::Epetra::Partitioner::numElemsInPart ( int  part  )  const [inline, virtual]

Return the number of LOCAL elements in a given part.

Parameters:
[in] part the part ID we want to know the number of local elements.
Returns:
number of local elements that belongs to the given part.
See also:
Isorropia::Operator::numElemsWithProperty()

Implements Isorropia::Partitioner.

void Isorropia::Epetra::Partitioner::elemsInPart ( int  part,
int *  elementList,
int  len 
) const [inline, virtual]

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

Parameters:
[in] part the part ID we consider
[out] elementList array of elements that belongs to this part ID, must be allocated by user with size at least len
[in] len maximum number of elements we can put in the array. Usually, may be the result of Isorropia::Partitioner::numElemsInPart(). .
See also:
Isorropia::Operator::elemsWithProperty()

Implements Isorropia::Partitioner.

Teuchos::RCP<Epetra_Map> Isorropia::Epetra::Partitioner::createNewMap (  ) 

Create a new Epetra_Map corresponding to the new partition.

This method is essentially used by the Isorropia::Epetra::Redistributor object.

Returns:
Epetra_Map that contains the new distribution of elements.
Precondition:
The number of parts might be the same or lower than the number of processors.

virtual __deprecated void Isorropia::Partitioner::compute_partitioning ( bool  forceRepartitioning = false  )  [inline, virtual, inherited]

The deprecated way to compute partitioning.

Parameters:
[in] forceRepartitioning Optional parameter to recompute the partitioning even one has been already computed.
Deprecated:
This method uses the old name and will be removed in next version, use Isorropia::Partitioner::partition() (or possibly Isorropia::Operator::compute() )
See also:
Isorropia::Partitioner::partition()

Isorropia::Operator::compute()

virtual __deprecated int Isorropia::Partitioner::newPartitionNumber ( int  myElem  )  [inline, virtual, inherited]

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

Deprecated:
This method uses the old name and will be removed in next version, use Isorropia::Partitioner::newPartNumber(), or even better Isorropia::Operator::operator[]()
See also:
Isorropia::Partitioner::newPartNumber()

Isorropia::Operator::operator[]()

virtual __deprecated int Isorropia::Partitioner::numElemsInPartition ( int  partition  )  [inline, virtual, inherited]

Return the number of LOCAL elements in a given partition.

Deprecated:
This method uses the old name and will be removed in next version, use Isorropia::Partitioner::numElemsInPart()
See also:
Isorropia::Partitioner::numElemsInPart()

virtual __deprecated void Isorropia::Partitioner::elemsInPartition ( int  part,
int *  elementList,
int  len 
) [inline, virtual, inherited]

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

Deprecated:
This method uses the old name and will be removed in next version, use Isorropia::Partitioner::elemsInPart()
See also:
Isorropia::Partitioner::elemsInPart()

virtual void Isorropia::Operator::setParameters ( const Teuchos::ParameterList &  paramlist  )  [pure virtual, inherited]

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] paramlist List of parameters that the user wants to use.

Implemented in Isorropia::Epetra::Operator.

virtual bool Isorropia::Operator::alreadyComputed (  )  const [pure virtual, inherited]

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 virtual, inherited]

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 const int& Isorropia::Operator::operator[] ( int  myElem  )  const [pure virtual, inherited]

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

Parameters:
[in] myElem the 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 virtual, inherited]

Return the number of LOCAL elements with the given property.

Parameters:
[in] property Value 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 virtual, inherited]

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

Parameters:
[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.
Remarks:
Memory space which is not useful in the array is not initialized or used in this method.

Implemented in Isorropia::Epetra::Operator.

void Isorropia::Epetra::Operator::setParameters ( const Teuchos::ParameterList &  paramlist  )  [virtual, inherited]

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

The input ParameterList object is copied into an internal ParameterList attribute, and no reference to the input object is held after this function returns. (Thus, the input paramlist object may be altered or destroyed as soon as this method returns.)
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.

Implements Isorropia::Operator.

bool Isorropia::Epetra::Operator::alreadyComputed (  )  const [inline, virtual, inherited]

Query whether compute_partitioning() has already been called.

Implements Isorropia::Operator.

int Isorropia::Epetra::Operator::numProperties (  )  const [inline, virtual, inherited]

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.

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

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

Implements Isorropia::Operator.

virtual int Isorropia::Epetra::Operator::numElemsWithProperty ( int  property  )  const [virtual, inherited]

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 [virtual, inherited]

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

Implements Isorropia::Operator.

void Isorropia::Epetra::Operator::computeNumberOfProperties (  )  [protected, inherited]


Member Data Documentation

Teuchos::RCP<const Epetra_BlockMap> Isorropia::Epetra::Operator::input_map_ [protected, inherited]

Teuchos::RCP<const Epetra_CrsGraph> Isorropia::Epetra::Operator::input_graph_ [protected, inherited]

Teuchos::RCP<const Epetra_RowMatrix> Isorropia::Epetra::Operator::input_matrix_ [protected, inherited]

Teuchos::RCP<Isorropia::Epetra::CostDescriber> Isorropia::Epetra::Operator::costs_ [protected, inherited]

Teuchos::RCP<Epetra_Vector> Isorropia::Epetra::Operator::weights_ [protected, inherited]

Teuchos::ParameterList Isorropia::Epetra::Operator::paramlist_ [protected, inherited]

int Isorropia::Epetra::Operator::exportsSize_ [protected, inherited]

std::vector<int> Isorropia::Epetra::Operator::imports_ [protected, inherited]

std::vector<int> Isorropia::Epetra::Operator::properties_ [protected, inherited]

bool Isorropia::Epetra::Operator::operation_already_computed_ [protected, inherited]

int Isorropia::Epetra::Operator::global_num_vertex_weights_ [protected, inherited]

int Isorropia::Epetra::Operator::global_num_graph_edge_weights_ [protected, inherited]

int Isorropia::Epetra::Operator::global_num_hg_edge_weights_ [protected, inherited]

Teuchos::RCP<Library> Isorropia::Epetra::Operator::lib_ [protected, inherited]


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