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

Update API version number

parent 24667816
...@@ -32,7 +32,8 @@ AC_SUBST([ELPA_SO_VERSION], [11:0:0]) ...@@ -32,7 +32,8 @@ AC_SUBST([ELPA_SO_VERSION], [11:0:0])
# API Version # API Version
AC_DEFINE([EARLIEST_API_VERSION], [20170403], [Earliest supported ELPA API version]) AC_DEFINE([EARLIEST_API_VERSION], [20170403], [Earliest supported ELPA API version])
AC_DEFINE([CURRENT_API_VERSION], [20171201], [Current 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() AX_CHECK_GNU_MAKE()
if test x$_cv_gnu_make_command = x ; then if test x$_cv_gnu_make_command = x ; then
......
...@@ -20,7 +20,7 @@ class(elpa_t), pointer :: elpa ...@@ -20,7 +20,7 @@ class(elpa_t), pointer :: elpa
.RI "With the definitions of the input and output variables:" .RI "With the definitions of the input and output variables:"
.br .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 .br
.RI "integer :: \fBerror\fP ! the return code. If the function returns without an error, the error code will be ELPA_OK." .RI "integer :: \fBerror\fP ! the return code. If the function returns without an error, the error code will be ELPA_OK."
.br .br
...@@ -40,7 +40,7 @@ elpa_t handle; ...@@ -40,7 +40,7 @@ elpa_t handle;
.br .br
.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 .br
.RI "int \fBerror\fP; // the return code. If the function returns without an error, the error code will be ELPA_OK." .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 @@ ...@@ -109,7 +109,7 @@
!> class(elpa_t), pointer :: elpa !> class(elpa_t), pointer :: elpa
!> integer :: success !> integer :: success
!> !>
!> if (elpa_init(20170403) /= ELPA_OK) then !> if (elpa_init(20171201) /= ELPA_OK) then
!> print *, "ELPA API version not supported" !> print *, "ELPA API version not supported"
!> stop !> stop
!> endif !> endif
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
!> elpa_t handle; !> elpa_t handle;
!> int error; !> int error;
!> !>
!> if (elpa_init(20170403) != ELPA_OK) { !> if (elpa_init(20171201) != ELPA_OK) {
!> fprintf(stderr, "Error: ELPA API version not supported"); !> fprintf(stderr, "Error: ELPA API version not supported");
!> exit(1); !> exit(1);
!> } !> }
......
...@@ -60,6 +60,9 @@ module elpa_api ...@@ -60,6 +60,9 @@ module elpa_api
!< with the current release !< with the current release
integer, private, parameter :: current_api_version = CURRENT_API_VERSION !< Definition of the current API version integer, private, parameter :: current_api_version = CURRENT_API_VERSION !< Definition of the current API version
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. logical, private :: initDone = .false.
public :: elpa_t, & public :: elpa_t, &
...@@ -71,6 +74,7 @@ module elpa_api ...@@ -71,6 +74,7 @@ module elpa_api
type, abstract :: elpa_t type, abstract :: elpa_t
private private
!< these have to be public for proper bounds checking, sadly !< these have to be public for proper bounds checking, sadly
integer(kind=c_int), public, pointer :: na => NULL() integer(kind=c_int), public, pointer :: na => NULL()
integer(kind=c_int), public, pointer :: nev => NULL() integer(kind=c_int), public, pointer :: nev => NULL()
...@@ -1374,6 +1378,7 @@ module elpa_api ...@@ -1374,6 +1378,7 @@ module elpa_api
if (earliest_api_version <= api_version .and. api_version <= current_api_version) then if (earliest_api_version <= api_version .and. api_version <= current_api_version) then
initDone = .true. initDone = .true.
api_version_set = api_version
error = ELPA_OK error = ELPA_OK
else else
write(error_unit, "(a,i0,a)") "ELPA: Error API version ", api_version," is not supported by this library" 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 ...@@ -1394,6 +1399,12 @@ module elpa_api
endif endif
end function 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 !> \brief subroutine to uninit the ELPA library. Does nothing at the moment. Might do sth. later
! !
......
...@@ -2615,6 +2615,12 @@ module elpa_impl ...@@ -2615,6 +2615,12 @@ module elpa_impl
type(elpa_autotune_impl_t), pointer :: ts_impl type(elpa_autotune_impl_t), pointer :: ts_impl
class(elpa_autotune_t), pointer :: tune_state 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) allocate(ts_impl)
ts_impl%parent => self ts_impl%parent => self
ts_impl%level = level ts_impl%level = level
......
...@@ -191,7 +191,7 @@ program test_real_example ...@@ -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" print *, "ELPA API version not supported"
stop stop
endif endif
......
...@@ -191,7 +191,7 @@ program test_real_example ...@@ -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" print *, "ELPA API version not supported"
stop stop
endif 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