/** \defgroup partitioning_grp Isorropia Partitioning and Load Balancing Methods
\brief Here we describe the partitioning interface provided by Isorropia.
\section partitionIntro Partitioning and Load-balancing
Isorropia's load balancing user interface consists primarily of the Isorropia::Partitioner, Isorropia::Redistributor and Isorropia::CostDescriber classes, as well as the Isorropia::Epetra::createBalancedCopy functions.
The Isorropia::Epetra::createBalancedCopy functions are free-standing functions
(not class members) which simply take an input object (Epetra_CrsGraph,
Epetra_CrsMatrix, etc.) and return a copy which is balanced across
processes (parts).
In many use cases, such as performing one partitioning
and then using it to redistribute multiple objects, it is more
efficient to use the Isorropia::Partitioner and Isorropia::Redistributor
classes. The general usage model is to:
- Create a Isorropia::Partitioner instance, providing the objects to be partitioned, and
optionally weights for those objects. Weights can be defined with an
Isorropia::CostDescriber for graphs and hypergraphs, or with an Epetra_MultiVector for
geometric coordinates.
- Create a Isorropia::Redistributor object (providing as input a
Isorropia::Partitioner instance)
- Use the Isorropia::Redistributor to redistribute one or more objects
to the new partitioning.
Isorropia was designed such that these steps can usually be done in three lines of code.
For example, the Partitioner will by default compute the partitioning at construction time.
Isorropia currently supports partitioning/redistributing of several
Epetra objects, including Epetra_CrsGraph and Epetra_RowMatrix (which includes
Epetra_CrsMatrix and Epetra_VbrMatrix).
In addition to matrix/graph partitioning, Isorropia has the capability to partition
1, 2 or 3-dimensional real coordinates into balanced spatial regions. The coordinates are represented as an Epetra_MultiVector.
\section partitionParameters Load-balancing parameters
Isorropia has a fairly small number of parameters that control the partitioning methods. (Default values in all caps.)
Note that Isorropia parameters are case insensitive.
- STRUCTURALLY SYMMETRIC [NO/yes] (is symmetrization required?)
- PARTITIONING METHOD [block/cyclic/random/rcb/rib/hsfc/graph/HYPERGRAPH]
- NUM PARTS [int k] (global number of parts)
- IMBALANCE TOL [float tol] (1.0 is perfect balance)
- BALANCE OBJECTIVE [ROWS/nonzeros]
- DISTANCE [1/2] (for coloring only; two is default)
These parameters are placed in a Teuchos::ParameterList object, which is passed as an argument to Isorropia.
Here is an example of how the partitioning method would be set using the parameter list.
-
\verbatim
Teuchos::ParameterList params;
params.set("partitioning method", "graph"); // Corresponds to LB_METHOD in Zoltan
\endverbatim
For more specific control of low-level features, you may set a Zoltan parameter.
Isorropia can relay Zoltan parameters directly to Zoltan. Before passing
a Teuchos::ParameterList to Isorropia, create a sublist in it named "Zoltan".
Then, any parameters that should be passed to Zoltan itself, can be stored
in the sublist exactly as they appear in the Zoltan users guide. Example:
-
\verbatim
Teuchos::ParameterList params;
Teuchos::ParameterList& sublist = params.sublist("Zoltan");
sublist.set("phg_output_level", "5");
\endverbatim
Refer to the Zoltan User's guide (available at
the Zoltan web site)
for available Zoltan parameters.
In many cases, no parameters are necessary.
Note that Isorropia will override a few default Zoltan settings:
For graphs and matrices, the default method (LB_METHOD) is HYPERGRAPH. The default approach (LB_APPROACH) is PARTITION. For coordinates the default LB_METHOD is RCB (recursive coordinate bisection).
\section partitionInterfaces Partitioning with RCPs and pointers
With Isorropia, we provide two interfaces to the partitioning objects, a
reference counting pointer (RCP) based interface and a pointer based interface.
The safer interface to the partitioning is the RCP based interface, which a RCP to the Epetra object
to the Isorropia partitioner. We suggest using interface in order to prevent memory leaks
if you are familiar with RCPs and willing to learn the basics of Teuchos::RCP.
However, we also provide a pointer interface for the convenience of those that are more familiar
with this type of interface.
More information on these interfaces, as well as functions specific to the interface can be found
here:
- \ref partitioning_rcp_grp
- \ref partitioning_ptr_grp
\section isorropia_example Example Programs
A number of example programs which demonstrate using Isorropia are
provided in the 'packages/isorropia/example' subdirectory.
matrix_1 demonstrates creating a balanced copy of Epetra_CrsGraph and
Epetra_CrsMatrix objects using Isorropia::Epetra::createBalancedCopy
functions.
part_redist demonstrates repartitioning and redistributing the
contents of an Epetra_LinearProblem object, using the Isorropia::Partitioner
and Isorropia::Redistributor classes. This program does not use
user-specified weights/costs.
Other programs in the example subdirectory demonstrate the use of
weights/costs data to influence the partitioner.
See vert_weights, graphedge_weights
and hgedge_weights.
example_rcb demonstrates the use of Isorropia to partition spatial coordinates using Zoltan's Recursive Coordinate Bisection algorithm.
*/