Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROL: Use of deprecated Tpetra code #5540

Closed
Tracked by #5602
tjfulle opened this issue Jul 16, 2019 · 8 comments
Closed
Tracked by #5602

ROL: Use of deprecated Tpetra code #5540

tjfulle opened this issue Jul 16, 2019 · 8 comments
Assignees
Labels
type: bug The primary issue is a bug in Trilinos code or tests

Comments

@tjfulle
Copy link
Contributor

tjfulle commented Jul 16, 2019

Bug Report

@trilinos/rol

Relates to: #5536

Description

Several of ROL's examples use the deprecated Tpetra::CrsMatrix<>::getNode and clone methods:

$ cd packages/rol/example
$ grep -irn 'getNode(' .
./PDE-OPT/0ld/TOOLS/PDE_FEM.hpp:669:    //ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
./PDE-OPT/0ld/TOOLS/PDE_FEM.hpp:723://    //ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
./PDE-OPT/0ld/adv-diff-react/data.hpp:532:    ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
./PDE-OPT/0ld/poisson/data.hpp:453:    ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
./PDE-OPT/0ld/stefan-boltzmann/data.hpp:475:    ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
./PDE-OPT/0ld/stefan-boltzmann/data.hpp:734:    ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
./PDE-OPT/0ld/stoch-adv-diff/data.hpp:605:    ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
./PDE-OPT/0ld/stoch-adv-diff/data.hpp:808:    ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
@tjfulle tjfulle added the type: bug The primary issue is a bug in Trilinos code or tests label Jul 16, 2019
@tjfulle
Copy link
Contributor Author

tjfulle commented Jul 16, 2019

getNode is only used to cal (the deprecated) Tpetra::CrsMatrix<>::clone. clone appears to be used to make a deep copy of the matrix. The following diff gets around the compile error:

-    ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
-    matA_dirichlet_ = matA_->clone(node);
+    matA_dirichlet_ = ROL::makePtr<Tpetra::CrsMatrix<>>(*matA_, Teuchos::DataAccess::Copy);

apply this (or similar) everywhere clone is called.

@kyungjoo-kim
Copy link
Contributor

@tjfulle I just compiled the code with deprecated off and inst int int ON. It compiled ROL examples and tests. Could you give me a more specific Tpetra configuration ? I tested the default one too but it does not cause a compile problem.

@kyungjoo-kim
Copy link
Contributor

Do I need to turn on warning as an error ?

@tjfulle
Copy link
Contributor Author

tjfulle commented Jul 31, 2019

@kyngjoo-kim, see #5602 (comment) for the config. It could be that this has already been fixed by the ROL developers?

@tjfulle
Copy link
Contributor Author

tjfulle commented Jul 31, 2019

@kyungjoo-kim note, the config linked in the last comment disables ROL's examples, you would need to remove that line.

@kyungjoo-kim
Copy link
Contributor

@tjfulle now I see some errors..

@kyungjoo-kim
Copy link
Contributor

kyungjoo-kim commented Jul 31, 2019

Hi @tjfulle I pushed into the issue-5536 branch. At least it compiles with deprecation code off. I also found that you already finish all changes related to getNode and clone. My fix is on the mismatch between local use of int type and Tpetra global ordinal type. Please double check if ROL compiles as I can see on "white".

@tjfulle
Copy link
Contributor Author

tjfulle commented Aug 20, 2019

closed by #5739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug The primary issue is a bug in Trilinos code or tests
Projects
None yet
Development

No branches or pull requests

2 participants