Skip to content

Improving an Existing Partition

diamog edited this page Jan 14, 2018 · 13 revisions

Contents

Necessary Includes

Getting Started

Load Balancing

Necessary Includes

Getting Started

To use EnGPar's different algorithms, first the application must construct an N-graph from the user's data. To do this see Constructing the N-graph.

Load Balancing

The general way to run EnGPar's load balancing procedures is in the following form:

  // C++
  agi::Balancer* balancer = engpar::callToBalancer(...)
  balancer->balance(tolerance)

If the goal is to balance out the vertices of the graph one can use the following function to construct a balancer that does so:

  agi::Balancer* engpar::makeVtxBalancer(agi::Ngraph* g,
                                         double stepFactor=0.1,
                                         int verbosity=0);

The first argument, g, is the graph. The second, stepFactor, controls how much weight can be sent in a single iteration, and the final, verbosity, is the level of output provided by EnGPar; the higher the value the more output. Note that higher levels of verbosity can increase computation and communication costs.

To have more control over how EnGPar balances the graph a general balancer can be constructed with the following calls:

 engpar::Input* input = new engpar::Input(g);
 ai::Balancer balancer = makeBalancer(input,verbosity);

Various control mechanisms can be set in the input object in order to control many aspects of how EnGPar works. See the header partition/engpar_input.h for more information.

When using the FORTRAN interface, graph vertices can be balanced with the following call:

  // FORTRAN
  call cengpar_balanceVertices(graph, tol, stepfactor, verbosity);

Once the N-graph is balanced, the user data can be repartitioned using a partition map provided by the N-graph. To do this see Retrieving the Partition.

Clone this wiki locally