Commit 9d14bd03 authored by Pavel Kus's avatar Pavel Kus

legacy_api removed from the index

parent 23027db8
...@@ -120,12 +120,6 @@ ...@@ -120,12 +120,6 @@
stop stop
endif endif
call e%set("legacy_api", 1, error)
if (error .ne. ELPA_OK) then
print *,"Problem setting option. Aborting..."
stop 1
endif
!! the elpa object needs nev to be set (in case the EVP-solver is !! the elpa object needs nev to be set (in case the EVP-solver is
!! called later. Thus it is set by user, do nothing, otherwise, !! called later. Thus it is set by user, do nothing, otherwise,
!! set it to na as default !! set it to na as default
...@@ -133,6 +127,8 @@ ...@@ -133,6 +127,8 @@
! call e%set("nev", na) ! call e%set("nev", na)
!endif !endif
call e%creating_from_legacy_api()
if (e%setup() .ne. ELPA_OK) then if (e%setup() .ne. ELPA_OK) then
print *, "Cannot setup ELPA instance" print *, "Cannot setup ELPA instance"
success = .false. success = .false.
......
...@@ -143,12 +143,8 @@ ...@@ -143,12 +143,8 @@
print *,"Problem setting option. Aborting..." print *,"Problem setting option. Aborting..."
stop stop
endif endif
call e%set("legacy_api", 1, error)
if (error .ne. ELPA_OK) then
print *,"Problem setting option. Aborting..."
stop
endif
call e%creating_from_legacy_api()
if (e%setup() .ne. ELPA_OK) then if (e%setup() .ne. ELPA_OK) then
print *, "Cannot setup ELPA instance" print *, "Cannot setup ELPA instance"
...@@ -156,6 +152,7 @@ ...@@ -156,6 +152,7 @@
return return
endif endif
if (wantDebug) then if (wantDebug) then
call e%set("debug",1, error) call e%set("debug",1, error)
if (error .ne. ELPA_OK) then if (error .ne. ELPA_OK) then
......
...@@ -158,11 +158,7 @@ ...@@ -158,11 +158,7 @@
stop stop
endif endif
call e%set("legacy_api", 1, error) call e%creating_from_legacy_api()
if (error .ne. ELPA_OK) then
print *,"Problem setting option. Aborting..."
stop 1
endif
if (e%setup() .ne. ELPA_OK) then if (e%setup() .ne. ELPA_OK) then
print *, "Cannot setup ELPA instance" print *, "Cannot setup ELPA instance"
......
...@@ -135,11 +135,8 @@ ...@@ -135,11 +135,8 @@
print *,"Problem setting option. Aborting..." print *,"Problem setting option. Aborting..."
stop stop
endif endif
call obj%set("legacy_api", 1, error)
if (error .ne. ELPA_OK) then call obj%creating_from_legacy_api()
print *,"Problem setting option. Aborting..."
stop
endif
if (obj%setup() .ne. ELPA_OK) then if (obj%setup() .ne. ELPA_OK) then
print *, "Cannot setup ELPA instance" print *, "Cannot setup ELPA instance"
......
...@@ -99,6 +99,10 @@ module elpa_api ...@@ -99,6 +99,10 @@ module elpa_api
procedure(elpa_is_set_i), deferred, public :: is_set !< method to check whether key/value is set procedure(elpa_is_set_i), deferred, public :: is_set !< method to check whether key/value is set
procedure(elpa_can_set_i), deferred, public :: can_set !< method to check whether key/value can be set procedure(elpa_can_set_i), deferred, public :: can_set !< method to check whether key/value can be set
! call before setup if created from the legacy api
! remove this function completely after the legacy api is dropped
procedure(elpa_creating_from_legacy_api_i), deferred, public :: creating_from_legacy_api
! Timer ! Timer
procedure(elpa_get_time_i), deferred, public :: get_time !< method to get the times from the timer object procedure(elpa_get_time_i), deferred, public :: get_time !< method to get the times from the timer object
procedure(elpa_print_times_i), deferred, public :: print_times !< method to print the timings tree procedure(elpa_print_times_i), deferred, public :: print_times !< method to print the timings tree
...@@ -773,6 +777,14 @@ module elpa_api ...@@ -773,6 +777,14 @@ module elpa_api
end interface end interface
#endif #endif
abstract interface
subroutine elpa_creating_from_legacy_api_i(self)
import elpa_t
implicit none
class(elpa_t), intent(inout) :: self
end subroutine
end interface
contains contains
......
...@@ -73,6 +73,9 @@ module elpa_impl ...@@ -73,6 +73,9 @@ module elpa_impl
private private
integer :: communicators_owned integer :: communicators_owned
!This object has been created through the legacy api.
integer :: from_legacy_api
!> \brief methods available with the elpa_impl_t type !> \brief methods available with the elpa_impl_t type
contains contains
!> \brief the puplic methods !> \brief the puplic methods
...@@ -86,6 +89,9 @@ module elpa_impl ...@@ -86,6 +89,9 @@ module elpa_impl
procedure, public :: can_set => elpa_can_set !< a method to check whether a key/value pair can be set : implemented procedure, public :: can_set => elpa_can_set !< a method to check whether a key/value pair can be set : implemented
!< in elpa_can_set !< in elpa_can_set
! call before setup if created from the legacy api
! remove this function completely after the legacy api is dropped
procedure, public :: creating_from_legacy_api => elpa_creating_from_legacy_api
! timer ! timer
procedure, public :: get_time => elpa_get_time procedure, public :: get_time => elpa_get_time
...@@ -187,11 +193,14 @@ module elpa_impl ...@@ -187,11 +193,14 @@ module elpa_impl
#endif #endif
integer :: error2 integer :: error2
allocate(obj, stat=error2) allocate(obj, stat=error2)
if (error2 .ne. 0) then if (error2 .ne. 0) then
write(error_unit, *) "elpa_allocate(): could not allocate object" write(error_unit, *) "elpa_allocate(): could not allocate object"
endif endif
obj%from_legacy_api = 0
! check whether init has ever been called ! check whether init has ever been called
if ( elpa_initialized() .ne. ELPA_OK) then if ( elpa_initialized() .ne. ELPA_OK) then
write(error_unit, *) "elpa_allocate(): you must call elpa_init() once before creating instances of ELPA" write(error_unit, *) "elpa_allocate(): you must call elpa_init() once before creating instances of ELPA"
...@@ -415,7 +424,7 @@ module elpa_impl ...@@ -415,7 +424,7 @@ module elpa_impl
#ifdef WITH_MPI #ifdef WITH_MPI
integer :: mpi_comm_parent, mpi_comm_rows, mpi_comm_cols, np_rows, np_cols, my_id, & integer :: mpi_comm_parent, mpi_comm_rows, mpi_comm_cols, np_rows, np_cols, my_id, &
mpierr, mpierr2, process_row, process_col, mpi_string_length, & mpierr, mpierr2, process_row, process_col, mpi_string_length, &
present_np_rows, present_np_cols, np_total, legacy_api present_np_rows, present_np_cols, np_total
character(len=MPI_MAX_ERROR_STRING) :: mpierr_string character(len=MPI_MAX_ERROR_STRING) :: mpierr_string
character(*), parameter :: MPI_CONSISTENCY_MSG = & character(*), parameter :: MPI_CONSISTENCY_MSG = &
"Provide mpi_comm_parent and EITHER process_row and process_col OR mpi_comm_rows and mpi_comm_cols. Aborting..." "Provide mpi_comm_parent and EITHER process_row and process_col OR mpi_comm_rows and mpi_comm_cols. Aborting..."
...@@ -447,11 +456,6 @@ module elpa_impl ...@@ -447,11 +456,6 @@ module elpa_impl
! inconsistencies and is rather natural from the user point of view ! inconsistencies and is rather natural from the user point of view
#ifdef WITH_MPI #ifdef WITH_MPI
if (self%is_set("legacy_api") == 1) then
call self%get("legacy_api", legacy_api, error)
if (check_elpa_get(error, ELPA_ERROR_SETUP)) return
endif
if (self%is_set("mpi_comm_parent") == 1) then if (self%is_set("mpi_comm_parent") == 1) then
call self%get("mpi_comm_parent", mpi_comm_parent, error) call self%get("mpi_comm_parent", mpi_comm_parent, error)
if (check_elpa_get(error, ELPA_ERROR_SETUP)) return if (check_elpa_get(error, ELPA_ERROR_SETUP)) return
...@@ -464,7 +468,7 @@ module elpa_impl ...@@ -464,7 +468,7 @@ module elpa_impl
call self%set("num_processes", np_total, error) call self%set("num_processes", np_total, error)
if (check_elpa_set(error, ELPA_ERROR_SETUP)) return if (check_elpa_set(error, ELPA_ERROR_SETUP)) return
else else
if (legacy_api .ne. 1) then if (self%from_legacy_api .ne. 1) then
write(error_unit,*) MPI_CONSISTENCY_MSG write(error_unit,*) MPI_CONSISTENCY_MSG
error = ELPA_ERROR error = ELPA_ERROR
return return
...@@ -577,7 +581,7 @@ module elpa_impl ...@@ -577,7 +581,7 @@ module elpa_impl
if (check_elpa_set(error, ELPA_ERROR_SETUP)) return if (check_elpa_set(error, ELPA_ERROR_SETUP)) return
endif endif
if (legacy_api .ne. 1) then if (self%from_legacy_api .ne. 1) then
if (np_total .ne. np_rows * np_cols) then if (np_total .ne. np_rows * np_cols) then
print *,"MPI parent communicator and row/col communicators do not match. Aborting..." print *,"MPI parent communicator and row/col communicators do not match. Aborting..."
stop stop
...@@ -1636,4 +1640,10 @@ module elpa_impl ...@@ -1636,4 +1640,10 @@ module elpa_impl
return return
end function end function
subroutine elpa_creating_from_legacy_api(self)
implicit none
class(elpa_impl_t), intent(inout) :: self
self%from_legacy_api = 1
end subroutine
end module end module
...@@ -187,7 +187,6 @@ static const elpa_index_int_entry_t int_entries[] = { ...@@ -187,7 +187,6 @@ static const elpa_index_int_entry_t int_entries[] = {
INT_ANY_ENTRY("mpi_comm_cols", "Communicator for inter-column communication", PRINT_NO), INT_ANY_ENTRY("mpi_comm_cols", "Communicator for inter-column communication", PRINT_NO),
INT_ANY_ENTRY("mpi_comm_parent", "Parent communicator", PRINT_NO), INT_ANY_ENTRY("mpi_comm_parent", "Parent communicator", PRINT_NO),
INT_ANY_ENTRY("blacs_context", "BLACS context", PRINT_NO), INT_ANY_ENTRY("blacs_context", "BLACS context", PRINT_NO),
INT_ANY_ENTRY("legacy_api", "This object has been created through the legacy api. Parameter for internal use only", PRINT_NO),
INT_ENTRY("solver", "Solver to use", ELPA_SOLVER_1STAGE, ELPA_AUTOTUNE_FAST, ELPA_AUTOTUNE_DOMAIN_ANY, \ INT_ENTRY("solver", "Solver to use", ELPA_SOLVER_1STAGE, ELPA_AUTOTUNE_FAST, ELPA_AUTOTUNE_DOMAIN_ANY, \
number_of_solvers, solver_enumerate, solver_is_valid, elpa_solver_name, PRINT_YES), number_of_solvers, solver_enumerate, solver_is_valid, elpa_solver_name, PRINT_YES),
INT_ENTRY("gpu", "Use GPU acceleration", 0, ELPA_AUTOTUNE_MEDIUM, ELPA_AUTOTUNE_DOMAIN_ANY, INT_ENTRY("gpu", "Use GPU acceleration", 0, ELPA_AUTOTUNE_MEDIUM, ELPA_AUTOTUNE_DOMAIN_ANY,
......
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