97 RCP<Matrix> A = Get<RCP<Matrix> >(level,
"A");
98 RCP<const Map> rowMap = A->getRowMap();
100 int numParts = Get<int>(level,
"number of partitions");
101 if (numParts == 1 || numParts == -1) {
103 RCP<Xpetra::Vector<GO,LO,GO,NO> > decomposition = Xpetra::VectorFactory<GO, LO, GO, NO>::Build(rowMap,
true);
104 Set(level,
"Partition", decomposition);
109 RCP<const Teuchos::Comm<int> > NodeComm = Get< RCP<const Teuchos::Comm<int> > >(level,
"Node Comm");
110 TEUCHOS_TEST_FOR_EXCEPTION(NodeComm.is_null(),
Exceptions::RuntimeError,
"MueLu::NodePartitionInterface::Build(): NodeComm is null.");
113 int nodeZeroRank =A->getMap()->getComm()->getRank();
114 Teuchos::broadcast<int,int>(*NodeComm,0,Teuchos::inOutArg(nodeZeroRank));
118 RCP<Xpetra::Vector<GO,LO,GO,NO> > decomposition = Xpetra::VectorFactory<GO,LO,GO,NO>::Build(rowMap,
false);
119 decomposition->putScalar(Teuchos::as<GO>(nodeZeroRank));
121 Set(level,
"Partition", decomposition);