Isorropia: Partitioning, Load Balancing and more
Isorropia::Epetra::Colorer Class Reference

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

#include <Isorropia_EpetraColorer.hpp>

Inheritance diagram for Isorropia::Epetra::Colorer:
Collaboration diagram for Isorropia::Epetra::Colorer:

Public Member Functions

 Colorer (Teuchos::RCP< const Epetra_CrsGraph > input_graph, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_now=true)
 Constructor.
 Colorer (const Epetra_CrsGraph *input_graph, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_now=true)
 Constructor.
 Colorer (Teuchos::RCP< const Epetra_RowMatrix > input_matrix, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_now=true)
 Constructor.
 Colorer (const Epetra_RowMatrix *input_matrix, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_now=true)
 Constructor.
 ~Colorer ()
 Destructor.
void color (bool force_coloring=false)
 Compute the coloring if it has not already been computed, same effect as Isorropia::Epetra::Colorer::compute.
void compute (bool force_compute=false)
 Compute the coloring if it has not already been computed, same effect as Isorropia::Epetra::Colorer::color.
__deprecated Teuchos::RCP< Epetra_MapColoring > generateMapColoring ()
 Generate an Epetra_MapColoring object.
Teuchos::RCP< Epetra_MapColoring > generateRowMapColoring ()
 Generate an Epetra_MapColoring object corresponding of rows color.
Teuchos::RCP< Epetra_MapColoring > generateColMapColoring ()
 Generate an Epetra_MapColoring object corresponding of columns color.
virtual int numColors () const
 Method which returns the number (global) of colors used.
virtual int numElemsWithColor (int theColor) const
 Return the number of local elements of a given color.
virtual void elemsWithColor (int theColor, int *elementList, int len) const
 Fill user-allocated list (of length len) with the local element ids for LOCAL elements of the given color.
virtual int extractColorsView (int &size, const int *&array) const
 Give access of the color assignments array that is owned by the current processor.
virtual int extractColorsCopy (int len, int &size, int *array) const
 Copy a part of the color assignments array.
void setParameters (const Teuchos::ParameterList &paramlist)
 setParameters() is an internal method which handles the parameters from a Teuchos::ParameterList object.
Teuchos::RCP< Isorropia::Epetra::CostDescriber > & getCosts ()
 Get the cost object.
bool alreadyComputed () const
 Query whether compute_operation() has already been called.
int numProperties () const
 Return the number of different values used for "properties".
int numLocalProperties () const
 Return the number of different values used for "properties" for this process only.
virtual const int & operator[] (int myElem) const
 Return the new partition ID for a given element that resided locally in the old operation.
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 int extractPropertiesCopy (int len, int &size, int *array) const
 Copy a part of the property array.
virtual int extractPropertiesView (int &size, const int *&array) const
 Give access of the property array that is owned by the current processor.

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::CostDescribercosts_
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 Member Functions

void paramsToUpper (Teuchos::ParameterList &, int &changed, bool rmUnderscore=true)
void stringToUpper (std::string &s, int &changed, bool rmUnderscore=false)

Private Attributes

Teuchos::RCP< const Epetra_BlockMap > colmap_
int numberOfProperties_
int localNumberOfProperties_
std::vector< int > numberElemsByProperties_

Detailed Description

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

Constructor & Destructor Documentation

◆ ~Colorer()

Isorropia::Epetra::Colorer::~Colorer ( )
inlinevirtual

Destructor.

Reimplemented from Isorropia::Colorer.

Member Function Documentation

◆ generateMapColoring()

__deprecated Teuchos::RCP< Epetra_MapColoring > Isorropia::Epetra::Colorer::generateMapColoring ( )
inline

Generate an Epetra_MapColoring object.

Provide access on the coloring thru the EpetraEXT color class Epetra_MapColoring. This methods requires EpetraEXT support.

Deprecated
It's recommended to use
See also
generateRowMapColoring() to this.

◆ numColors()

virtual int Isorropia::Colorer::numColors ( ) const
inlinevirtualinherited

Method which returns the number (global) of colors used.

Returns
The overall number of colors used. All colors used for all vertices are between 1 and this value (included).
See also
Isorropia::Operator::numProperties()

◆ numElemsWithColor()

virtual int Isorropia::Colorer::numElemsWithColor ( int theColor) const
inlinevirtualinherited

Return the number of local elements of a given color.

Parameters
theColorThe wanted color.
Returns
The number of local of the asked color.
See also
Isorropia::Operator::numElemsWithProperty()

◆ elemsWithColor()

virtual void Isorropia::Colorer::elemsWithColor ( int theColor,
int * elementList,
int len ) const
inlinevirtualinherited

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

Parameters
theColorthe wanted color
elementListan array to receive local elements of the given color
lenthe number of elements wanted
See also
Isorropia::Operator::elemsWithProperty()

◆ extractColorsView()

virtual int Isorropia::Colorer::extractColorsView ( int & size,
const int *& array ) const
inlinevirtualinherited

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

Parameters
size[out] Number of elements in the array.
array[out] Pointer to the color 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()

◆ extractColorsCopy()

virtual int Isorropia::Colorer::extractColorsCopy ( int len,
int & size,
int * array ) const
inlinevirtualinherited

Copy a part of the color assignments array.

Parameters
len[in] of the array given by the user.
size[out] Number of elements in the array.
array[out] Array of color 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()

◆ setParameters()

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.

◆ getCosts()

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

Get the cost object.

◆ alreadyComputed()

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

Query whether compute_operation() has already been called.

Implements Isorropia::Operator.

◆ numProperties()

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.

◆ numLocalProperties()

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.

◆ 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.

◆ numElemsWithProperty()

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

Return the number of elements in a given partition.

Implements Isorropia::Operator.

◆ elemsWithProperty()

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.

◆ extractPropertiesCopy()

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

Copy a part of the property array.

Parameters
len[in] of the array given by the user.
size[out] Number of elements in the array.
array[out] Array 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.

◆ extractPropertiesView()

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
size[out] Number of elements in the array.
array[out] Pointer 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.

◆ paramsToUpper()

void Isorropia::Epetra::Operator::paramsToUpper ( Teuchos::ParameterList & ,
int & changed,
bool rmUnderscore = true )
privateinherited

◆ stringToUpper()

void Isorropia::Epetra::Operator::stringToUpper ( std::string & s,
int & changed,
bool rmUnderscore = false )
privateinherited

◆ computeNumberOfProperties()

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

Member Data Documentation

◆ colmap_

Teuchos::RCP<const Epetra_BlockMap> Isorropia::Epetra::Colorer::colmap_
private

◆ numberOfProperties_

int Isorropia::Epetra::Operator::numberOfProperties_
privateinherited

◆ localNumberOfProperties_

int Isorropia::Epetra::Operator::localNumberOfProperties_
privateinherited

◆ numberElemsByProperties_

std::vector<int> Isorropia::Epetra::Operator::numberElemsByProperties_
privateinherited

◆ input_map_

Teuchos::RCP<const Epetra_BlockMap> Isorropia::Epetra::Operator::input_map_
protectedinherited

◆ input_graph_

Teuchos::RCP<const Epetra_CrsGraph> Isorropia::Epetra::Operator::input_graph_
protectedinherited

◆ input_matrix_

Teuchos::RCP<const Epetra_RowMatrix> Isorropia::Epetra::Operator::input_matrix_
protectedinherited

◆ input_coords_

Teuchos::RCP<const Epetra_MultiVector> Isorropia::Epetra::Operator::input_coords_
protectedinherited

◆ costs_

Teuchos::RCP<Isorropia::Epetra::CostDescriber> Isorropia::Epetra::Operator::costs_
protectedinherited

◆ weights_

Teuchos::RCP<const Epetra_MultiVector> Isorropia::Epetra::Operator::weights_
protectedinherited

◆ paramlist_

Teuchos::ParameterList Isorropia::Epetra::Operator::paramlist_
protectedinherited

◆ exportsSize_

int Isorropia::Epetra::Operator::exportsSize_
protectedinherited

◆ imports_

std::vector<int> Isorropia::Epetra::Operator::imports_
protectedinherited

◆ properties_

std::vector<int> Isorropia::Epetra::Operator::properties_
protectedinherited

◆ operation_already_computed_

bool Isorropia::Epetra::Operator::operation_already_computed_
protectedinherited

◆ global_num_vertex_weights_

int Isorropia::Epetra::Operator::global_num_vertex_weights_
protectedinherited

◆ global_num_graph_edge_weights_

int Isorropia::Epetra::Operator::global_num_graph_edge_weights_
protectedinherited

◆ global_num_hg_edge_weights_

int Isorropia::Epetra::Operator::global_num_hg_edge_weights_
protectedinherited

◆ lib_

Teuchos::RCP<Library> Isorropia::Epetra::Operator::lib_
protectedinherited

◆ base_

int Isorropia::Epetra::Operator::base_
protectedinherited

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