Zoltan partitioning with transmissibility coarsened graph - #1050
Conversation
|
jenkins build this opm-simulators=7216 please |
|
I am reviewing the PR and I will need more time to digest the algorithm but here are two little things that could be improved:
|
michal-toth
left a comment
There was a problem hiding this comment.
Regarding code:
There is also a lots of copy-pasting, so the code looks more like a draft with a pending refactorization. (Being a draft can make this review sound harsher, I am sorry.) I would also welcome more comments in the code. (E.g. method dfsq was fine but createCoarseGraph is completely commentless.)
For now, unit tests cover only uniform edge weights. Since the vertex grouping is done based on the greatest transmissibility (and all transmissibilities are equal), the priority queue q (in dfsq) is never filled and a big part of the code is not tested.
Regarding the algorithm:
I am looking forward to the new partitioning option. I did not test it yet but for now my feeling is that picking the right seed nodes for the cell grouping can make a big difference. I would welcome an option to use edge weights rescaled to the node instead of using transmissibilities. (E.g. by dividing each node's edge weights by its lowest edge weight. Big edge weight would then mean that two cells are coupled more strongly to themself than to their neighbors. The edge weights would not be symmetric anymore but it would be more fair in the graphs where one area has higher transmissibilities than other.)
| } | ||
| // Call dfsq reflexively on strongest connection in queue | ||
| if (!visited[nab]) | ||
| dfsq((*transGraph)[nab],q,nab,master,w,maxNode,visited,cnode,edges); |
There was a problem hiding this comment.
Try rewriting the recursion into an iterative algorithm. It seems like the recursion can run quite deep, and it manipulates the same objects. The hierarchy of recursion is not necessary so the iterative form can save a lot.
| } | ||
|
|
||
| template<typename Zoltan_Struct> | ||
| void setCoarseGraphZoltanGraphFunctions(Zoltan_Struct *zz, |
There was a problem hiding this comment.
Identical to setGraphOfGridZoltanGraphFunctions. Template it instead of copy-paste.
|
I believe I have implemented most of the suggestions. The exceptions are logarithmic edge weights and rewriting the recursion to an iterative algorithm.
I am a bit confused about this. You are correct that all tests use uniform edge weights, but this is only relevant for setting the edge weights in the coarse graph. For creating the coarse graph by merging nodes, transmissibility is always used to determine strong connections. |
I assumed that the edge weights and transmissibilities are the same thing in this case, i.e. using uniform edge weights is equivalent to set all transmissibilities to 1. Consequently, the queue |
It is very easy to make that assumption! When discussing weights please make sure to distinguish between the two stages: coarsening (always transmissibility based) and subsequent partitioning (uniform or transmissibility based, weights between nodes are in all cases the sum of weights of connecting fine-level weights). |
Implementation of the Zoltan coarse graph partitioning method presented at the OPM summit.
Adds another option for doing partitioning, zoltanCG. The new method coarsens the partitioning graph by merging nodes that are connected with a transmissibilty larger than a given threshold. The threshold is calculated in opm-simulators. There is also a limit to how many nodes that can be merged set by another parameter in opm-simulators. Coarsening is done by performing a depth first search of the partitioning graph.
zoltanCG supports distributed-wells=true/false and serial-partitioning=true/false.