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).

Processor indices (_P2.mtx)

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

Graphical output

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

(Optional) Distributed matrix (-Px)

When the convert flag is passed, 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.

(Optional) Processor indices (-Ix)

When the convert flag is passed, 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).

(Optional) Cartesian submatrices (-Cx)

When the convert flag is passed, 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
-c None After computation is complete, convert results to Mondriaan output.
-C None Do not compute anything; convert previously obtained results to Mondriaan output. (When passed, only -m is required.)

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: September 27, 2016.

September 27, 2016 by Marco van Oort.

To the Mondriaan package home page.

Valid HTML 4.01 Strict Valid CSS!