User's guide MondriaanOpt

Installing
Output
Options
MATLAB

This page is continuously being improved and updated; therefore, a more recent version may be obtained online. This offline version is bundled with the software for your convenience.


How to install MondriaanOpt

MondriaanOpt comes packaged with the Mondriaan software. Refer to this page for instructions on using Mondriaan. MondriaanOpt is automatically compiled when you compile Mondriaan. The executable is then available at tools/MondriaanOpt.

Whereas Mondriaan uses heuristics to obtain good partitionings for sparse matrix-vector multiplication for any number of processors, MondriaanOpt will calculate an actual optimal solution for this partitioning problem with 2 processors. More precisely, it will calculate a partitioning with minimum volume among all solutions that obey the imbalance constraint.

How to run MondriaanOpt

Go inside the directory Mondriaan4 and type

if you want to partition the arc130.mtx matrix (Matrix Market file format) for 2 processors with at most 3% load imbalance, knowing that solutions must exist with volume at most 20. The matrix should be the full relative path; in the above example output is saved in the Mondriaan tests folder (../tests/).

Output

The MondriaanOpt tool yields, after a successful run on an input matrix, various output files. All possible output files are described below. Typically, the output filenames are that of the input matrix filename, modified with a small descriptor and the number of parts x(=2).

Formats with free nonzeros

All assigned nonzeros are assigned a processor-number to be assigned to, either 1 or 2. All free nonzeros will be assigned index 3. (Free nonzeros are nonzeros that are not assigned to a processor because assigning it to either one will not influence communication volume.) To stress the potential presence of free nonzeros, the number of processors (2) in the filename is followed by a suffix f

Processor indices (-I2f)

The MondriaanOpt program writes the processor indices of each nonzero to the Matrix Market file input-2f.mtx where the value of each nonzero is replaced by the processor index to which the nonzero has been assigned.

Graphical output (-2f.svg)

Besides textual output, also an SVG graphic is written to the file input-2f.svg, containing a visualisation of the partitioning.

Formats without free nonzeros

Here, the free nonzeros of a partitioning are distributed among the two processors in such a way that load imbalance is kept at a minimum.

Distributed matrix (-Px)

The MondriaanOpt program writes the distributed matrix to a file called input-Px, where input is the name of the input matrix, where x equals 3 when the distribution includes free nonzeros, and x equals 2 otherwise. We use an adapted Matrix Market format, with this structure:
%%MatrixMarket distributed-matrix coordinate real general
m n nnz P
Pstart[0]
( this should be 0 )
...
...
...
Pstart[P]( this should be nnz )
A.i[0] A.j[0] A.value[0] ...
...
...
A.i[nnz-1] A.j[nnz-1] A.value[nnz-1]
Here, Pstart[k] points to the start of the nonzeroes of processor k.

Processor indices (-Ix)

The MondriaanOpt program also writes the processor indices of each nonzero to the Matrix Market file input-Ix where the value of each nonzero is replaced by the processor index to which the nonzero has been assigned. The order of the nonzeroes is exactly that of the distributed matrix (-Px).

Cartesian submatrices (-Cx)

The program writes the row index sets I(q) and column index sets J(q) of the Cartesian submatrix I(q) x J(q) for the processors q=1,...,P to the file called input-Cx. This file is additional information, useful e.g. for visualisation, and you may not need it.

Program options

The MondriaanOpt options can be passed in the command line. An overview of the options is given below.

Option Value Description
-m Matrix file Required. The input matrix file in Matrix Market (.mtx) format
-v Volume Required. The starting upper bound volume
-e Load imbalance Required if -k is not passed. The allowed load imbalance
-k Number of nonzeros Required if -e is not passed. The maximum allowed number of nonzeros per part
-t Seconds Max running time in seconds
-r Dumpfile Resume with given dumpfile
-h None Show help

Using MondriaanOpt in MATLAB

For more information about MATLAB usage, please see the Mondriaan MATLAB guide. MondriaanOpt is available in Matlab using the MatlabMondriaanOpt MEX routine. Example matlab files are given as mondriaanOpt.m and mondriaanOptPlot.m.

References

[1] An exact algorithm for sparse matrix bipartitioning, Daniel M. Pelt and Rob H. Bisseling, Journal of Parallel and Distributed Computing, 85 (2015) pp. 79-90.


Last updated: October 3, 2016.

October 3, 2016 by Marco van Oort.

To the Mondriaan package home page.

Valid HTML 4.01 Strict Valid CSS!