Commit 5be9556b authored by Andreas Marek's avatar Andreas Marek

Update API version number

parent 24667816
......@@ -32,7 +32,8 @@ AC_SUBST([ELPA_SO_VERSION], [11:0:0])
# API Version
AC_DEFINE([EARLIEST_API_VERSION], [20170403], [Earliest supported ELPA API version])
AC_DEFINE([CURRENT_API_VERSION], [20171201], [Current ELPA API version])
# Autotune Version
AC_DEFINE([EARLIEST_AUTOTUNE_VERSION], [20171201], [Earliest ELPA API version, which supports autotuning])
AX_CHECK_GNU_MAKE()
if test x$_cv_gnu_make_command = x ; then
......
......@@ -20,7 +20,7 @@ class(elpa_t), pointer :: elpa
.RI "With the definitions of the input and output variables:"
.br
.RI "integer, intent(in) :: \fBapi_version\fP ! the api version that you want to initialize, currently the version is 20170403"
.RI "integer, intent(in) :: \fBapi_version\fP ! the api version that you want to initialize, currently the version is 20171201"
.br
.RI "integer :: \fBerror\fP ! the return code. If the function returns without an error, the error code will be ELPA_OK."
.br
......@@ -40,7 +40,7 @@ elpa_t handle;
.br
.br
.RI "int \fBapi_version\fP; // the api version that you want to initialize currently the version is 20170403"
.RI "int \fBapi_version\fP; // the api version that you want to initialize currently the version is 20171201"
.br
.RI "int \fBerror\fP; // the return code. If the function returns without an error, the error code will be ELPA_OK."
......
......@@ -109,7 +109,7 @@
!> class(elpa_t), pointer :: elpa
!> integer :: success
!>
!> if (elpa_init(20170403) /= ELPA_OK) then
!> if (elpa_init(20171201) /= ELPA_OK) then
!> print *, "ELPA API version not supported"
!> stop
!> endif
......@@ -153,7 +153,7 @@
!> elpa_t handle;
!> int error;
!>
!> if (elpa_init(20170403) != ELPA_OK) {
!> if (elpa_init(20171201) != ELPA_OK) {
!> fprintf(stderr, "Error: ELPA API version not supported");
!> exit(1);
!> }
......
......@@ -60,7 +60,10 @@ module elpa_api
!< with the current release
integer, private, parameter :: current_api_version = CURRENT_API_VERSION !< Definition of the current API version
logical, private :: initDone = .false.
integer, private, parameter :: earliest_autotune_version = EARLIEST_AUTOTUNE_VERSION !< Definition of the earliest API version
!< which supports autotuning
integer, private :: api_version_set
logical, private :: initDone = .false.
public :: elpa_t, &
c_int, &
......@@ -71,6 +74,7 @@ module elpa_api
type, abstract :: elpa_t
private
!< these have to be public for proper bounds checking, sadly
integer(kind=c_int), public, pointer :: na => NULL()
integer(kind=c_int), public, pointer :: nev => NULL()
......@@ -1374,6 +1378,7 @@ module elpa_api
if (earliest_api_version <= api_version .and. api_version <= current_api_version) then
initDone = .true.
api_version_set = api_version
error = ELPA_OK
else
write(error_unit, "(a,i0,a)") "ELPA: Error API version ", api_version," is not supported by this library"
......@@ -1394,6 +1399,12 @@ module elpa_api
endif
end function
function elpa_get_api_version() result(api_version)
integer :: api_version
api_version = api_version_set
end function
!> \brief subroutine to uninit the ELPA library. Does nothing at the moment. Might do sth. later
!
......
......@@ -2615,6 +2615,12 @@ module elpa_impl
type(elpa_autotune_impl_t), pointer :: ts_impl
class(elpa_autotune_t), pointer :: tune_state
if (elpa_get_api_version() < EARLIEST_AUTOTUNE_VERSION) then
write(error_unit, "(a,i0,a)") "ELPA: Error API version: Autotuning does not support", elpa_get_api_version()
stop
endif
allocate(ts_impl)
ts_impl%parent => self
ts_impl%level = level
......
......@@ -191,7 +191,7 @@ program test_real_example
!-------------------------------------------------------------------------------
if (elpa_init(20170403) /= elpa_ok) then
if (elpa_init(20171201) /= elpa_ok) then
print *, "ELPA API version not supported"
stop
endif
......
......@@ -191,7 +191,7 @@ program test_real_example
!-------------------------------------------------------------------------------
if (elpa_init(20170403) /= elpa_ok) then
if (elpa_init(20171201) /= elpa_ok) then
print *, "ELPA API version not supported"
stop
endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment