Isorropia::Partitioner2D Class Reference

Interface (abstract base class) for computing a new 2D partitioning and describing the layout of elements in the new partitions. More...

#include <Isorropia_Partitioner2D.hpp>

Inheritance diagram for Isorropia::Partitioner2D:

Inheritance graph
[legend]
Collaboration diagram for Isorropia::Partitioner2D:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~Partitioner2D ()
 Destructor.
virtual void partition (bool force_repartitioning=false)=0
 Method which does the work of computing a new partitioning.
virtual bool partitioning_already_computed () const =0
 Query whether compute_partitioning() has already been called.
virtual int newPartitionNumber (int myElem) const =0
 Return the new partition ID for a given element that resided locally in the old partitioning.
virtual int numElemsInPartition (int partition) const =0
 Return the number of elements in a given partition.
virtual void elemsInPartition (int partition, int *elementList, int len) const =0
 Fill user-allocated list (of length len) with the global element ids to be located in the given partition.
virtual int numElemsInPart (int part) const =0
 Return the number of LOCAL elements in a given part.
virtual void elemsInPart (int part, int *elementList, int len) const =0
 Fill user-allocated list (of length len) with the local element ids to be located in the given part.
virtual int extractPartsView (int &size, const int *&array) const
 Give access of the part assignments array that is owned by the current processor.
virtual int extractPartsCopy (int len, int &size, int *array) const
 Copy a part of the part assignment array.
virtual void setParameters (const Teuchos::ParameterList &paramlist)=0
 Set parameters for the Operator instance.
virtual void compute (bool forceRecomputing=false)=0
 Method which does the work of computing a new partitioning/coloring/ordering, depending on the child class used.
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 int numLocalProperties () const =0
 Return the number of different values used for "properties" for this process only.
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 int extractPropertiesView (int &size, const int *&array) const =0
 Give access of the property array that is owned by the current processor.
virtual int extractPropertiesCopy (int len, int &size, int *array) const =0
 Copy a part of the property array.
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 int numLocalProperties () const =0
 Return the number of different values used for "properties" for this process only.
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 int extractPropertiesView (int &size, const int *&array) const =0
 Give access of the property array that is owned by the current processor.
virtual int extractPropertiesCopy (int len, int &size, int *array) const =0
 Copy a part of the property array.
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 int numLocalProperties () const =0
 Return the number of different values used for "properties" for this process only.
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 int extractPropertiesView (int &size, const int *&array) const =0
 Give access of the property array that is owned by the current processor.
virtual int extractPropertiesCopy (int len, int &size, int *array) const =0
 Copy a part of the property array.
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 int numLocalProperties () const =0
 Return the number of different values used for "properties" for this process only.
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 int extractPropertiesView (int &size, const int *&array) const =0
 Give access of the property array that is owned by the current processor.
virtual int extractPropertiesCopy (int len, int &size, int *array) const =0
 Copy a part of the property array.
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 int numLocalProperties () const =0
 Return the number of different values used for "properties" for this process only.
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 int extractPropertiesView (int &size, const int *&array) const =0
 Give access of the property array that is owned by the current processor.
virtual int extractPropertiesCopy (int len, int &size, int *array) const =0
 Copy a part of the property array.
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 int numLocalProperties () const =0
 Return the number of different values used for "properties" for this process only.
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 int extractPropertiesView (int &size, const int *&array) const =0
 Give access of the property array that is owned by the current processor.
virtual int extractPropertiesCopy (int len, int &size, int *array) const =0
 Copy a part of the property array.
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 int numLocalProperties () const =0
 Return the number of different values used for "properties" for this process only.
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 int extractPropertiesView (int &size, const int *&array) const =0
 Give access of the property array that is owned by the current processor.
virtual int extractPropertiesCopy (int len, int &size, int *array) const =0
 Copy a part of the property array.
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 int numLocalProperties () const =0
 Return the number of different values used for "properties" for this process only.
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 int extractPropertiesView (int &size, const int *&array) const =0
 Give access of the property array that is owned by the current processor.
virtual int extractPropertiesCopy (int len, int &size, int *array) const =0
 Copy a part of the property array.
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 int numLocalProperties () const =0
 Return the number of different values used for "properties" for this process only.
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 int extractPropertiesView (int &size, const int *&array) const =0
 Give access of the property array that is owned by the current processor.
virtual int extractPropertiesCopy (int len, int &size, int *array) const =0
 Copy a part of the property array.
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 int numLocalProperties () const =0
 Return the number of different values used for "properties" for this process only.
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 int extractPropertiesView (int &size, const int *&array) const =0
 Give access of the property array that is owned by the current processor.
virtual int extractPropertiesCopy (int len, int &size, int *array) const =0
 Copy a part of the property array.

Detailed Description

Interface (abstract base class) for computing a new 2D partitioning and describing the layout of elements in the new partitions.

If the methods which describe the new partitioning (e.g., newPartitionNumber(), etc.) are called before compute_partitioning() has been called, behavior is not well defined. Implementations will either return empty/erroneous data, or throw an exception. In most cases, implementations will probably call compute_partitioning() internally in a constructor or factory method, so this won't usually be an issue.


Constructor & Destructor Documentation

virtual Isorropia::Partitioner2D::~Partitioner2D (  )  [inline, virtual]

Destructor.


Member Function Documentation

virtual void Isorropia::Partitioner2D::partition ( bool  force_repartitioning = false  )  [pure virtual]

Method which does the work of computing a new partitioning.

Implementations of this interface will typically be constructed with an object or information describing the existing ('old') partitioning. This method computes a 'new' rebalanced partitioning for that input data.

Parameters:
force_repartitioning Optional argument defaults to false. Depending on the implementation, compute_partitioning() should only perform a repartitioning 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 bool Isorropia::Partitioner2D::partitioning_already_computed (  )  const [pure virtual]

Query whether compute_partitioning() has already been called.

virtual int Isorropia::Partitioner2D::newPartitionNumber ( int  myElem  )  const [pure virtual]

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

virtual int Isorropia::Partitioner2D::numElemsInPartition ( int  partition  )  const [pure virtual]

Return the number of elements in a given partition.

virtual void Isorropia::Partitioner2D::elemsInPartition ( int  partition,
int *  elementList,
int  len 
) const [pure virtual]

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

virtual int Isorropia::Partitioner::numElemsInPart ( int  part  )  const [pure virtual, inherited]

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()

Implemented in Isorropia::Epetra::Partitioner.

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

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()

Implemented in Isorropia::Epetra::Partitioner.

virtual int Isorropia::Partitioner::extractPartsView ( int &  size,
const int *&  array 
) const [inline, virtual, inherited]

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

Parameters:
[out] size Number of elements in the array.
[out] array Pointer 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 [inline, virtual, inherited]

Copy a part of the part assignment array.

Parameters:
[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.
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 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 void Isorropia::Operator::compute ( bool  forceRecomputing = false  )  [pure virtual, inherited]

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.

Implemented in Isorropia::Epetra::Colorer, Isorropia::Epetra::LevelScheduler, Isorropia::Epetra::Operator, Isorropia::Epetra::Orderer, and Isorropia::Epetra::Partitioner.

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

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

virtual int Isorropia::Operator::extractPropertiesView ( int &  size,
const int *&  array 
) const [pure virtual, inherited]

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

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

Implemented in Isorropia::Epetra::Operator.

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

Copy a part of the property array.

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


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