6 #include <Teuchos_RCP.hpp>
7 #include <Teuchos_DefaultComm.hpp>
8 #include <Teuchos_Comm.hpp>
10 #include <Tpetra_Map.hpp>
11 #include <Epetra_Map.h>
12 #include <Xpetra_EpetraMap.hpp>
13 #include <Xpetra_EpetraUtils.hpp>
15 int main(
int narg,
char **arg)
17 Tpetra::ScopeGuard tscope(&narg, &arg);
18 Teuchos::RCP<const Teuchos::Comm<int> > tcomm = Tpetra::getDefaultComm();
19 Teuchos::RCP<const Epetra_Comm> ecomm = Xpetra::toEpetra(tcomm);
21 const int nGlobRows = 50;
22 const Epetra_Map emap(nGlobRows, 0, *ecomm);
23 Teuchos::RCP<const Epetra_BlockMap> ebmap = Teuchos::rcpFromRef(emap);
25 typedef Xpetra::EpetraMapT<int, Tpetra::Map<>::node_type> xemap_t;
26 Teuchos::RCP<const xemap_t> xmap(
new xemap_t(ebmap));
28 const Teuchos::RCP<const Teuchos::Comm<int> > &xcomm = xmap->getComm();
30 std::cout <<
"Teuchos: Hello from "
31 << tcomm->getRank() <<
" of "
32 << tcomm->getSize() << std::endl;
33 std::cout <<
"Epetra: Hello from "
34 << ecomm->MyPID() <<
" of "
35 << ecomm->NumProc() << std::endl;
36 std::cout <<
"Xpetra: Hello from "
37 << xcomm->getRank() <<
" of "
38 << xcomm->getSize() << std::endl;
int main(int narg, char **arg)