# Presentation: 363194

## Introduction to Isorropia

**Alan Williams & Erik Boman**
- (with contributions from Mike Heroux, Rob Hoekstra)
**Trilinos User Group Meeting**
**Nov. 7, 2006**
- R&A: SAND2006-6719P** **

## Isorropia Basics

- New in Trilinos 7.0
- Trilinos interface to Zoltan load balancing (repartitioning) services.
- Enables easy repartitioning of Epetra matrices and vectors.
- Main goal: Partition/repartition a sparse matrix among processors such that
- number of nonzeros are approximately equally distributed
- communication volume is reduced
- Currently, only row distributions are supported
- Algorithms used: Graph and hypergraph partitioning (via Zoltan)

## Configuring Isorropia 

- Enable Isorropia with configure argument ‘—enable-isorropia’
- It is *strongly* recommended to configure Isorropia with Zoltan
- Zoltan is not a Trilinos package and must be obtained and built separately.
- Add Zoltan Version 2 support: configure arguments:
- --enable-isorropia-zoltan, --enable-epetraext
- --with-incdirs=“-I/path/zoltan-2/ParMETIS3_1 –I/path/zoltan-2/Zoltan/include”
-  --with-libs=“-L/path/zoltan-2/Zoltan/Obj_gcc –lzoltan 		–L/path/zoltan-2/ParMETIS3_1/gcc32_mpi –lparmetis –lmetis”

## Isorropia API

- Three primary user-interface classes:
- Partitioner:
- Constructed with input describing the ‘old’ partitioning, calls Zoltan to compute ‘new’ partitioning.
- Redistributor:
- Constructed with Partitioner instance. Can then be used to redistribute objects (matrices, vectors, matrix-graphs) from the old partitioning to the new partitioning.
- CostDescriber:
- Interface which allows users to specify weights or costs associated with the vertices or edges of the object to be repartitioned.
- Allows user-specified vertex weights, graph edge weights,and hypergraph edge weights.

## Simple Example – no weights, no params...

- Teuchos::RefCountPtr<const Epetra_CrsMatrix> matrix = ...
- Teuchos::RefCountPtr<const Epetra_Vector> vec = ...
- Teuchos::ParameterList paramlist; //parameter-setting illustrated on next page...
- Teuchos::RefCountPtr<Isorropia::Partitioner> partitioner =
- 	Isorropia::Epetra::create_partitioner(matrix, paramlist);
- Isorropia::Redistributor rd(partitioner);
- //exception try-catch block omitted for clarity...
- Teuchos::RefCountPtr<Epetra_CrsMatrix> balanced_matrix = rd.redistribute(*matrix);
- Teuchos::RefCountPtr<Epetra_Vector> balanced_vec = rd.redistribute(*vec);

- Several complete example programs are available at Isorropia’sdocumentation web page, demonstrating the use of vertex weights,graph edge weights, and hypergraph edge weights.

## Setting Zoltan parameters

- Teuchos::ParameterList paramlist;
- Teuchos::ParameterList& sublist = paramlist.sublist(“Zoltan”);
- sublist.set("LB_METHOD", "GRAPH");
- sublist.set("PARMETIS_METHOD", "PARTKWAY");

- Everything in a “Zoltan” sublist is passed straight through to Zoltan.Zoltan accepts all parameters in the form of key-value string pairs.
- Isorropia does not check parameters for spelling or correctness.
- If Zoltan parameters are not specified, Isorropia chooses to useHypergraph partitioning by default. (See Isorropia’s web documentation.)

## Isorropia Documentation, Help

- Isorropia’s website is here:
- _[http://software.sandia.gov/Trilinos/packages/isorropia/](http://software.sandia.gov/Trilinos/packages/isorropia/)_
- From there, you can get to doxygen-generated API documentationas well as several example programs.
- Questions or problems can be emailed to the Isorropia developers using this address:
- _[isorropia-developers@software.sandia.gov](mailto:isorropia-developers@software.sandia.gov)_