62 int main(
int argc,
char *argv[])
64 #ifdef HAVE_ZOLTAN2_MPI 65 MPI_Init(&argc, &argv);
67 MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
68 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
73 typedef double scalar_t;
74 typedef int localId_t;
75 #ifdef HAVE_ZOLTAN2_LONG_LONG 76 typedef long long globalId_t;
78 typedef int globalId_t;
84 size_t localCount = 40*(rank+1);
85 globalId_t *globalIds =
new globalId_t [localCount];
88 for (
int i=0, num=40; i <= nprocs ; i++, num+=40)
89 cout <<
"Rank " << i <<
" has " << num <<
" ids." << endl;
91 globalId_t offset = 0;
92 for (
int i=1; i <= rank; i++)
95 for (
size_t i=0; i < localCount; i++)
96 globalIds[i] = offset++;
107 std::vector<const scalar_t *> noWeights;
108 std::vector<int> noStrides;
110 inputAdapter_t ia(localCount, globalIds, noWeights, noStrides);
115 Teuchos::ParameterList params(
"test params");
116 params.set(
"debug_level",
"basic_status");
117 params.set(
"debug_procs",
"0");
118 params.set(
"error_check_level",
"debug_mode_assertions");
120 params.set(
"algorithm",
"block");
121 params.set(
"imbalance_tolerance", 1.1);
122 params.set(
"num_global_parts", nprocs);
142 cout <<
"PASS" << endl;
146 #ifdef HAVE_ZOLTAN2_MPI A simple class that can be the User template argument for an InputAdapter.
Defines the PartitioningSolution class.
This class represents a collection of global Identifiers and their associated weights, if any.
void printMetrics(std::ostream &os) const
Print the array of metrics.
Defines the BasicIdentifierAdapter class.
PartitioningProblem sets up partitioning problems for the user.
Defines the PartitioningProblem class.
void solve(bool updateInputData=true)
Direct the problem to create a solution.
int main(int argc, char *argv[])