72 const RCP<const Environment> &env__,
73 const RCP<
const Comm<int> > &problemComm__,
74 const RCP<const typename Adapter::base_adapter_t> &adapter__):
75 env(env__), comm(problemComm__), adapter(adapter__)
90 void partition(
const RCP<PartitioningSolution<Adapter> > &solution)
92 size_t nObj = adapter->getLocalNumIDs();
93 ArrayRCP<part_t> partList(
new part_t[nObj], 0, nObj,
true);
94 size_t nGlobalParts = solution->getTargetGlobalNumberOfParts();
96 const Teuchos::ParameterEntry *pe =
97 env->getParameters().getEntryPtr(
"forTestingOnlyFlag");
98 int forTestingOnlyFlag = pe->getValue<
int>(&forTestingOnlyFlag);
100 switch (forTestingOnlyFlag) {
104 if (comm->getRank() == 0) {
105 for (
size_t i = 0; i < nObj; i++) partList[i] = 0;
108 for (
size_t i = 0; i < nObj; i++)
109 if (i % 2) partList[i] = nGlobalParts - 1;
110 else partList[i] = 0;
116 if (comm->getRank() == 0) {
117 for (
size_t i = 0; i < nObj; i++) partList[i] = 0;
120 for (
size_t i = 0; i < nObj; i++)
121 if (i % 2) partList[i] = 0;
122 else partList[i] = nGlobalParts - 1;
126 throw std::runtime_error(
"invalid forTestingOnlyFlag value");
129 std::cout << comm->getRank() <<
" forTestingOnly " << forTestingOnlyFlag
131 for (
size_t i = 0; i < nObj; i++)
132 std::cout << partList[i] <<
" ";
133 std::cout << std::endl;
135 solution->setParts(partList);