Skip to content

Commit

Permalink
Merge pull request #292 from sethrj/trilinos-14
Browse files Browse the repository at this point in the history
Update to Trilinos 14
  • Loading branch information
sethrj committed Aug 17, 2023
2 parents 3ae3c2c + c6f7678 commit 7c21955
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 30 deletions.
1 change: 1 addition & 0 deletions .jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pipeline {
filename "Dockerfile"
dir "docker"
args '-v /tmp/ccache:/tmp/ccache'
additionalBuildArgs '--build-arg NPROC=4'
label 'docker'
}
}
Expand Down
7 changes: 1 addition & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
#-----------------------------------------------------------------------------#

set(Kokkos_FIND_QUIETLY ON)
find_package(Trilinos 13.0 REQUIRED MODULE
find_package(Trilinos 14 REQUIRED MODULE
COMPONENTS
TeuchosCore TeuchosComm TeuchosNumerics TeuchosParameterList
OPTIONAL_COMPONENTS
Expand All @@ -99,11 +99,6 @@ find_package(Trilinos 13.0 REQUIRED MODULE
Amesos2 Ifpack2 MueLu
)

set(Trilinos_COMPONENTS ${COMPONENTS_LIST})
if("MPI" IN_LIST Trilinos_TPL_LIST)
set(Trilinos_USE_MPI ON)
endif()

set(ForTrilinos_USE_MPI "${Trilinos_USE_MPI}" CACHE BOOL
"MPI status depends on the Trilinos installation in use" FORCE)

Expand Down
17 changes: 16 additions & 1 deletion cmake/FindTrilinos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,24 @@ if(Trilinos_Tpetra_FOUND AND PROJECT_NAME STREQUAL "ForTrilinos")
endif()
endif()

if(Trilinos_FOUND)
set(Trilinos_COMPONENTS ${COMPONENTS_LIST})
set(Trilinos_USE_MPI OFF)
if(Trilinos_VERSION VERSION_GREATER_EQUAL 14.0)
# Trilinos_TPL_LIST no longer gets exported :(
if(Teuchos_MPI_EXEC)
set(Trilinos_USE_MPI ON)
endif()
else()
if("MPI" IN_LIST Trilinos_TPL_LIST)
set(Trilinos_USE_MPI ON)
endif()
endif()
endif()

find_package_handle_standard_args(
Trilinos HANDLE_COMPONENTS
REQUIRED_VARS Trilinos_INCLUDE_DIRS Trilinos_LIBRARY_DIRS Trilinos_LIBRARIES
REQUIRED_VARS Trilinos_INCLUDE_DIRS Trilinos_LIBRARIES
${_require_tpetra_inst}
VERSION_VAR Trilinos_VERSION
)
Expand Down
1 change: 1 addition & 0 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ in the committed version of the generated wrappers.
=========== ============== ======================
ForTrilinos Trilinos SWIG
=========== ============== ======================
2.3.0 14.0 4.1.1+fortran
2.2.0 13.4 4.1.1+fortran
2.1.0 13.2 4.1.0-dev1+fortran
2.0.1 13.0:13.2 4.1.0-dev1+fortran
Expand Down
12 changes: 6 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ENV PATH=${CMAKE_DIR}/bin:$PATH

# Install Trilinos
ENV TRILINOS_DIR=/opt/trilinos
RUN TRILINOS_VERSION=13-4-1 && \
RUN TRILINOS_VERSION=14-0-0 && \
TRILINOS_URL=https://github.com/trilinos/Trilinos/archive/refs/tags/trilinos-release-${TRILINOS_VERSION}.tar.gz && \
TRILINOS_ARCHIVE=trilinos-${TRILINOS_VERSION}.tar.gz && \
SCRATCH_DIR=/scratch && mkdir -p ${SCRATCH_DIR} && cd ${SCRATCH_DIR} && \
Expand Down Expand Up @@ -83,11 +83,11 @@ RUN TRILINOS_VERSION=13-4-1 && \
-D Trilinos_ENABLE_Epetra=OFF \
-D Trilinos_ENABLE_Ifpack2=ON \
-D Trilinos_ENABLE_Kokkos=ON \
-D Kokkos_ENABLE_Serial=ON \
-D Kokkos_ENABLE_OpenMP=OFF \
-D Kokkos_ENABLE_Cuda=OFF \
-D Kokkos_ENABLE_Cuda_UVM=ON \
-D Kokkos_ENABLE_Cuda_Lambda=ON \
-D Kokkos_ENABLE_SERIAL=ON \
-D Kokkos_ENABLE_OPENMP=OFF \
-D Kokkos_ENABLE_CUDA=OFF \
-D Kokkos_ENABLE_CUDA_UVM=ON \
-D Kokkos_ENABLE_CUDA_LAMBDA=ON \
-D Kokkos_ARCH_VOLTA70=ON \
-D Trilinos_ENABLE_MueLu=ON \
-D Trilinos_ENABLE_NOX=ON \
Expand Down
2 changes: 1 addition & 1 deletion src/fortpetra/ForTrilinos_DefaultNodeType.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef FORTRILINOS_DEFAULTNODETYPE_HPP
#define FORTRILINOS_DEFAULTNODETYPE_HPP

#include <KokkosClassic_DefaultNode_config.h>
#include <KokkosCompat_DefaultNode.hpp>

namespace ForTrilinos {
typedef typename TPETRA_DEFAULTNODE DefaultNodeType;
Expand Down
1 change: 0 additions & 1 deletion src/fortpetra/fortpetra.i
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ struct DefaultNodeType {
}

%{
#include <Kokkos_DefaultNode.hpp>
#include "fortpetra/ForTrilinos_DefaultNodeType.hpp"
%}
%inline %{
Expand Down
14 changes: 6 additions & 8 deletions src/fortpetra/generated/fortpetra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ module fortpetra
public :: mag_type
public :: norm_type

integer(C_INT), parameter, public :: TPETRA_THROWS_EFFICIENCY_WARNINGS = 0_C_INT
integer(C_INT), parameter, public :: TPETRA_PRINTS_EFFICIENCY_WARNINGS = 0_C_INT
integer(C_INT), parameter, public :: TPETRA_THROWS_ABUSE_WARNINGS = 0_C_INT
integer(C_INT), parameter, public :: TPETRA_PRINTS_ABUSE_WARNINGS = 0_C_INT
Expand Down Expand Up @@ -75,7 +74,6 @@ module fortpetra
end enum
integer, parameter, public :: TpetraESweepDirection = kind(TpetraForward)
public :: TpetraForward, TpetraBackward, TpetraSymmetric
integer(C_INT), parameter, public :: TPETRA_USE_KOKKOS_DISTOBJECT = 0_C_INT
! enum Tpetra::CombineMode
enum, bind(c)
enumerator :: TpetraADD
Expand Down Expand Up @@ -407,7 +405,7 @@ module fortpetra
procedure, private :: swigf_TpetraCrsMatrix_sumIntoLocalValues__SWIG_2
procedure :: setAllToScalar => swigf_TpetraCrsMatrix_setAllToScalar
procedure :: scale => swigf_TpetraCrsMatrix_scale
procedure, private :: swigf_TpetraCrsMatrix_setAllValues__SWIG_1
procedure, private :: swigf_TpetraCrsMatrix_setAllValues__SWIG_2
procedure :: globalAssemble => swigf_TpetraCrsMatrix_globalAssemble
procedure, private :: swigf_TpetraCrsMatrix_resumeFill__SWIG_0
procedure, private :: swigf_TpetraCrsMatrix_resumeFill__SWIG_1
Expand Down Expand Up @@ -473,7 +471,7 @@ module fortpetra
procedure, private :: swigf_TpetraCrsMatrix_getGlobalRowCopy__SWIG_1
procedure, private :: swigf_TpetraCrsMatrix_getLocalRowCopy__SWIG_1
procedure, private :: swigf_TpetraCrsMatrix_op_assign__
generic :: setAllValues => swigf_TpetraCrsMatrix_setAllValues__SWIG_1
generic :: setAllValues => swigf_TpetraCrsMatrix_setAllValues__SWIG_2
generic :: replaceLocalValues => swigf_TpetraCrsMatrix_replaceLocalValues__SWIG_1
generic :: localApply => swigf_TpetraCrsMatrix_localApply__SWIG_0, swigf_TpetraCrsMatrix_localApply__SWIG_1, &
swigf_TpetraCrsMatrix_localApply__SWIG_2, swigf_TpetraCrsMatrix_localApply__SWIG_3
Expand Down Expand Up @@ -3100,8 +3098,8 @@ subroutine swigc_TpetraCrsMatrix_scale(farg1, farg2) &
real(C_DOUBLE), intent(in) :: farg2
end subroutine

subroutine swigc_TpetraCrsMatrix_setAllValues__SWIG_1(farg1, farg2, farg3, farg4) &
bind(C, name="_wrap_TpetraCrsMatrix_setAllValues__SWIG_1")
subroutine swigc_TpetraCrsMatrix_setAllValues__SWIG_2(farg1, farg2, farg3, farg4) &
bind(C, name="_wrap_TpetraCrsMatrix_setAllValues__SWIG_2")
use, intrinsic :: ISO_C_BINDING
import :: swigarraywrapper
import :: swigclasswrapper
Expand Down Expand Up @@ -8308,7 +8306,7 @@ subroutine swigf_TpetraCrsMatrix_scale(self, alpha)
call swigc_TpetraCrsMatrix_scale(farg1, farg2)
end subroutine

subroutine swigf_TpetraCrsMatrix_setAllValues__SWIG_1(self, ptr, ind, val)
subroutine swigf_TpetraCrsMatrix_setAllValues__SWIG_2(self, ptr, ind, val)
use, intrinsic :: ISO_C_BINDING
class(TpetraCrsMatrix), intent(in) :: self
integer(C_SIZE_T), dimension(:), target :: ptr
Expand All @@ -8323,7 +8321,7 @@ subroutine swigf_TpetraCrsMatrix_setAllValues__SWIG_1(self, ptr, ind, val)
call SWIGTM_fin_size_t_Sb__SB_(ptr, farg2)
call SWIGTM_fin_int_Sb__SB_(ind, farg3)
call SWIGTM_fin_double_Sb__SB_(val, farg4)
call swigc_TpetraCrsMatrix_setAllValues__SWIG_1(farg1, farg2, farg3, farg4)
call swigc_TpetraCrsMatrix_setAllValues__SWIG_2(farg1, farg2, farg3, farg4)
end subroutine

subroutine swigf_TpetraCrsMatrix_globalAssemble(self)
Expand Down
3 changes: 1 addition & 2 deletions src/fortpetra/generated/fortpetraFORTRAN_wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ template <typename T> T SwigValueInit() {
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))


#include <Kokkos_DefaultNode.hpp>
#include "fortpetra/ForTrilinos_DefaultNodeType.hpp"


Expand Down Expand Up @@ -10288,7 +10287,7 @@ SWIGEXPORT void _wrap_TpetraCrsMatrix_scale(SwigClassWrapper *farg1, double cons
}


SWIGEXPORT void _wrap_TpetraCrsMatrix_setAllValues__SWIG_1(SwigClassWrapper *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
SWIGEXPORT void _wrap_TpetraCrsMatrix_setAllValues__SWIG_2(SwigClassWrapper *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::ArrayRCP< size_t > *arg2 = 0 ;
Teuchos::ArrayRCP< int > *arg3 = 0 ;
Expand Down
1 change: 0 additions & 1 deletion src/fortrilinos_hl/eigen_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include <utility>

#include <Kokkos_DefaultNode.hpp>
#include "fortpetra/ForTrilinos_DefaultNodeType.hpp"

#include <Teuchos_Comm.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/fortrilinos_hl/fortrilinos_hl.i
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
%import "fortpetra/fortpetra.i"

%{
#include <Kokkos_DefaultNode.hpp>
#include <KokkosClassic_DefaultNode_config.h>
#include "fortpetra/ForTrilinos_DefaultNodeType.hpp"
%}
%inline %{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ template <typename T> T SwigValueInit() {
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))


#include <Kokkos_DefaultNode.hpp>
#include <KokkosClassic_DefaultNode_config.h>
#include "fortpetra/ForTrilinos_DefaultNodeType.hpp"


Expand Down
2 changes: 1 addition & 1 deletion src/fortrilinos_hl/solver_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ TrilinosSolver::TrilinosSolver(const Teuchos::RCP<const Teuchos::Comm<int>>& com
}
#endif
#if FORTRILINOS_USE_MUELU
Stratimikos::enableMueLu<LO,GO,NO>(linearSolverBuilder);
Stratimikos::enableMueLu<SC,LO,GO,NO>(linearSolverBuilder);
#endif

linearSolverBuilder.setParameterList(paramList);
Expand Down
1 change: 0 additions & 1 deletion src/fortrilinos_hl/solver_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "ForTrilinos_config.h"

#include <Kokkos_DefaultNode.hpp>
#include "fortpetra/ForTrilinos_DefaultNodeType.hpp"

#include <Teuchos_Comm.hpp>
Expand Down

0 comments on commit 7c21955

Please sign in to comment.