-
Notifications
You must be signed in to change notification settings - Fork 578
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
TpetraTSQR: Run on NVIDIA GPUs; ensure correct testing; refactor #6488
Merged
trilinos-autotester
merged 101 commits into
trilinos:develop
from
mhoemmen:TSQR-Dec2019
Dec 23, 2019
Merged
Changes from all commits
Commits
Show all changes
101 commits
Select commit
Hold shift + click to select a range
05ef854
TSQR: Remove more use of Node from TSQR adapters
66f3cca
TSQR: Remove dead method prepareNodeTsqr
91ae70a
TSQR: Remove dead code from NodeTsqrFactory
47287f9
TSQR::Tsqr: Use NodeTsqr subclasses only thru base class
6da8b0c
TSQR::NodeTsqrFactory no longer refers to node_type
037f650
TSQR: "Factory-ify" NodeTsqr subclass creation
157fe6b
TSQR: Make sure "full" test exercises KokkosNodeTsqr
31b3f35
TSQR: Improve full TSQR test; prevent test failures for now
0071167
TSQR: Improve Combine test; add more test cases
5ba5088
TSQR::Combine: Make methods nonconst
70b27aa
TSQR: Make Combine test exercise both Combine implementations
83a4838
TSQR: Add CombineNodeTsqr
d8752dc
TSQR: Fix Clang build warnings in {KokkosNode,Sequential}Tsqr
517da93
TSQR: In full test, check if R factor is all zeros
c4fe0bd
TSQR::NodeTsqrFactory: Let user specify NodeTsqr type as string
aa92092
TSQR: Add generic NodeTsqr test
bd40849
TSQR: Minor changes to generic NodeTsqr test
d6689cf
TSQR: Make Combine test output consistent with NodeTsqr test
d88d48f
TSQR: Fix saveMatrices option in generic NodeTsqr test
d2688e8
TSQR::CombineNodeTsqr::factor: Fix bug
a83f5d9
TSQR::SequentialTsqr: Minor fix (not affecting tests)
f5dc094
TSQR: Add accuracy bounds to generic NodeTsqr test
3cf037c
TSQR: Use generic NodeTsqr test to test SequentialTsqr
cecc610
TSQR: Remove redundant test files
9bdffe6
TSQR::NodeTsqrFactory: Change default to work around KokkosNodeTsqr
7fa8a66
TSQR::CombineNative: Add type aliases to make code more readable
b42a4d1
TSQR: Purge TbbTsqr; change Combine::apply_pair to take MatView
ea36c1f
TSQR: Purge any leftover TBB- or TbbTsqr-related code
f98fb80
TSQR: Change Combine::apply_inner to take MatView
b1bf6ab
TSQR::SequentialTsqr: Remove dependency on MatView layout
93a5376
TSQR::Combine: Add work_size
1dc3200
TSQR: Use Combine::work_size in all places TSQR uses Combine
5de3733
TSQR::CombineDefault: Use LAPACK lwork query to get workspace size
8a617eb
TSQR::KokkosNodeTsqr: Fix unused variable warning
386dd10
TSQR::NodeTsqrFactory: Fix tests with CUDA build
c7262eb
TSQR::MatView: Make split_top a nonmember function
fff9fb5
TSQR::MatView: Make split_bottom a nonmember function
7937368
TSQR::MatView: Remove unused row_block instance method
a094897
TSQR::Mat{View,trix}: Make empty nonmember; remove op{==,!=}
390355b
TSQR: Make copy_upper_triangle work with MatView, not raw pointers
d1b43a7
TSQR: Remove unused comparison operators
0277a89
TSQR: Add fill_with_identity_columns function
48069b2
TSQR: Remove unused functions (un)pack_R_factor
f6617bc
TSQR: Add CUSOLVER & CUBLAS TPLs; test handle creation
7d7e62f
TSQR: Add interface to CuSolver _GEQRF and _ORMQR / _UNMQR
0c4de16
TSQR: Add interface to CuBlas _GEMM
117b195
TSQR: Add CuBlas, CuSolver, & CudaValue tests
75ea9a7
TSQR: Add CuSolverNodeTsqr to NodeTsqrFactory
92524ed
TSQR: Fix NodeTsqr test to initialize & finalize Kokkos
f829337
TSQR: CuSolverNodeTsqr runs in NodeTsqr test w/out crashing
d4913a0
TSQR::Impl::Lapack: Use extern template instead of macros
a7f72dd
TSQR::Impl::CuSolver: Take info in constructor, not methods
5ae9db3
TSQR: Add lwork versions of compute_QR & compute_explicit_Q
27127fd
TSQR: Add apply_Q_factor_lwork to Impl::Lapack
00ead42
TSQR: Rename unmqr* methods of CuSolver to apply_Q_factor*
7aa668c
TSQR: Add all 3 lwork query methods to Impl::RawQR
ed8c9e3
TSQR: Make CuSolver methods all const, to match RawQR
c903515
TSQR: Make CuSolver inherit from RawQR
706d15c
TSQR: Add wants_device_memory method to RawQR; override in CuSolver
6863ec0
TSQR: Start refactoring test to exercise Impl::CuSolver
9f2fed4
TSQR: Start making Lapack test work with CuSolver
9c144e5
TSQR: Test Impl::CuSolver along with LAPACK; tests pass
7074ea0
TSQR::CuSolverNodeTsqr runs & passes tests
43acd24
TSQR::Tsqr: Start refactoring to work with CuSolverNodeTsqr
87271a6
TSQR::Tsqr: Add comments for things to fix; clean up code a bit
04c9ce2
TSQR: Prepare Tsqr for working with device memory
54f9b7b
TSQR::CuSolverNodeTsqr: Implement NodeTsqr::fill_with_identity_columns
4ea72ff
TSQR: Remove nonmember fill_with_identity_columns function
cad85a4
TSQR: fill_with_identity_columns -> set_diagonal_entries_to_one
dfa8261
TSQR::CuSolverNodeTsqr: Ensure contiguous storage for temp matrices
e322867
TSQR::Tsqr: Full test passes with CuSolverNodeTsqr
606d86a
TSQR::NodeTsqrFactory: Return CuSolverNodeTsqr by default if available
7825917
TSQR: Add more tests
2758f72
TSQR: Start converting NodeTsqr benchmark to permit device memory
99e54e2
TSQR: NodeTsqr benchmark works w/ CuSolverNodeTsqr now
6034d25
TSQR: NodeTsqr benchmark can now test all NodeTsqr subclasses
cb93936
TSQR: Remove unused test header file
b116ba6
TSQR: Add lwork parameter to Combine::apply_first
e1a7ccd
TSQR: Add lwork parameter to Combine::factor_first
32c56c7
TSQR: Add lwork parameter to Combine::{factor,apply}_inner
8d555f2
TSQR: Add lwork parameter to Combine::{factor,apply}_pair
70778c7
TSQR: Remove KokkosNodeTsqr
c6db49b
TSQR::CuSolverNodeTsqr: Fix CUDA build warning
ee8f1d8
TSQR::SequentialTsqr: Remove unnecessary helper functions
0fe2de1
TSQR::CombineNodeTsqr: Refactor a bit in prep for CombineFactory
74f9aec
TSQR: Refactor Combine into abstract base class
2010f7a
TSQR: Remove superfluous test files
b68ae0f
TSQR: Move DistTsqr test code into test directory
4ab6fe1
TSQR::Combine: Make work_size return ordinal_type, not size_t
e5ffed7
TSQR::Impl::Lapack: Attempt to address Intel 17 link errors
b379071
TSQR: Make sure DistTsqr test initializes & finalizes Kokkos
6384388
TSQR::CombineDefault: Fix build warning (unused variable)
57acdc8
TSQR: Add class to simplify MPI & Kokkos init & finalize in tests
f8430af
TSQR: Make Combine test initialize & finalize Kokkos
5c1c90a
TSQR: Clean up Combine test
b765b60
TSQR: Clean up Combine & DistTsqr tests more
ee28545
TSQR: Clean up "full" TSQR test
50530d7
TSQR: Clean up NodeTsqr test
21b6a6a
TSQR: Add debugging code to Test::MpiAndKokkosScope
6923ae4
TSQR: Work around possible Intel 17 bug
842320a
Tpetra: Make TsqrAdaptor use device memory if TSQR wants it
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# @HEADER | ||
# ************************************************************************ | ||
# | ||
# Trilinos: An Object-Oriented Solver Framework | ||
# Copyright (2001) Sandia Corporation | ||
# | ||
# | ||
# Copyright (2001) Sandia Corporation. Under the terms of Contract | ||
# DE-AC04-94AL85000, there is a non-exclusive license for use of this | ||
# work by or on behalf of the U.S. Government. Export of this program | ||
# may require a license from the United States Government. | ||
# | ||
# 1. Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# | ||
# 2. Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# | ||
# 3. Neither the name of the Corporation nor the names of the | ||
# contributors may be used to endorse or promote products derived from | ||
# this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY | ||
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE | ||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
# NOTICE: The United States Government is granted for itself and others | ||
# acting on its behalf a paid-up, nonexclusive, irrevocable worldwide | ||
# license in this data to reproduce, prepare derivative works, and | ||
# perform publicly and display publicly. Beginning five (5) years from | ||
# July 25, 2001, the United States Government is granted for itself and | ||
# others acting on its behalf a paid-up, nonexclusive, irrevocable | ||
# worldwide license in this data to reproduce, prepare derivative works, | ||
# distribute copies to the public, perform publicly and display | ||
# publicly, and to permit others to do so. | ||
# | ||
# NEITHER THE UNITED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT | ||
# OF ENERGY, NOR SANDIA CORPORATION, NOR ANY OF THEIR EMPLOYEES, MAKES | ||
# ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR | ||
# RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY | ||
# INFORMATION, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS | ||
# THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS. | ||
# | ||
# ************************************************************************ | ||
# @HEADER | ||
|
||
IF (NOT TPL_ENABLE_CUDA) | ||
MESSAGE(FATAL_ERROR "\nCUBLAS: This TPL requires CUDA") | ||
ELSE() | ||
find_library(CUDA_cublas_LIBRARY | ||
cublas | ||
HINTS ${CUDA_TOOLKIT_ROOT_DIR}/lib | ||
) | ||
IF(CUDA_cublas_LIBRARY STREQUAL "CUDA_cublas_LIBRARY-NOTFOUND") | ||
MESSAGE(FATAL_ERROR "\nCUBLAS: could not find cublas library.") | ||
ENDIF() | ||
GLOBAL_SET(TPL_CUBLAS_LIBRARY_DIRS) | ||
GLOBAL_SET(TPL_CUBLAS_INCLUDE_DIRS ${TPL_CUDA_INCLUDE_DIRS}) | ||
GLOBAL_SET(TPL_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY}) | ||
ENDIF() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# @HEADER | ||
# ************************************************************************ | ||
# | ||
# Trilinos: An Object-Oriented Solver Framework | ||
# Copyright (2001) Sandia Corporation | ||
# | ||
# | ||
# Copyright (2001) Sandia Corporation. Under the terms of Contract | ||
# DE-AC04-94AL85000, there is a non-exclusive license for use of this | ||
# work by or on behalf of the U.S. Government. Export of this program | ||
# may require a license from the United States Government. | ||
# | ||
# 1. Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# | ||
# 2. Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# | ||
# 3. Neither the name of the Corporation nor the names of the | ||
# contributors may be used to endorse or promote products derived from | ||
# this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY | ||
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE | ||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
# NOTICE: The United States Government is granted for itself and others | ||
# acting on its behalf a paid-up, nonexclusive, irrevocable worldwide | ||
# license in this data to reproduce, prepare derivative works, and | ||
# perform publicly and display publicly. Beginning five (5) years from | ||
# July 25, 2001, the United States Government is granted for itself and | ||
# others acting on its behalf a paid-up, nonexclusive, irrevocable | ||
# worldwide license in this data to reproduce, prepare derivative works, | ||
# distribute copies to the public, perform publicly and display | ||
# publicly, and to permit others to do so. | ||
# | ||
# NEITHER THE UNITED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT | ||
# OF ENERGY, NOR SANDIA CORPORATION, NOR ANY OF THEIR EMPLOYEES, MAKES | ||
# ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR | ||
# RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY | ||
# INFORMATION, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS | ||
# THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS. | ||
# | ||
# ************************************************************************ | ||
# @HEADER | ||
|
||
IF (NOT TPL_ENABLE_CUDA) | ||
MESSAGE(FATAL_ERROR "\nCUSOLVER: This TPL requires CUDA") | ||
ELSE() | ||
find_library(CUDA_cusolver_LIBRARY | ||
cusolver | ||
HINTS ${CUDA_TOOLKIT_ROOT_DIR}/lib | ||
) | ||
IF(CUDA_cusolver_LIBRARY STREQUAL "CUDA_cusolver_LIBRARY-NOTFOUND") | ||
MESSAGE(FATAL_ERROR "\nCUSOLVER: could not find cusolver library.") | ||
ENDIF() | ||
GLOBAL_SET(TPL_CUSOLVER_LIBRARY_DIRS) | ||
GLOBAL_SET(TPL_CUSOLVER_INCLUDE_DIRS ${TPL_CUDA_INCLUDE_DIRS}) | ||
GLOBAL_SET(TPL_CUSOLVER_LIBRARIES ${CUDA_cusolver_LIBRARY}) | ||
ENDIF() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,6 @@ | |
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
// Questions? Contact Michael A. Heroux ([email protected]) | ||
// | ||
// ************************************************************************ | ||
// @HEADER | ||
|
||
|
@@ -48,18 +46,18 @@ | |
|
||
#include "Stokhos_Sacado_Kokkos_UQ_PCE.hpp" | ||
|
||
# include <Tsqr_NodeTsqrFactory.hpp> // create intranode TSQR object | ||
# include <Tsqr.hpp> // full (internode + intranode) TSQR | ||
# include <Tsqr_DistTsqr.hpp> // internode TSQR | ||
# include "Tsqr_NodeTsqrFactory.hpp" // create intranode TSQR object | ||
# include "Tsqr.hpp" // full (internode + intranode) TSQR | ||
# include "Tsqr_DistTsqr.hpp" // internode TSQR | ||
// Subclass of TSQR::MessengerBase, implemented using Teuchos | ||
// communicator template helper functions | ||
# include <Tsqr_TeuchosMessenger.hpp> | ||
# include <Tpetra_MultiVector.hpp> | ||
# include <Teuchos_ParameterListAcceptorDefaultBase.hpp> | ||
# include "Tsqr_TeuchosMessenger.hpp" | ||
# include "Tpetra_MultiVector.hpp" | ||
# include "Teuchos_ParameterListAcceptorDefaultBase.hpp" | ||
# include <stdexcept> | ||
|
||
// Base TsqrAdator template we will specialize | ||
# include <Tpetra_TsqrAdaptor.hpp> | ||
# include "Tpetra_TsqrAdaptor.hpp" | ||
|
||
namespace Tpetra { | ||
|
||
|
@@ -81,16 +79,16 @@ namespace Tpetra { | |
typedef typename mp_scalar_type::scalar_type scalar_type; | ||
typedef typename mp_scalar_type::ordinal_type mp_ordinal_type; | ||
typedef typename MV::local_ordinal_type ordinal_type; | ||
typedef typename MV::node_type node_type; | ||
typedef Teuchos::SerialDenseMatrix<ordinal_type, scalar_type> dense_matrix_type; | ||
typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType magnitude_type; | ||
|
||
private: | ||
//typedef TSQR::MatView<ordinal_type, scalar_type> matview_type; | ||
typedef TSQR::NodeTsqrFactory<node_type, scalar_type, ordinal_type> node_tsqr_factory_type; | ||
typedef typename node_tsqr_factory_type::node_tsqr_type node_tsqr_type; | ||
typedef TSQR::DistTsqr<ordinal_type, scalar_type> dist_tsqr_type; | ||
typedef TSQR::Tsqr<ordinal_type, scalar_type, node_tsqr_type> tsqr_type; | ||
using node_tsqr_factory_type = | ||
TSQR::NodeTsqrFactory<scalar_type, ordinal_type, | ||
typename MV::device_type>; | ||
using node_tsqr_type = TSQR::NodeTsqr<ordinal_type, scalar_type>; | ||
using dist_tsqr_type = TSQR::DistTsqr<ordinal_type, scalar_type>; | ||
using tsqr_type = TSQR::Tsqr<ordinal_type, scalar_type>; | ||
|
||
public: | ||
/// \brief Constructor (that accepts a parameter list). | ||
|
@@ -100,7 +98,7 @@ namespace Tpetra { | |
/// implementation. For details, call \c getValidParameters() | ||
/// and examine the documentation embedded therein. | ||
TsqrAdaptor (const Teuchos::RCP<Teuchos::ParameterList>& plist) : | ||
nodeTsqr_ (new node_tsqr_type), | ||
nodeTsqr_ (node_tsqr_factory_type::getNodeTsqr ()), | ||
distTsqr_ (new dist_tsqr_type), | ||
tsqr_ (new tsqr_type (nodeTsqr_, distTsqr_)), | ||
ready_ (false) | ||
|
@@ -110,7 +108,7 @@ namespace Tpetra { | |
|
||
//! Constructor (that uses default parameters). | ||
TsqrAdaptor () : | ||
nodeTsqr_ (new node_tsqr_type), | ||
nodeTsqr_ (new node_tsqr_factory_type::getNodeTsqr ()), | ||
distTsqr_ (new dist_tsqr_type), | ||
tsqr_ (new tsqr_type (nodeTsqr_, distTsqr_)), | ||
ready_ (false) | ||
|
@@ -289,20 +287,10 @@ namespace Tpetra { | |
{ | ||
if (! ready_) { | ||
prepareDistTsqr (mv); | ||
prepareNodeTsqr (mv); | ||
ready_ = true; | ||
} | ||
} | ||
|
||
/// \brief Finish intraprocess TSQR initialization. | ||
/// | ||
/// \note It's OK to call this method more than once; it is idempotent. | ||
void | ||
prepareNodeTsqr (const MV& mv) | ||
{ | ||
node_tsqr_factory_type::prepareNodeTsqr (nodeTsqr_); | ||
} | ||
|
||
/// \brief Finish interprocess TSQR initialization. | ||
/// | ||
/// \param mv [in] A valid Tpetra::MultiVector instance whose | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,6 @@ | |
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
// Questions? Contact Michael A. Heroux ([email protected]) | ||
// | ||
// ************************************************************************ | ||
// @HEADER | ||
|
||
|
@@ -48,18 +46,18 @@ | |
|
||
#include "Stokhos_Sacado_Kokkos_MP_Vector.hpp" | ||
|
||
# include <Tsqr_NodeTsqrFactory.hpp> // create intranode TSQR object | ||
# include <Tsqr.hpp> // full (internode + intranode) TSQR | ||
# include <Tsqr_DistTsqr.hpp> // internode TSQR | ||
# include "Tsqr_NodeTsqrFactory.hpp" // create intranode TSQR object | ||
# include "Tsqr.hpp" // full (internode + intranode) TSQR | ||
# include "Tsqr_DistTsqr.hpp" // internode TSQR | ||
// Subclass of TSQR::MessengerBase, implemented using Teuchos | ||
// communicator template helper functions | ||
# include <Tsqr_TeuchosMessenger.hpp> | ||
# include <Tpetra_MultiVector.hpp> | ||
# include <Teuchos_ParameterListAcceptorDefaultBase.hpp> | ||
# include "Tsqr_TeuchosMessenger.hpp" | ||
# include "Tpetra_MultiVector.hpp" | ||
# include "Teuchos_ParameterListAcceptorDefaultBase.hpp" | ||
# include <stdexcept> | ||
|
||
// Base TsqrAdator template we will specialize | ||
# include <Tpetra_TsqrAdaptor.hpp> | ||
# include "Tpetra_TsqrAdaptor.hpp" | ||
|
||
namespace Tpetra { | ||
|
||
|
@@ -81,16 +79,16 @@ namespace Tpetra { | |
typedef typename mp_scalar_type::scalar_type scalar_type; | ||
typedef typename mp_scalar_type::ordinal_type mp_ordinal_type; | ||
typedef typename MV::local_ordinal_type ordinal_type; | ||
typedef typename MV::node_type node_type; | ||
typedef Teuchos::SerialDenseMatrix<ordinal_type, scalar_type> dense_matrix_type; | ||
typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType magnitude_type; | ||
|
||
private: | ||
//typedef TSQR::MatView<ordinal_type, scalar_type> matview_type; | ||
typedef TSQR::NodeTsqrFactory<node_type, scalar_type, ordinal_type> node_tsqr_factory_type; | ||
typedef typename node_tsqr_factory_type::node_tsqr_type node_tsqr_type; | ||
typedef TSQR::DistTsqr<ordinal_type, scalar_type> dist_tsqr_type; | ||
typedef TSQR::Tsqr<ordinal_type, scalar_type, node_tsqr_type> tsqr_type; | ||
using node_tsqr_factory_type = | ||
TSQR::NodeTsqrFactory<scalar_type, ordinal_type, | ||
typename MV::device_type>; | ||
using node_tsqr_type = TSQR::NodeTsqr<ordinal_type, scalar_type>; | ||
using dist_tsqr_type = TSQR::DistTsqr<ordinal_type, scalar_type>; | ||
using tsqr_type = TSQR::Tsqr<ordinal_type, scalar_type>; | ||
|
||
public: | ||
/// \brief Constructor (that accepts a parameter list). | ||
|
@@ -100,7 +98,7 @@ namespace Tpetra { | |
/// implementation. For details, call \c getValidParameters() | ||
/// and examine the documentation embedded therein. | ||
TsqrAdaptor (const Teuchos::RCP<Teuchos::ParameterList>& plist) : | ||
nodeTsqr_ (new node_tsqr_type), | ||
nodeTsqr_ (node_tsqr_factory_type::getNodeTsqr ()), | ||
distTsqr_ (new dist_tsqr_type), | ||
tsqr_ (new tsqr_type (nodeTsqr_, distTsqr_)), | ||
ready_ (false) | ||
|
@@ -110,7 +108,7 @@ namespace Tpetra { | |
|
||
//! Constructor (that uses default parameters). | ||
TsqrAdaptor () : | ||
nodeTsqr_ (new node_tsqr_type), | ||
nodeTsqr_ (node_tsqr_factory_type::getNodeTsqr ()), | ||
distTsqr_ (new dist_tsqr_type), | ||
tsqr_ (new tsqr_type (nodeTsqr_, distTsqr_)), | ||
ready_ (false) | ||
|
@@ -289,20 +287,10 @@ namespace Tpetra { | |
{ | ||
if (! ready_) { | ||
prepareDistTsqr (mv); | ||
prepareNodeTsqr (mv); | ||
ready_ = true; | ||
} | ||
} | ||
|
||
/// \brief Finish intraprocess TSQR initialization. | ||
/// | ||
/// \note It's OK to call this method more than once; it is idempotent. | ||
void | ||
prepareNodeTsqr (const MV& mv) | ||
{ | ||
node_tsqr_factory_type::prepareNodeTsqr (nodeTsqr_); | ||
} | ||
|
||
/// \brief Finish interprocess TSQR initialization. | ||
/// | ||
/// \param mv [in] A valid Tpetra::MultiVector instance whose | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm adding new TPLs. On the other hand, these are trivial to enable when CUDA is enabled: just set
TPL_ENABLE_CUBLAS=ON
etc. I will work on automating that.