/** \defgroup partitioning_rcp_grp Isorropia Partitioning and Load Balancing Methods with RCPs
\brief Here we describe the partitioning interface that uses RCPs
\section partitionRCPIntro Partitioning and Load-balancing with RCPs
The safer interface to the partitioning in Isorropia is to use the Teuchos reference
counter pointer (RCP) and pass 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.
The following example demonstrates how to partition a matrix with hypergraph partitioning
using the RCP interface.
-
\verbatim
// loadMatrix() allocates and reads in an Epetra_RowMatrix from a file
Teuchos::RCP rowmatrix = loadMatrix(filename);
Teuchos::ParameterList params;
params.set("PARTITIONING_METHOD", "HYPERGRAPH");
params.set("BALANCE OBJECTIVE","NONZEROS");
params.set("IMBALANCE TOL","1.03");
Isorropia::Epetra::Partitioner partitioner(rowmatrix,params,false);
partitioner.partition();
\endverbatim
After partitioning the matrix, the Isorropia::Epetra::Redistributor may be
used to return a new matrix that contains the data of the original matrix/graph/etc.
but redistributed based on a partition. The safer RCP interface to the
redistributor accepts an RCP to an Isorropia::Epetra::Partitioner object
and returns an RCP to a new matrix/graph/etc. Below we demonstrate how the
redistributor works with the RCP interface.
-
\verbatim
// loadMatrix() allocates and reads in an Epetra_RowMatrix from a file
Teuchos::RCP rowmatrix = loadMatrix(filename);
Teuchos::ParameterList params;
params.set("IMBALANCE TOL","1.03");
params.set("BALANCE OBJECTIVE","NONZEROS");
params.set("PARTITIONING_METHOD", "HYPERGRAPH");
Teuchos::RCP partitioner =
Teuchos::rcp(new Isorropia::Epetra::Partitioner(rowmatrix, params,false));
partitioner->partition();
Isorropia::Epetra::Redistributor rd(partitioner);
Teuchos::RCP newmatrix = rd.redistribute(*rowmatrix,true);
\endverbatim
Additional information and functionality for partitioning, in general, is documented here:
\ingroup partitioning_grp
*/