Skip to content

Commit 252bdb3

Browse files
committed
Add Tpetra-based Trilinos interface. Refactor LAI vector unit tests.
1 parent 5adb70a commit 252bdb3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3842
-1109
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: minimal
22

33
env:
44
global:
5-
- GEOSX_TPL_TAG=119-434
5+
- GEOSX_TPL_TAG=120-438
66

77
# The integrated test repository contains large data (using git lfs) and we do not use them here.
88
# To save time (and money) we do not let travis automatically clone all our (lfs) subrepositories and do it by hand.

src/cmake/GeosxOptions.cmake

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,22 @@ option( ENABLE_PETSC "Enables PETSC" OFF )
4949

5050
### LAI SETUP ###
5151

52-
set( supported_LAI Trilinos Hypre Petsc )
52+
set( supported_LAI Trilinos TrilinosTpetra Hypre Petsc )
5353
set( GEOSX_LA_INTERFACE "Trilinos" CACHE STRING "Linear algebra interface to use in solvers" )
54-
message( STATUS "GEOSX_LA_INTERFACE = ${GEOSX_LA_INTERFACE}" )
54+
message( "GEOSX_LA_INTERFACE = ${GEOSX_LA_INTERFACE}" )
5555

5656
if( NOT ( GEOSX_LA_INTERFACE IN_LIST supported_LAI ) )
5757
message( FATAL_ERROR "GEOSX_LA_INTERFACE must be one of: ${supported_LAI}" )
5858
endif()
5959

6060
string( TOUPPER "${GEOSX_LA_INTERFACE}" upper_LAI )
61-
if( NOT ENABLE_${upper_LAI} )
62-
message( FATAL_ERROR "${GEOSX_LA_INTERFACE} LA interface is selected, but ENABLE_${upper_LAI} is OFF" )
63-
endif()
6461
option( GEOSX_LA_INTERFACE_${upper_LAI} "${upper_LAI} LA interface is selected" ON )
6562

63+
string( REPLACE "TPETRA" "" dep_LAI "${upper_LAI}" )
64+
if( NOT ENABLE_${dep_LAI} )
65+
message( FATAL_ERROR "${GEOSX_LA_INTERFACE} LA interface is selected, but ENABLE_${dep_LAI} is OFF" )
66+
endif()
67+
6668
### MPI/OMP/CUDA SETUP ###
6769

6870
option( ENABLE_MPI "" ON )

src/coreComponents/LvArray

src/coreComponents/common/GeosxConfig.hpp.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
#cmakedefine GEOSX_LA_INTERFACE @GEOSX_LA_INTERFACE@
7070
/// Macro defined when Trilinos interface is selected
7171
#cmakedefine GEOSX_LA_INTERFACE_TRILINOS
72+
/// Macro defined when Trilinos interface is selected
73+
#cmakedefine GEOSX_LA_INTERFACE_TRILINOSTPETRA
7274
/// Macro defined when Hypre interface is selected
7375
#cmakedefine GEOSX_LA_INTERFACE_HYPRE
7476
/// Macro defined when PETSc interface is selected

src/coreComponents/finiteVolume/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ set( finiteVolume_sources
2626
)
2727

2828
if ( BUILD_OBJ_LIBS )
29-
set( dependencyList dataRepository codingUtilities managers)
29+
set( dependencyList dataRepository codingUtilities managers )
3030
else()
31-
set( dependencyList common)
31+
set( dependencyList common managers )
3232
endif()
3333

3434
if ( ENABLE_OPENMP )

src/coreComponents/linearAlgebra/CMakeLists.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,27 @@ if( ENABLE_TRILINOS )
6363
interfaces/trilinos/EpetraMatrix.hpp
6464
interfaces/trilinos/EpetraVector.hpp
6565
interfaces/trilinos/EpetraUtils.hpp
66+
interfaces/trilinos/TpetraMatrix.hpp
67+
interfaces/trilinos/TpetraVector.hpp
68+
interfaces/trilinos/TpetraUtils.hpp
6669
interfaces/trilinos/TrilinosPreconditioner.hpp
70+
interfaces/trilinos/TrilinosTpetraPreconditioner.hpp
6771
interfaces/trilinos/TrilinosSolver.hpp
68-
interfaces/trilinos/TrilinosInterface.hpp )
72+
interfaces/trilinos/TrilinosTpetraSolver.hpp
73+
interfaces/trilinos/TrilinosInterface.hpp
74+
interfaces/trilinos/TrilinosTpetraInterface.hpp )
6975

7076
list( APPEND linearAlgebra_sources
7177
interfaces/trilinos/EpetraMatrix.cpp
7278
interfaces/trilinos/EpetraVector.cpp
79+
interfaces/trilinos/TpetraMatrix.cpp
80+
interfaces/trilinos/TpetraVector.cpp
7381
interfaces/trilinos/TrilinosPreconditioner.cpp
82+
interfaces/trilinos/TrilinosTpetraPreconditioner.cpp
7483
interfaces/trilinos/TrilinosSolver.cpp
75-
interfaces/trilinos/TrilinosInterface.cpp )
84+
interfaces/trilinos/TrilinosTpetraSolver.cpp
85+
interfaces/trilinos/TrilinosInterface.cpp
86+
interfaces/trilinos/TrilinosTpetraInterface.cpp )
7687

7788
list( APPEND dependencyList trilinos )
7889

src/coreComponents/linearAlgebra/DofManager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,6 +1983,7 @@ void DofManager::printFieldInfo( std::ostream & os ) const
19831983

19841984
#ifdef GEOSX_USE_TRILINOS
19851985
MAKE_DOFMANAGER_METHOD_INST( TrilinosInterface )
1986+
MAKE_DOFMANAGER_METHOD_INST( TrilinosTpetraInterface )
19861987
#endif
19871988

19881989
#ifdef GEOSX_USE_HYPRE

src/coreComponents/linearAlgebra/interfaces/InterfaceTypes.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#ifdef GEOSX_USE_TRILINOS
2525
#include "linearAlgebra/interfaces/trilinos/TrilinosInterface.hpp"
26+
#include "linearAlgebra/interfaces/trilinos/TrilinosTpetraInterface.hpp"
2627
#endif
2728

2829
#ifdef GEOSX_USE_HYPRE
@@ -62,6 +63,7 @@ inline void setupLAI( int & argc, char * * & argv )
6263
{
6364
#ifdef GEOSX_USE_TRILINOS
6465
TrilinosInterface::initialize( argc, argv );
66+
TrilinosTpetraInterface::initialize( argc, argv );
6567
#endif
6668
#ifdef GEOSX_USE_HYPRE
6769
HypreInterface::initialize( argc, argv );
@@ -78,6 +80,7 @@ inline void finalizeLAI()
7880
{
7981
#ifdef GEOSX_USE_TRILINOS
8082
TrilinosInterface::finalize();
83+
TrilinosTpetraInterface::finalize();
8184
#endif
8285
#ifdef GEOSX_USE_HYPRE
8386
HypreInterface::finalize();

src/coreComponents/linearAlgebra/interfaces/MatrixBase.hpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -438,36 +438,6 @@ class MatrixBase : public virtual LinearOperator< VECTOR >
438438
arraySlice1d< globalIndex const > const & colIndices,
439439
arraySlice2d< real64 const, MatrixLayout::ROW_MAJOR > const & values ) = 0;
440440

441-
/**
442-
* @brief Add a dense block of values.
443-
* @param rowIndices Global row indices
444-
* @param colIndices Global col indices
445-
* @param values Dense local matrix of values
446-
*/
447-
virtual void add( arraySlice1d< globalIndex const > const & rowIndices,
448-
arraySlice1d< globalIndex const > const & colIndices,
449-
arraySlice2d< real64 const, MatrixLayout::COL_MAJOR > const & values ) = 0;
450-
451-
/**
452-
* @brief Set a dense block of values.
453-
* @param rowIndices Global row indices
454-
* @param colIndices Global col indices
455-
* @param values Dense local matrix of values
456-
*/
457-
virtual void set( arraySlice1d< globalIndex const > const & rowIndices,
458-
arraySlice1d< globalIndex const > const & colIndices,
459-
arraySlice2d< real64 const, MatrixLayout::COL_MAJOR > const & values ) = 0;
460-
461-
/**
462-
* @brief Insert a dense block of values.
463-
* @param rowIndices Global row indices
464-
* @param colIndices Global col indices
465-
* @param values Dense local matrix of values
466-
*/
467-
virtual void insert( arraySlice1d< globalIndex const > const & rowIndices,
468-
arraySlice1d< globalIndex const > const & colIndices,
469-
arraySlice2d< real64 const, MatrixLayout::COL_MAJOR > const & values ) = 0;
470-
471441
/**
472442
* @brief Add a dense block of values.
473443
* @param rowIndices Global row indices

src/coreComponents/linearAlgebra/interfaces/VectorBase.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class VectorBase
149149
* @param localValues local data to put into vector
150150
* @param comm MPI communicator to use
151151
*/
152-
virtual void create( arrayView1d< real64 const > const & localValues, MPI_Comm const & comm ) = 0;
152+
virtual void createWithLocalValues( arrayView1d< real64 > const & localValues, MPI_Comm const & comm ) = 0;
153153

154154
///@}
155155

@@ -414,6 +414,7 @@ class VectorBase
414414
*/
415415
virtual void extract( arrayView1d< real64 > const & localVector ) const
416416
{
417+
GEOSX_LAI_ASSERT_EQ( localSize(), localVector.size() );
417418
real64 const * const data = extractLocalVector();
418419
forAll< parallelHostPolicy >( localSize(), [=] ( localIndex const k )
419420
{

0 commit comments

Comments
 (0)