trilinos / Trilinos

Primary repository for the Trilinos Project
https://trilinos.org/
Other
1.2k stars 564 forks source link

Zoltan incorrectly reads MatrixMarket matrices #2033

Closed rsln-s closed 3 years ago

rsln-s commented 6 years ago

@trilinos/zoltan

Expectations

Zoltan should correctly read MatrixMarket format matrices and interpret them in row-net fashion (i.e. each row in the matrix corresponds to a hyperedge and each column to a vertex).

Current Behavior

As pointed out by @SebastianSchlag, on matrix VDOL/hangGlider_3 after reading in the hypergraph the number of edges in it is 10259, vertices -- 10260 and pins (nonzeros) -- 44643. However, the matrix contains 10260 vertices, 10260 edges and 92703 nonzeros. @SebastianSchlag points out that this results in incorrect cut computations when compared to hMetis, for example. Please note that this problem has been tested in serial mode (i.e. on one processor, without MPI).

Motivation and Context

I have previously attempted to fix this problem, but recently discovered (thanks, again, to @SebastianSchlag) that my fix is indeed incorrect. I will close the corresponding pull request #1198

Definition of Done

After the fix Zoltan should read the matrix in correctly. For example, for VDOL/hangGlider_3 the following should be true at the most fine level:

hg->nVtx == 10260
hg->nEdge == 10260
hg->nPins == 92703

Steps to Reproduce

To check the number of vertices, hyperedges and nonzeros I have introduced the following three lines in 'phg/phg.c' (after line 475):

  printf("RS_VERTEX_NUM=%d\n", hg->nVtx);
  printf("RS_HEDGE_NUM=%d\n", hg->nEdge);
  printf("RS_PINS_NUM=%d\n", hg->nPins);

Then to build and run:

cd /home/rshaydu/dev/Trilinos/build
cmake -D CMAKE_INSTALL_PREFIX:FILEPATH="/home/rshaydu/dev/Trilinos/build" -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF -D Trilinos_ENABLE_Zoltan:BOOL=ON  -D Zoltan_ENABLE_EXAMPLES:BOOL=ON -D TPL_ENABLE_MPI:BOOL=OFF -D Trilinos_ENABLE_Fortran:BOOL=OFF -D Zoltan_ENABLE_TESTS:BOOL=ON  ..
cd ~/test_dir
cp ~/Trilinos/build/packages/zoltan/src/driver/*.exe .
./zdrive.exe zdrive.inp.hangGlider_3.agg.2.110

Where zdrive.inp.hangGlider_3.agg.2.110:

Decomposition Method = hypergraph
Zoltan Parameters = HYPERGRAPH_PACKAGE=phg
Zoltan Parameters = lb_approach=partition
File Type = matrixmarket
File Name =  hangGlider_3
Parallel Disk Info = number=0
Zoltan Parameters = NUM_GLOBAL_PARTITIONS =  2
Zoltan Parameters = PHG_COARSENING_METHOD= agg
Zoltan Parameters = PHG_CUT_OBJECTIVE=HYPEREDGES
Zoltan Parameters = IMBALANCE_TOL= 1.1
kddevin commented 6 years ago

You are correct that the driver program in Zoltan does not read symmetric matrix-market files. It is written to read general files or pattern files. While not a good long-term solution, a quick short-term solution would be to convert the symmetric matrix-market file to a general file, including the transposed nonzeros and provide that file to zdrive.

Enabling the reader to read symmetric files would not be difficult. It would require some attention to maximum array sizes and computation of global number of pins, as well as new testing. Unfortunately, we are short-handed at this time.

@trilinos/zoltan

github-actions[bot] commented 3 years ago

This issue has had no activity for 365 days and is marked for closure. It will be closed after an additional 30 days of inactivity. If you would like to keep this issue open please add a comment and/or remove the MARKED_FOR_CLOSURE label. If this issue should be kept open even with no activity beyond the time limits you can add the label DO_NOT_AUTOCLOSE. If it is ok for this issue to be closed, feel free to go ahead and close it. Please do not add any comments or change any labels or otherwise touch this issue unless your intention is to reset the inactivity counter for an additional year.

github-actions[bot] commented 3 years ago

This issue was closed due to inactivity for 395 days.