Tpetra: Add scope guard for initialize/finalize
Created by: mhoemmen
Add a scope guard for Tpetra::initialize / Tpetra::finalize. Imitate the corresponding Kokkos solution: https://github.com/kokkos/kokkos/issues/1479
@trilinos/tpetra
Motivation and Context
Users are used to Teuchos::GlobalMPISession
, which is a scope guard. Naïve conversion to Tpetra::initialize
/ Tpetra::finalize
may result in forgetting to call Tpetra::finalize
before premature exit of main
. Premature exit may be either by return
or by throwing an exception.