Skip to content

Commit

Permalink
Merge pull request #281 from sethrj/trilinos-13
Browse files Browse the repository at this point in the history
Update wrappers for Trilinos v13.0
  • Loading branch information
sethrj committed Sep 19, 2020
2 parents 3f5ff6d + a98189c commit 74ec43a
Show file tree
Hide file tree
Showing 9 changed files with 179 additions and 154 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
# Derive options from Trilinos configuration where possible.
#-----------------------------------------------------------------------------#

find_package(Trilinos 12.17 REQUIRED MODULE
set(Kokkos_FIND_QUIETLY ON)
find_package(Trilinos 13.0 REQUIRED MODULE
COMPONENTS
TeuchosCore TeuchosComm TeuchosNumerics TeuchosParameterList
OPTIONAL_COMPONENTS
Expand Down Expand Up @@ -146,7 +147,7 @@ else()
endif()

if(ForTrilinos_USE_SWIG_Fortran)
find_package(SWIG REQUIRED COMPONENTS fortran)
find_package(SWIG 4.0.2 REQUIRED COMPONENTS fortran)
include(UseSWIG)

if(NOT ForTrilinos_USE_MPI)
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ ForTrilinos

This is the new effort to provide Fortran interfaces to Trilinos through
automatic code generation using SWIG. The previous effort (ca. 2008-2012) can
be obtained by downloading Trilinos releases prior to 12.12.
be obtained by downloading Trilinos releases prior to 12.12. See [the
documentation](https://fortrilinos.readthedocs.io/en/latest/install.html#version-compatibility) for details on version compatibility.

Provided functionality
----------------------
Expand All @@ -22,9 +23,9 @@ ForTrilinos provides Fortran interfaces for the following capabilities:
Documentation
-------------

* [Website](https://trilinos.github.io/ForTrilinos/)
* [Documentation](https://fortrilinos.readthedocs.org)

* [Documentation](http://fortrilinos.readthedocs.org)
* [Summary](https://trilinos.github.io/ForTrilinos/)

Installing ForTrilinos
----------------------
Expand Down
34 changes: 34 additions & 0 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,40 @@ its only dependency. ForTrilinos can be installed through `the Spack HPC
package manager <https://spack.readthedocs.io/en/latest/>`_ or
independently from your local installation of Trilinos.

.. _version:

Version compatibility
---------------------

ForTrilinos wrappers are tightly coupled to the Trilinos API, so upstream
changes require new releases of ForTrilinos. Since the wrapper generation is
dependent on SWIG-Fortran capabilities, changes there will also affect the
ability to rebuild ForTrilinos wrappers. (Note that SWIG is always optional;
the version here simply denotes the version used to generate the included
wrappers.)

.. _version_table:

.. table:: Version compatibility table for ForTrilinos.

=========== ============== ======================
ForTrilinos Trilinos SWIG
=========== ============== ======================
2.0.0 13.0 4.0.2+fortran
2.0.0-dev3 12.18.1 4.0.2+fortran
2.0.0-dev2 12.18.1 4.0.0+fortran+15e6ed59
2.0.0-dev1 12.17+8a82b322 4.0.0+fortran+15e6ed59
1.0 12.8.1 ---
=========== ============== ======================

In :ref:`the version table above <version_table>`, the ``+fortran`` suffix for
SWIG indicates `the SWIG-Fortran fork <https://github.com/swig-fortran/swig>`.
``+sha`` refers to a specific Git commit that comes after the given version.

The original implementation of the ForTrilinos was developed prior to 2012.
That code is no longer developed and maintained, and is available using the
``trilinos-release-12-8-1`` tag and the corresponding Trilinos 12.8.1 version.

Spack
-----

Expand Down
9 changes: 2 additions & 7 deletions doc/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ Overview

`ForTrilinos <https://github.com/trilinos/ForTrilinos>`_ is an
open-source software library providing object-oriented Fortran interfaces to
`Trilinos <https://trilinos.org>`_ C++
packages.

The original implementation of the ForTrilinos was developed prior to 2012.
That code is no longer developed and maintained, and is available using the
``trilinos-release-12-8-1`` tag and the corresponding Trilinos 12.8.1 version.
`Trilinos <https://trilinos.org>`_ C++ packages.

The new implementation using SWIG code generation started in late 2016 and is
currently under active development. As of version 2.0.0, the documented
ForTrilinos module interfaces are stable and available for downstream
consumption.
consumption. See :ref:`version` for details on Trilinos version compatibility.

ForTrilinos Development Team
----------------------------
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ RUN OPENMPI_VERSION=4.0.3 && \
rm -rf ${SCRATCH_DIR}
ENV PATH=${OPENMPI_DIR}/bin:$PATH

# Install Trilinos (12.18.1)
# Install Trilinos (13.0.0)
ENV TRILINOS_DIR=/opt/trilinos
RUN export TRILINOS_HASH=55a75997332636a28afc9db1aee4ae46fe8d93e7 && \
RUN export TRILINOS_HASH=9fec35276d846a667bc668ff4cbdfd8be0dfea08 && \
export TRILINOS_URL=https://github.com/trilinos/Trilinos/archive/${TRILINOS_HASH}.tar.gz && \
export TRILINOS_ARCHIVE=trilinos-${TRILINOS_HASH}.tar.gz && \
SCRATCH_DIR=/scratch && mkdir -p ${SCRATCH_DIR} && cd ${SCRATCH_DIR} && \
Expand Down
1 change: 0 additions & 1 deletion docker/trilinos_version

This file was deleted.

59 changes: 28 additions & 31 deletions src/fortpetra/generated/fortpetra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,10 @@ module fortpetra
procedure :: release => swigf_TpetraCrsMatrix_release
procedure :: insertGlobalValues => swigf_TpetraCrsMatrix_insertGlobalValues
procedure :: insertLocalValues => swigf_TpetraCrsMatrix_insertLocalValues
procedure :: replaceGlobalValues => swigf_TpetraCrsMatrix_replaceGlobalValues
procedure, private :: swigf_TpetraCrsMatrix_replaceGlobalValues__SWIG_1
procedure, private :: swigf_TpetraCrsMatrix_replaceLocalValues__SWIG_1
procedure, private :: swigf_TpetraCrsMatrix_sumIntoGlobalValues__SWIG_0
procedure, private :: swigf_TpetraCrsMatrix_sumIntoLocalValues__SWIG_0
procedure, private :: swigf_TpetraCrsMatrix_sumIntoLocalValues__SWIG_2
procedure :: setAllToScalar => swigf_TpetraCrsMatrix_setAllToScalar
procedure :: scale => swigf_TpetraCrsMatrix_scale
procedure, private :: swigf_TpetraCrsMatrix_setAllValues__SWIG_1
Expand Down Expand Up @@ -480,9 +480,10 @@ module fortpetra
generic :: resumeFill => swigf_TpetraCrsMatrix_resumeFill__SWIG_0, swigf_TpetraCrsMatrix_resumeFill__SWIG_1
generic :: localApply => swigf_TpetraCrsMatrix_localApply__SWIG_0, swigf_TpetraCrsMatrix_localApply__SWIG_1, &
swigf_TpetraCrsMatrix_localApply__SWIG_2, swigf_TpetraCrsMatrix_localApply__SWIG_3
generic :: replaceGlobalValues => swigf_TpetraCrsMatrix_replaceGlobalValues__SWIG_1
generic :: replaceLocalValues => swigf_TpetraCrsMatrix_replaceLocalValues__SWIG_1
generic :: sumIntoGlobalValues => swigf_TpetraCrsMatrix_sumIntoGlobalValues__SWIG_0
generic :: sumIntoLocalValues => swigf_TpetraCrsMatrix_sumIntoLocalValues__SWIG_0
generic :: sumIntoLocalValues => swigf_TpetraCrsMatrix_sumIntoLocalValues__SWIG_2
generic :: setAllValues => swigf_TpetraCrsMatrix_setAllValues__SWIG_1
generic :: fillComplete => swigf_TpetraCrsMatrix_fillComplete__SWIG_0, swigf_TpetraCrsMatrix_fillComplete__SWIG_1, &
swigf_TpetraCrsMatrix_fillComplete__SWIG_2, swigf_TpetraCrsMatrix_fillComplete__SWIG_3
Expand Down Expand Up @@ -550,7 +551,7 @@ module fortpetra
end interface
interface TpetraMap
module procedure swigf_new_TpetraMap__SWIG_0, swigf_new_TpetraMap__SWIG_1, swigf_new_TpetraMap__SWIG_2, &
swigf_new_TpetraMap__SWIG_4, swigf_new_TpetraMap__SWIG_5, swigf_new_TpetraMap__SWIG_6
swigf_new_TpetraMap__SWIG_5, swigf_new_TpetraMap__SWIG_6, swigf_new_TpetraMap__SWIG_7
end interface
interface TpetraMultiVector
module procedure swigf_new_TpetraMultiVector__SWIG_0, swigf_new_TpetraMultiVector__SWIG_1, &
Expand Down Expand Up @@ -646,8 +647,8 @@ function swigc_new_TpetraMap__SWIG_2(farg1, farg2, farg4) &
type(SwigClassWrapper) :: fresult
end function

function swigc_new_TpetraMap__SWIG_4(farg1, farg2, farg4) &
bind(C, name="_wrap_new_TpetraMap__SWIG_4") &
function swigc_new_TpetraMap__SWIG_5(farg1, farg2, farg4) &
bind(C, name="_wrap_new_TpetraMap__SWIG_5") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigclasswrapper
Expand All @@ -658,16 +659,16 @@ function swigc_new_TpetraMap__SWIG_4(farg1, farg2, farg4) &
type(SwigClassWrapper) :: fresult
end function

function swigc_new_TpetraMap__SWIG_5() &
bind(C, name="_wrap_new_TpetraMap__SWIG_5") &
function swigc_new_TpetraMap__SWIG_6() &
bind(C, name="_wrap_new_TpetraMap__SWIG_6") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigclasswrapper
type(SwigClassWrapper) :: fresult
end function

function swigc_new_TpetraMap__SWIG_6(farg1) &
bind(C, name="_wrap_new_TpetraMap__SWIG_6") &
function swigc_new_TpetraMap__SWIG_7(farg1) &
bind(C, name="_wrap_new_TpetraMap__SWIG_7") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigclasswrapper
Expand Down Expand Up @@ -2734,12 +2735,11 @@ function swigc_TpetraCrsGraph_haveGlobalConstants(farg1) &
integer(C_INT) :: fresult
end function

subroutine swigc_TpetraCrsGraph_computeGlobalConstants(farg1, farg2) &
subroutine swigc_TpetraCrsGraph_computeGlobalConstants(farg1) &
bind(C, name="_wrap_TpetraCrsGraph_computeGlobalConstants")
use, intrinsic :: ISO_C_BINDING
import :: swigclasswrapper
type(SwigClassWrapper), intent(in) :: farg1
integer(C_INT), intent(in) :: farg2
end subroutine

subroutine swigc_TpetraCrsGraph_getNodeRowPtrs(farg1, farg2) &
Expand Down Expand Up @@ -3048,8 +3048,8 @@ subroutine swigc_TpetraCrsMatrix_insertLocalValues(farg1, farg2, farg3, farg4) &
type(SwigArrayWrapper) :: farg4
end subroutine

function swigc_TpetraCrsMatrix_replaceGlobalValues(farg1, farg2, farg3, farg4) &
bind(C, name="_wrap_TpetraCrsMatrix_replaceGlobalValues") &
function swigc_TpetraCrsMatrix_replaceGlobalValues__SWIG_1(farg1, farg2, farg3, farg4) &
bind(C, name="_wrap_TpetraCrsMatrix_replaceGlobalValues__SWIG_1") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigclasswrapper
Expand Down Expand Up @@ -3087,8 +3087,8 @@ function swigc_TpetraCrsMatrix_sumIntoGlobalValues__SWIG_0(farg1, farg2, farg3,
integer(C_INT) :: fresult
end function

function swigc_TpetraCrsMatrix_sumIntoLocalValues__SWIG_0(farg1, farg2, farg3, farg4) &
bind(C, name="_wrap_TpetraCrsMatrix_sumIntoLocalValues__SWIG_0") &
function swigc_TpetraCrsMatrix_sumIntoLocalValues__SWIG_2(farg1, farg2, farg3, farg4) &
bind(C, name="_wrap_TpetraCrsMatrix_sumIntoLocalValues__SWIG_2") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigclasswrapper
Expand Down Expand Up @@ -4248,7 +4248,7 @@ subroutine SWIGTM_fin_long_SS_long_Sb__SB_(finp, iminp)
end if
iminp%size = sz
end subroutine
function swigf_new_TpetraMap__SWIG_4(numglobalelements, indexlist, comm) &
function swigf_new_TpetraMap__SWIG_5(numglobalelements, indexlist, comm) &
result(self)
use, intrinsic :: ISO_C_BINDING
type(TpetraMap) :: self
Expand All @@ -4263,21 +4263,21 @@ function swigf_new_TpetraMap__SWIG_4(numglobalelements, indexlist, comm) &
farg1 = numglobalelements
call SWIGTM_fin_long_SS_long_Sb__SB_(indexlist, farg2)
farg4 = comm%swigdata
fresult = swigc_new_TpetraMap__SWIG_4(farg1, farg2, farg4)
fresult = swigc_new_TpetraMap__SWIG_5(farg1, farg2, farg4)
self%swigdata = fresult
end function

function swigf_new_TpetraMap__SWIG_5() &
function swigf_new_TpetraMap__SWIG_6() &
result(self)
use, intrinsic :: ISO_C_BINDING
type(TpetraMap) :: self
type(SwigClassWrapper) :: fresult

fresult = swigc_new_TpetraMap__SWIG_5()
fresult = swigc_new_TpetraMap__SWIG_6()
self%swigdata = fresult
end function

function swigf_new_TpetraMap__SWIG_6(arg0) &
function swigf_new_TpetraMap__SWIG_7(arg0) &
result(self)
use, intrinsic :: ISO_C_BINDING
type(TpetraMap) :: self
Expand All @@ -4286,7 +4286,7 @@ function swigf_new_TpetraMap__SWIG_6(arg0) &
type(SwigClassWrapper) :: farg1

farg1 = arg0%swigdata
fresult = swigc_new_TpetraMap__SWIG_6(farg1)
fresult = swigc_new_TpetraMap__SWIG_7(farg1)
self%swigdata = fresult
end function

Expand Down Expand Up @@ -7758,16 +7758,13 @@ function swigf_TpetraCrsGraph_haveGlobalConstants(self) &
call SWIGTM_fout_bool(fresult, swig_result)
end function

subroutine swigf_TpetraCrsGraph_computeGlobalConstants(self, computelocaltriangularconstants)
subroutine swigf_TpetraCrsGraph_computeGlobalConstants(self)
use, intrinsic :: ISO_C_BINDING
class(TpetraCrsGraph), intent(in) :: self
logical, intent(in) :: computelocaltriangularconstants
type(SwigClassWrapper) :: farg1
integer(C_INT) :: farg2

farg1 = self%swigdata
call SWIGTM_fin_bool(computelocaltriangularconstants, farg2)
call swigc_TpetraCrsGraph_computeGlobalConstants(farg1, farg2)
call swigc_TpetraCrsGraph_computeGlobalConstants(farg1)
end subroutine

subroutine swigf_TpetraCrsGraph_getNodeRowPtrs(self, rowpointers)
Expand Down Expand Up @@ -8286,7 +8283,7 @@ subroutine swigf_TpetraCrsMatrix_insertLocalValues(self, localrow, cols, vals)
call swigc_TpetraCrsMatrix_insertLocalValues(farg1, farg2, farg3, farg4)
end subroutine

function swigf_TpetraCrsMatrix_replaceGlobalValues(self, globalrow, cols, vals) &
function swigf_TpetraCrsMatrix_replaceGlobalValues__SWIG_1(self, globalrow, cols, vals) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer :: swig_result
Expand All @@ -8304,7 +8301,7 @@ function swigf_TpetraCrsMatrix_replaceGlobalValues(self, globalrow, cols, vals)
farg2 = globalrow
call SWIGTM_fin_long_SS_long_Sb__SB_(cols, farg3)
call SWIGTM_fin_double_Sb__SB_(vals, farg4)
fresult = swigc_TpetraCrsMatrix_replaceGlobalValues(farg1, farg2, farg3, farg4)
fresult = swigc_TpetraCrsMatrix_replaceGlobalValues__SWIG_1(farg1, farg2, farg3, farg4)
swig_result = int(fresult)
end function

Expand Down Expand Up @@ -8352,7 +8349,7 @@ function swigf_TpetraCrsMatrix_sumIntoGlobalValues__SWIG_0(self, globalrow, cols
swig_result = int(fresult)
end function

function swigf_TpetraCrsMatrix_sumIntoLocalValues__SWIG_0(self, localrow, cols, vals) &
function swigf_TpetraCrsMatrix_sumIntoLocalValues__SWIG_2(self, localrow, cols, vals) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer :: swig_result
Expand All @@ -8370,7 +8367,7 @@ function swigf_TpetraCrsMatrix_sumIntoLocalValues__SWIG_0(self, localrow, cols,
farg2 = int(localrow, C_INT)
call SWIGTM_fin_int_Sb__SB_(cols, farg3)
call SWIGTM_fin_double_Sb__SB_(vals, farg4)
fresult = swigc_TpetraCrsMatrix_sumIntoLocalValues__SWIG_0(farg1, farg2, farg3, farg4)
fresult = swigc_TpetraCrsMatrix_sumIntoLocalValues__SWIG_2(farg1, farg2, farg3, farg4)
swig_result = int(fresult)
end function

Expand Down
Loading

0 comments on commit 74ec43a

Please sign in to comment.