|
Zoltan2
Version of the Day
|
PartitioningProblem sets up partitioning problems for the user. More...
#include <Zoltan2_PartitioningProblem.hpp>


Public Types | |
| typedef Adapter::scalar_t | scalar_t |
| typedef Adapter::gid_t | gid_t |
| typedef Adapter::gno_t | gno_t |
| typedef Adapter::lno_t | lno_t |
| typedef Adapter::user_t | user_t |
| typedef Adapter::base_adapter_t | base_adapter_t |
Public Member Functions | |
| ~PartitioningProblem () | |
| Destructor. More... | |
| PartitioningProblem (Adapter *A, Teuchos::ParameterList *p) | |
| Constructor where communicator is the Teuchos default. More... | |
| void | solve (bool updateInputData=true) |
| Direct the problem to create a solution. More... | |
| const PartitioningSolution< Adapter > & | getSolution () |
| Get the solution to the problem. More... | |
| const scalar_t | getImbalance (int dim=0) const |
| Returns the imbalance of the solution. More... | |
| ArrayRCP< const MetricValues< scalar_t > > | getMetrics () const |
| Get the array of metrics Metrics were only computed if user requested metrics with a parameter. More... | |
| void | printMetrics (ostream &os) const |
| Print the array of metrics. More... | |
| void | setPartSizes (int len, partId_t *partIds, scalar_t *partSizes, bool makeCopy=true) |
| Set or reset relative sizes for the partitions that Zoltan2 will create. More... | |
| void | setPartSizesForCritiera (int criteria, int len, partId_t *partIds, scalar_t *partSizes, bool makeCopy=true) |
| Set or reset the relative sizes (per weight) for the partitions that Zoltan2 will create. More... | |
| void | resetParameters (ParameterList *params) |
| Reset the list of parameters. More... | |
| const RCP< const Environment > & | getEnvironment () const |
| Get the current Environment. Useful for testing. More... | |
| void | printTimers () const |
| If timer data was collected, print out global data. More... | |
Protected Attributes | |
| Adapter * | inputAdapter_ |
| base_adapter_t * | baseInputAdapter_ |
| RCP< GraphModel< base_adapter_t > > | graphModel_ |
| RCP< IdentifierModel< base_adapter_t > > | identifierModel_ |
| RCP< CoordinateModel< base_adapter_t > > | coordinateModel_ |
| RCP< const Model< base_adapter_t > > | baseModel_ |
| RCP< ParameterList > | params_ |
| RCP< const Comm< int > > | comm_ |
| RCP< Environment > | env_ |
| RCP< const Environment > | envConst_ |
PartitioningProblem sets up partitioning problems for the user.
The PartitioningProblem is the core of the Zoltan2 partitioning API. Based on the the user's input and parameters, the PartitioningProblem sets up a computational Model, and a Solution object. When the user calls the solve() method, the PartitioningProblem runs the algorithm, after which the Solution object may be obtained by the user.
include pointers to examples
repartition given an initial solution
follow partitioning with global or local ordering
allow unsetting of part sizes by passing in null pointers
add a parameter by which user tells us there are no self edges to be removed.
The template parameter is the InputAdapter containing the data that is to be partitioned.
Definition at line 91 of file Zoltan2_PartitioningProblem.hpp.
| typedef Adapter::scalar_t Zoltan2::PartitioningProblem< Adapter >::scalar_t |
Definition at line 95 of file Zoltan2_PartitioningProblem.hpp.
| typedef Adapter::gid_t Zoltan2::PartitioningProblem< Adapter >::gid_t |
Definition at line 96 of file Zoltan2_PartitioningProblem.hpp.
| typedef Adapter::gno_t Zoltan2::PartitioningProblem< Adapter >::gno_t |
Definition at line 97 of file Zoltan2_PartitioningProblem.hpp.
| typedef Adapter::lno_t Zoltan2::PartitioningProblem< Adapter >::lno_t |
Definition at line 98 of file Zoltan2_PartitioningProblem.hpp.
| typedef Adapter::user_t Zoltan2::PartitioningProblem< Adapter >::user_t |
Definition at line 99 of file Zoltan2_PartitioningProblem.hpp.
| typedef Adapter::base_adapter_t Zoltan2::PartitioningProblem< Adapter >::base_adapter_t |
Definition at line 100 of file Zoltan2_PartitioningProblem.hpp.
|
inline |
Destructor.
Definition at line 108 of file Zoltan2_PartitioningProblem.hpp.
| Zoltan2::PartitioningProblem< Adapter >::PartitioningProblem | ( | Adapter * | A, |
| Teuchos::ParameterList * | p | ||
| ) |
Constructor where communicator is the Teuchos default.
Definition at line 367 of file Zoltan2_PartitioningProblem.hpp.
|
virtual |
Direct the problem to create a solution.
Implements Zoltan2::Problem< Adapter >.
Definition at line 486 of file Zoltan2_PartitioningProblem.hpp.
|
inline |
Get the solution to the problem.
Definition at line 144 of file Zoltan2_PartitioningProblem.hpp.
|
inline |
Returns the imbalance of the solution.
| dim | If there are multiple weights per object, specify the dimension for which the imbalance is desired, ranging from zero to one less then number of weights per object. Imbalance was only computed if user requested metrics with a parameter. |
Definition at line 156 of file Zoltan2_PartitioningProblem.hpp.
|
inline |
Get the array of metrics Metrics were only computed if user requested metrics with a parameter.
Definition at line 168 of file Zoltan2_PartitioningProblem.hpp.
|
inline |
Print the array of metrics.
| os | the output stream for the report. Metrics were only computed if user requested metrics with a parameter. |
Definition at line 182 of file Zoltan2_PartitioningProblem.hpp.
|
inline |
Set or reset relative sizes for the partitions that Zoltan2 will create.
| len | The size of the partIds and partSizes lists |
| partIds | A list of len partition identifiers. Partition identifiers range from zero to one less than the global number of identifiers. |
| partSizes | A list of len relative sizes corresponding to the partIds. |
| makeCopy | If true, Zoltan2 will make a copy of the ids and sizes that are provided in this call. If false, Zoltan2 will just save the pointers to to the caller's lists. If the pointers will remain remain valid throughout the lifetime of the PartitioningProblem, and memory use is an issue, then set makeCopy to false. By default, Zoltan2 will copy the caller's list of ids and sizes. |
A given partid should only be provided once across the application. Duplicate partIds will generate a std::runtime_error exception when the PartitioningSolution is created. Part ids that are omitted will be assigned the average of the sizes that have been specified.
Subsequent calls to setPartSizes will replace the list of part ids and part sizes provided previously.
If the application has set multiple weights per object, then the part sizes supplied in this method are applied to the first weight.
Zoltan2 assumes that uniform partition sizes are desired by the caller, unless specified otherwise in a call to setPartSizes or setPartSizesForCritiera.
Definition at line 227 of file Zoltan2_PartitioningProblem.hpp.
| void Zoltan2::PartitioningProblem< Adapter >::setPartSizesForCritiera | ( | int | criteria, |
| int | len, | ||
| partId_t * | partIds, | ||
| scalar_t * | partSizes, | ||
| bool | makeCopy = true |
||
| ) |
Set or reset the relative sizes (per weight) for the partitions that Zoltan2 will create.
| criteria | the criteria (weight dimension) for which these part sizes apply. Criteria range from zero to one less than the number of weights per object specified in the caller's InputAdapter. |
| len | The size of the partIds and partSizes lists |
| partIds | A list of len partition identifiers. Partition identifiers range from zero to one less than the global number of identifiers. |
| partSizes | A list of len relative sizes corresponding to the partIds. |
| makeCopy | If true, Zoltan2 will make a copy of the ids and sizes that are provided in this call. If false, Zoltan2 will just save the pointers to to the caller's lists. If the pointers will remain remain valid throughout the lifetime of the PartitioningProblem, and memory use is an issue, then set makeCopy to false. By default, Zoltan2 will copy the caller's list of ids and sizes. |
A given partid should only be provided once across the application. Duplicate partIds will generate a std::runtime_error exception when the PartitioningSolution is created. Part ids that are omitted will be assigned the average of the sizes that have been specified.
Subsequent calls to setPartSizes for the same criteria will replace the list of part ids and part sizes provided for that criteria previously.
Zoltan2 assumes that uniform partition sizes are desired by the caller, unless specified otherwise in a call to setPartSizes or setPartSizesForCritiera.
Definition at line 442 of file Zoltan2_PartitioningProblem.hpp.
|
inline |
Reset the list of parameters.
Definition at line 274 of file Zoltan2_PartitioningProblem.hpp.
|
inline |
Get the current Environment. Useful for testing.
Definition at line 285 of file Zoltan2_PartitioningProblem.hpp.
|
inlineinherited |
If timer data was collected, print out global data.
If the parameter "timer_output_stream" or "timer_output_file" was set, then timing statistics are available and will be printed out to the requested output stream with this call.
All processes in the application must call this, even if they were not all in the problem communicator. All timers are reset back to zero after this call.
Timer starts, stops and displays are ignored if Zoltan2 is compiled with Z2_OMIT_ALL_ERROR_CHECKING.
Definition at line 110 of file Zoltan2_Problem.hpp.
|
protectedinherited |
Definition at line 128 of file Zoltan2_Problem.hpp.
|
protectedinherited |
Definition at line 129 of file Zoltan2_Problem.hpp.
|
protectedinherited |
Definition at line 131 of file Zoltan2_Problem.hpp.
|
protectedinherited |
Definition at line 132 of file Zoltan2_Problem.hpp.
|
protectedinherited |
Definition at line 133 of file Zoltan2_Problem.hpp.
|
protectedinherited |
Definition at line 139 of file Zoltan2_Problem.hpp.
|
protectedinherited |
Definition at line 141 of file Zoltan2_Problem.hpp.
|
protectedinherited |
Definition at line 142 of file Zoltan2_Problem.hpp.
|
protectedinherited |
Definition at line 148 of file Zoltan2_Problem.hpp.
|
protectedinherited |
Definition at line 153 of file Zoltan2_Problem.hpp.
1.8.11