// @HEADER // *********************************************************************** // Copyright message goes here. // *********************************************************************** // @HEADER #include #include #include #include #include #include #include int main(int narg, char *arg[]) { Teuchos::GlobalMPISession session(&narg, &arg, NULL); Teuchos::RCP > comm = Teuchos::DefaultComm::getComm(); int rank = comm->getRank(); typedef Tpetra::CrsMatrix<> tcrsMatrix_t; typedef typename tcrsMatrix_t::node_type node_t; typedef Tpetra::MatrixMarket::Reader reader_t; try { std::cout << rank << " Calling defaultArgNode" << std::endl; Teuchos::RCP defNode = Tpetra::defaultArgNode(); } catch (std::exception &e) { std::cout << "FAIL Exception caught: " << e.what() << std::endl; return -1; } std::string basename("simple"); std::ostringstream fname; fname << basename << ".mtx"; Teuchos::RCP mat; try{ if (rank == 0) std::cout << "Trying to read file " << fname.str() << std::endl; mat = reader_t::readSparseFile(fname.str(), comm, true, false, false); } catch (std::exception &e) { std::cout << "FAIL Exception caught: " << e.what() << std::endl; return -1; } std::cout << "PASS Matrix #rows=" << mat->getGlobalNumRows() << " " << mat->getNodeNumRows() << std::endl; return 0; }