Zoltan2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
XpetraEpetraMap.cpp
Go to the documentation of this file.
1 // Program to debug segfaults being reported in CDASH when
2 // -D KokkosClassic_DefaultNode:STRING=Tpetra::KokkosCompat::KokkosOpenMPWrapperNode
3 // -D Trilinos_ENABLE_OpenMP:BOOL=ON
4 // Problem appears to be in creation of Xpetra::EpetraMapT
5 
6 #include <Teuchos_RCP.hpp>
7 #include <Teuchos_DefaultComm.hpp>
8 #include <Teuchos_Comm.hpp>
9 
10 #include <Tpetra_Map.hpp>
11 #include <Epetra_Map.h>
12 #include <Xpetra_EpetraMap.hpp>
13 #include <Xpetra_EpetraUtils.hpp>
14 
15 int main(int narg, char **arg)
16 {
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);
20 
21  const int nGlobRows = 50;
22  const Epetra_Map emap(nGlobRows, 0, *ecomm);
23  Teuchos::RCP<const Epetra_BlockMap> ebmap = Teuchos::rcpFromRef(emap);
24 
25  typedef Xpetra::EpetraMapT<int, Tpetra::Map<>::node_type> xemap_t;
26  Teuchos::RCP<const xemap_t> xmap(new xemap_t(ebmap));
27 
28  const Teuchos::RCP<const Teuchos::Comm<int> > &xcomm = xmap->getComm();
29 
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;
39 }
int main(int narg, char **arg)
Definition: coloring1.cpp:199