70 RCP<const Comm<int> > comm = graph.getComm();
71 int fail = 0, gfail=0;
83 const zgno_t *vtxIds=NULL, *edgeIds=NULL;
84 const offset_t *offsets=NULL;
93 if (nvtx != graph.getLocalNumRows())
99 printGraph<offset_t>(comm, nvtx, vtxIds, offsets, edgeIds);
110 Tpetra::ScopeGuard tscope(&narg, &arg);
111 Teuchos::RCP<const Teuchos::Comm<int> > comm = Tpetra::getDefaultComm();
113 int rank = comm->getRank();
114 int fail = 0, gfail=0;
120 RCP<UserInputForTests> uinput;
121 Teuchos::ParameterList params;
122 params.set(
"input file",
"simple");
123 params.set(
"file type",
"Chaco");
128 catch(std::exception &e){
130 std::cout << e.what() << std::endl;
137 tG = uinput->getUITpetraCrsGraph();
138 size_t nvtx = tG->getLocalNumRows();
149 typedef adapter_t::part_t
part_t;
152 memset(p, 0,
sizeof(
part_t) * nvtx);
153 ArrayRCP<part_t> solnParts(p, 0, nvtx,
true);
155 soln_t solution(env, comm, nWeights);
156 solution.setParts(solnParts);
162 std::cout <<
"Input adapter for Tpetra::CrsGraph" << std::endl;
164 RCP<const tgraph_t> ctG = rcp_const_cast<const tgraph_t>(tG);
165 RCP<Zoltan2::XpetraCrsGraphAdapter<tgraph_t> > tGInput;
171 catch (std::exception &e){
173 std::cout << e.what() << std::endl;
177 fail = verifyInputAdapter<tgraph_t>(*tGInput, *tG);
184 tGInput->applyPartitioningSolution( *tG, mMigrate, solution);
185 newG = rcp(mMigrate);
187 catch (std::exception &e){
194 RCP<const tgraph_t> cnewG = rcp_const_cast<const tgraph_t>(newG);
195 RCP<Zoltan2::XpetraCrsGraphAdapter<tgraph_t> > newInput;
199 catch (std::exception &e){
201 std::cout << e.what() << std::endl;
207 "Input adapter for Tpetra::CrsGraph migrated to proc 0" <<
210 fail = verifyInputAdapter<tgraph_t>(*newInput, *newG);
224 std::cout <<
"Input adapter for Xpetra::CrsGraph" << std::endl;
226 RCP<xgraph_t> xG = uinput->getUIXpetraCrsGraph();
227 RCP<const xgraph_t> cxG = rcp_const_cast<const xgraph_t>(xG);
228 RCP<Zoltan2::XpetraCrsGraphAdapter<xgraph_t> > xGInput;
234 catch (std::exception &e){
236 std::cout << e.what() << std::endl;
240 fail = verifyInputAdapter<xgraph_t>(*xGInput, *tG);
247 xGInput->applyPartitioningSolution( *xG, mMigrate, solution);
249 catch (std::exception &e){
256 RCP<const xgraph_t> cnewG(mMigrate);
257 RCP<Zoltan2::XpetraCrsGraphAdapter<xgraph_t> > newInput;
262 catch (std::exception &e){
264 std::cout << e.what() << std::endl;
270 "Input adapter for Xpetra::CrsGraph migrated to proc 0" <<
273 fail = verifyInputAdapter<xgraph_t>(*newInput, *newG);
287 std::cout <<
"PASS" << std::endl;