48 #include <Kokkos_Core.hpp>
49 #include <Teuchos_DefaultComm.hpp>
50 #include <Teuchos_RCP.hpp>
51 #include <Teuchos_CommHelpers.hpp>
55 int main(
int narg,
char *arg[]) {
57 Tpetra::ScopeGuard tscope(&narg, &arg);
58 Teuchos::RCP<const Teuchos::Comm<int> > comm = Tpetra::getDefaultComm();
63 int rank = comm->getRank();
64 int nprocs = comm->getSize();
65 int fail = 0, gfail = 0;
69 const int nWeights = 2;
71 Kokkos::View<zgno_t *> myIds(
"myIds", numLocalIds);
72 zgno_t myFirstId = rank * numLocalIds * numLocalIds;
73 Kokkos::View<zscalar_t **, Layout>
weights(
"weights", numLocalIds, nWeights);
75 for (
zlno_t i = 0; i < numLocalIds; i++) {
76 myIds(i) =
zgno_t(myFirstId + i);
78 weights(i, 1) = (nprocs - rank) / (i + 1);
90 Kokkos::View<zgno_t *> globalIdsIn;
91 Kokkos::View<zscalar_t *> weightsIn[nWeights];
95 for (
int w = 0; !
fail && w < nWeights; w++) {
99 Kokkos::View<zscalar_t *> w0 = weightsIn[0];
100 Kokkos::View<zscalar_t *> w1 = weightsIn[1];
102 for (
zlno_t i = 0; !
fail && i < numLocalIds; i++){
103 if (globalIdsIn(i) !=
zgno_t(myFirstId + i)) {
106 if (!
fail && w0(i) != 1.0) {
119 std::cout <<
"PASS" << std::endl;