Sierra Toolkit
Version of the Day
|
![]() |
This unit test creates a 2D quad mesh on proc 0 and then moves these elements in a predetermined way to other procs and finally all to proc 1 in parallel. The test passes in serial trivially and in paralle if all entities end up on proc 1.
The relevant headers for this unit test are
Global node and element numbering <pre> 7 8 9 +-------+-------+ | | | | e3 | e4 | | |5 | 4+-------+-------+6 | | | Y | e1 | e2 | | | | | | +-------+-------+ *--> X 1 2 3 </pre> Local node numbering <pre> 3 4 +-------+ | | | e1 | | | +-------+ 1 2 </pre>
is constructed on proc 0 by the code
Uniform unit weights are assigned to elements via
Mesh creation is signaled complete by calling
We instantiate our MockPartition, our Selector to include all elements in the mesh and our imbalance threshold we want to use to determine whether or not to compute a new element partition among processors:
We interrogate whether a rebalance is needed by calling
Upon return the bulk_data will reflect the new partiioning of elements with dependent entities, eg faces, edges, nodes, partitioned in a default greedy manner.
See UnitTestSimple.cpp for the complete source listing.
This unit test is identical to Simple Zoltan Unit Test with the only difference being use of graph-based partitioning instead of element weights.
The distinction involves setting up an appropriate parameter list,
The test passes if the resulting rebalance produces an imbalance measure below 1.1 for 2 or 4 procs and below 1.5 otherwise.
See UnitTestZoltanGraph.cpp for the complete source listing.
This unit test creates a 2D quad mesh on proc 0 with coordinates and Parts associated with edges, nodes, and constraints and then moves these entities as determined by calling Zoltan's load balancing capability using default settings.
Using the following mesh of 4 quads,
Global node and element numbering
7 8 9 +-------+-------+ | | | | e3 | e4 | | |5 | 4+-------+-------+6 | | | Y | e1 | e2 | | | | | | +-------+-------+ *--> X 1 2 3
Local node numbering
3 4 +-------+ | | | e1 | | | +-------+ 1 2
Use of Zoltan with default settings is achieved by instantiating the appropriate Partition class with an empty parameter list as follows,
An initial assessment of imbalance is made using an element weight field followed by a call to actually do the rebalance as follows,
Perfect balancing should result using 2 or 4 procs, and on 3 procs, the imbalance threshold should be below 1.5. The test passes if these criteria are satisfied.
See UnitTestZoltanSimple.cpp for the complete source listing.