ROL: Purge use of Tpetra::*Platform
Created by: mhoemmen
Tpetra will soon deprecate and remove DefaultPlatform
, MpiPlatform
, and SerialPlatform
, per #3095 (closed). ROL uses DefaultPlatform quite a bit. This needs to go. See below for the replacement strategy.
@trilinos/rol @dridzal
Possible Solution
Tests or examples that use Tpetra and do this:
#include "Teuchos_GlobalMPISession.hpp"
#include "Tpetra_DefaultPlatform.hpp"
int main (int argc, char* argv[]) {
Teuchos::GlobalMPISession mpiSession (&argc, &argv, NULL);
auto comm = Tpetra::DefaultPlatform::getDefaultPlatform().getComm();
auto node = Tpetra::DefaultPlatform::getDefaultPlatform().getNode();
// ... rest of the code ...
}
should do this instead:
#include "Tpetra_Core.hpp"
int main (int argc, char* argv[]) {
Tpetra::ScopeGuard mpiSession (&argc, &argv); // inits MPI and Kokkos
auto comm = Tpetra::getDefaultComm();
// ... don't make Node instances any more ...
// ... rest of the code ...
}
Related Issues
- Blocks #3095 (closed), #57