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);
75 typedef Tpetra::Map<> Map_t;
76 typedef Map_t::local_ordinal_type localId_t;
77 typedef Map_t::global_ordinal_type globalId_t;
78 typedef double scalar_t;
83 size_t localCount = 40*(rank+1);
84 globalId_t *globalIds =
new globalId_t [localCount];
87 for (
int i=0, num=40; i <= nprocs ; i++, num+=40)
88 cout <<
"Rank " << i <<
" has " << num <<
" ids." << endl;
90 globalId_t offset = 0;
91 for (
int i=1; i <= rank; i++)
94 for (
size_t i=0; i < localCount; i++)
95 globalIds[i] = offset++;
106 std::vector<const scalar_t *> noWeights;
107 std::vector<int> noStrides;
109 inputAdapter_t ia(localCount, globalIds, noWeights, noStrides);
114 Teuchos::ParameterList params(
"test params");
115 params.set(
"debug_level",
"basic_status");
116 params.set(
"debug_procs",
"0");
117 params.set(
"error_check_level",
"debug_mode_assertions");
119 params.set(
"algorithm",
"block");
120 params.set(
"imbalance_tolerance", 1.1);
121 params.set(
"num_global_parts", nprocs);
141 cout <<
"PASS" << endl;
145 #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[])