37 const RCP<const Environment> &env__,
38 const RCP<
const Comm<int> > &problemComm__,
39 const RCP<const typename Adapter::base_adapter_t> &adapter__):
40 env(env__), comm(problemComm__), adapter(adapter__)
57 size_t nObj = adapter->getLocalNumIDs();
58 ArrayRCP<part_t> partList(
new part_t[nObj], 0, nObj,
true);
59 size_t nGlobalParts = solution->getTargetGlobalNumberOfParts();
61 const Teuchos::ParameterEntry *pe =
62 env->getParameters().getEntryPtr(
"forTestingOnlyFlag");
63 int forTestingOnlyFlag = pe->getValue<
int>(&forTestingOnlyFlag);
65 switch (forTestingOnlyFlag) {
69 if (comm->getRank() == 0) {
70 for (
size_t i = 0; i < nObj; i++) partList[i] = 0;
73 for (
size_t i = 0; i < nObj; i++)
74 if (i % 2) partList[i] = nGlobalParts - 1;
81 if (comm->getRank() == 0) {
82 for (
size_t i = 0; i < nObj; i++) partList[i] = 0;
85 for (
size_t i = 0; i < nObj; i++)
86 if (i % 2) partList[i] = 0;
87 else partList[i] = nGlobalParts - 1;
91 throw std::runtime_error(
"invalid forTestingOnlyFlag value");
94 std::cout << comm->getRank() <<
" forTestingOnly " << forTestingOnlyFlag
96 for (
size_t i = 0; i < nObj; i++)
97 std::cout << partList[i] <<
" ";
98 std::cout << std::endl;
100 solution->setParts(partList);