Isorropia: Partitioning, Load Balancing and more
Public Member Functions | List of all members
Isorropia::LevelScheduler Class Referenceabstract

Interface (abstract base class) for an operator that computes a partitioning of local elements into levels. More...

#include <Isorropia_LevelScheduler.hpp>

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

Public Member Functions

virtual ~LevelScheduler ()
 Destructor. More...
 
virtual void schedule (bool forceScheduling=false)=0
 Method which does the work of computing a new level schedule. More...
 
virtual int numLevels () const
 Method which returns the number of levels. More...
 
virtual int numElemsWithLevel (int level) const
 Return the number of elements in a given level. More...
 
virtual void elemsWithLevel (int level, int *elementList, int len) const
 Fill user-allocated list (of length len) with the local ID for each element in the given level. More...
 
virtual void setParameters (const Teuchos::ParameterList &paramlist)=0
 Set parameters for the Operator instance. More...
 
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. 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...
 

Detailed Description

Interface (abstract base class) for an operator that computes a partitioning of local elements into levels.

On each process the levels begin at 1 and increase by 1. All elements in the same level can be used in calculation concurrently. All elements in level i are dependent upon the completion of the calculations involving the elements in level i-1.

Constructor & Destructor Documentation

virtual Isorropia::LevelScheduler::~LevelScheduler ( )
inlinevirtual

Destructor.

Reimplemented in Isorropia::Epetra::LevelScheduler.

Member Function Documentation

virtual void Isorropia::LevelScheduler::schedule ( bool  forceScheduling = false)
pure virtual

Method which does the work of computing a new level schedule.

Parameters
forceSchedulingOptional argument defaults to false. Depending on the implementation, schedule() should only perform a scheduling the first time it is called, and subsequent repeated calls are no-ops. If the user's intent is to re-compute the scheduling (e.g., if parameters or other inputs have been changed), then setting this flag to true will force a new scheduling to be computed.

Implemented in Isorropia::Epetra::LevelScheduler.

virtual int Isorropia::LevelScheduler::numLevels ( ) const
inlinevirtual

Method which returns the number of levels.

Returns
The number of levels on the local process. Levels begin at 1 and increase by 1.
See Also
Isorropia::Operator::numProperties()
virtual int Isorropia::LevelScheduler::numElemsWithLevel ( int  level) const
inlinevirtual

Return the number of elements in a given level.

Parameters
levelThe wanted level.
Returns
The number of elements in the level.
See Also
Isorropia::Operator::numElemsWithProperty()
virtual void Isorropia::LevelScheduler::elemsWithLevel ( int  level,
int *  elementList,
int  len 
) const
inlinevirtual

Fill user-allocated list (of length len) with the local ID for each element in the given level.

Parameters
levelthe wanted level
elementListan array to receive local elements of the given level
lenthe number of elements wanted
See Also
Isorropia::Operator::elemsWithProperty()
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 void Isorropia::Operator::compute ( bool  forceRecomputing = false)
pure virtualinherited

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

Parameters
forceRecomputingOptional 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::Operator, Isorropia::Epetra::Partitioner, Isorropia::Epetra::Colorer, Isorropia::Epetra::Partitioner2D, Isorropia::Epetra::Orderer, and Isorropia::Epetra::LevelScheduler.

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.


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