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

Rename the procedures to store, load, and print

parent e65de0e4
...@@ -153,9 +153,9 @@ module elpa_api ...@@ -153,9 +153,9 @@ module elpa_api
elpa_solve_tridiagonal_d, & !< matrix elpa_solve_tridiagonal_d, & !< matrix
elpa_solve_tridiagonal_f elpa_solve_tridiagonal_f
procedure(print_all_parameters_i), deferred, public :: print_all_parameters !< method to print all parameters procedure(print_settings_i), deferred, public :: print_settings !< method to print all parameters
procedure(save_all_parameters_i), deferred, public :: save_all_parameters !< method to save all parameters procedure(store_settings_i), deferred, public :: store_settings !< method to save all parameters
procedure(load_all_parameters_i), deferred, public :: load_all_parameters !< method to save all parameters procedure(load_settings_i), deferred, public :: load_settings !< method to save all parameters
#ifdef ENABLE_AUTOTUNING #ifdef ENABLE_AUTOTUNING
! Auto-tune ! Auto-tune
procedure(elpa_autotune_setup_i), deferred, public :: autotune_setup !< method to prepare the ELPA autotuning procedure(elpa_autotune_setup_i), deferred, public :: autotune_setup !< method to prepare the ELPA autotuning
...@@ -252,27 +252,27 @@ module elpa_api ...@@ -252,27 +252,27 @@ module elpa_api
end function end function
end interface end interface
!> \brief abstract definition of the print_all_parameters method !> \brief abstract definition of the print_settings method
!> Parameters !> Parameters
!> \details !> \details
!> \param self class(elpa_t): the ELPA object !> \param self class(elpa_t): the ELPA object
!> Prints all the elpa parameters !> Prints all the elpa parameters
abstract interface abstract interface
subroutine print_all_parameters_i(self) subroutine print_settings_i(self)
import elpa_t import elpa_t
implicit none implicit none
class(elpa_t), intent(inout) :: self class(elpa_t), intent(inout) :: self
end subroutine end subroutine
end interface end interface
!> \brief abstract definition of the save_all_parameters method !> \brief abstract definition of the store_settings method
!> Parameters !> Parameters
!> \details !> \details
!> \param self class(elpa_t): the ELPA object !> \param self class(elpa_t): the ELPA object
!> \param file_name string, the name of the file where to save the parameters !> \param file_name string, the name of the file where to save the parameters
!> Saves all the elpa parameters !> Saves all the elpa parameters
abstract interface abstract interface
subroutine save_all_parameters_i(self, file_name) subroutine store_settings_i(self, file_name)
import elpa_t import elpa_t
implicit none implicit none
class(elpa_t), intent(inout) :: self class(elpa_t), intent(inout) :: self
...@@ -280,14 +280,14 @@ module elpa_api ...@@ -280,14 +280,14 @@ module elpa_api
end subroutine end subroutine
end interface end interface
!> \brief abstract definition of the load_all_parameters method !> \brief abstract definition of the load_settings method
!> Parameters !> Parameters
!> \details !> \details
!> \param self class(elpa_t): the ELPA object !> \param self class(elpa_t): the ELPA object
!> \param file_name string, the name of the file from which to load the parameters !> \param file_name string, the name of the file from which to load the parameters
!> Loads all the elpa parameters !> Loads all the elpa parameters
abstract interface abstract interface
subroutine load_all_parameters_i(self, file_name) subroutine load_settings_i(self, file_name)
import elpa_t import elpa_t
implicit none implicit none
class(elpa_t), intent(inout) :: self class(elpa_t), intent(inout) :: self
......
...@@ -155,9 +155,9 @@ module elpa_impl ...@@ -155,9 +155,9 @@ module elpa_impl
procedure, private :: elpa_transform_back_generalized_fc procedure, private :: elpa_transform_back_generalized_fc
#endif #endif
procedure, public :: print_all_parameters => elpa_print_all_parameters procedure, public :: print_settings => elpa_print_settings
procedure, public :: save_all_parameters => elpa_save_all_parameters procedure, public :: store_settings => elpa_store_settings
procedure, public :: load_all_parameters => elpa_load_all_parameters procedure, public :: load_all_settings => elpa_load_settings
#ifdef ENABLE_AUTOTUNING #ifdef ENABLE_AUTOTUNING
procedure, public :: autotune_setup => elpa_autotune_setup procedure, public :: autotune_setup => elpa_autotune_setup
procedure, public :: autotune_step => elpa_autotune_step procedure, public :: autotune_step => elpa_autotune_step
...@@ -1106,12 +1106,12 @@ module elpa_impl ...@@ -1106,12 +1106,12 @@ module elpa_impl
!> \brief function to print all the parameters, that have been set !> \brief function to print all the parameters, that have been set
!> Parameters !> Parameters
!> \param self class(elpa_impl_t) the allocated ELPA object !> \param self class(elpa_impl_t) the allocated ELPA object
subroutine elpa_print_all_parameters(self) subroutine elpa_print_settings(self)
implicit none implicit none
class(elpa_impl_t), intent(inout) :: self class(elpa_impl_t), intent(inout) :: self
if (elpa_index_print_all_parameters_c(self%index, c_null_char) /= 1) then if (elpa_index_print_settings_c(self%index, c_null_char) /= 1) then
stop "This should not happen (in elpa_print_all_parameters())" stop "This should not happen (in elpa_print_settings())"
endif endif
end subroutine end subroutine
...@@ -1119,13 +1119,13 @@ module elpa_impl ...@@ -1119,13 +1119,13 @@ module elpa_impl
!> Parameters !> Parameters
!> \param self class(elpa_impl_t) the allocated ELPA object !> \param self class(elpa_impl_t) the allocated ELPA object
!> \param file_name string, the name of the file where to save the parameters !> \param file_name string, the name of the file where to save the parameters
subroutine elpa_save_all_parameters(self, file_name) subroutine elpa_store_settings(self, file_name)
implicit none implicit none
class(elpa_impl_t), intent(inout) :: self class(elpa_impl_t), intent(inout) :: self
character(*), intent(in) :: file_name character(*), intent(in) :: file_name
if (elpa_index_print_all_parameters_c(self%index, file_name // c_null_char) /= 1) then if (elpa_index_print_settings_c(self%index, file_name // c_null_char) /= 1) then
stop "This should not happen (in elpa_save_all_parameters())" stop "This should not happen (in elpa_store_settings())"
endif endif
end subroutine end subroutine
...@@ -1133,13 +1133,13 @@ module elpa_impl ...@@ -1133,13 +1133,13 @@ module elpa_impl
!> Parameters !> Parameters
!> \param self class(elpa_impl_t) the allocated ELPA object !> \param self class(elpa_impl_t) the allocated ELPA object
!> \param file_name string, the name of the file from which to load the parameters !> \param file_name string, the name of the file from which to load the parameters
subroutine elpa_load_all_parameters(self, file_name) subroutine elpa_load_settings(self, file_name)
implicit none implicit none
class(elpa_impl_t), intent(inout) :: self class(elpa_impl_t), intent(inout) :: self
character(*), intent(in) :: file_name character(*), intent(in) :: file_name
if (elpa_index_load_all_parameters_c(self%index, file_name // c_null_char) /= 1) then if (elpa_index_load_settings_c(self%index, file_name // c_null_char) /= 1) then
stop "This should not happen (in elpa_load_all_parameters())" stop "This should not happen (in elpa_load_settings())"
endif endif
end subroutine end subroutine
......
// This file is part of ELPA. settings// This file is part of ELPA.
// //
// The ELPA library was originally created by the ELPA consortium, // The ELPA library was originally created by the ELPA consortium,
// consisting of the following organizations: // consisting of the following organizations:
...@@ -1303,7 +1303,7 @@ const char STRUCTURE_PARAMETERS[] = "* Parameters describing structure of the co ...@@ -1303,7 +1303,7 @@ const char STRUCTURE_PARAMETERS[] = "* Parameters describing structure of the co
const char EXPLICIT_PARAMETERS[] = "* Parameters explicitly set by the user:\n"; const char EXPLICIT_PARAMETERS[] = "* Parameters explicitly set by the user:\n";
const char DEFAULT_PARAMETERS[] = "* Parameters with default or environment value:\n"; const char DEFAULT_PARAMETERS[] = "* Parameters with default or environment value:\n";
int elpa_index_print_all_parameters(elpa_index_t index, char *file_name) { int elpa_index_print_settings(elpa_index_t index, char *file_name) {
const int LEN =10000; const int LEN =10000;
char out_structure[LEN], out_set[LEN], out_defaults[LEN], out_nowhere[LEN], buff[100]; char out_structure[LEN], out_set[LEN], out_defaults[LEN], out_nowhere[LEN], buff[100];
char (*out)[LEN]; char (*out)[LEN];
...@@ -1331,7 +1331,7 @@ int elpa_index_print_all_parameters(elpa_index_t index, char *file_name) { ...@@ -1331,7 +1331,7 @@ int elpa_index_print_all_parameters(elpa_index_t index, char *file_name) {
if(output_to_file) { if(output_to_file) {
f = fopen(file_name, "w"); f = fopen(file_name, "w");
if(f == NULL){ if(f == NULL){
fprintf(stderr, "Cannot open file %s in elpa_index_print_all_parameters\n", file_name); fprintf(stderr, "Cannot open file %s in elpa_index_print_settings\n", file_name);
return 0; return 0;
} }
} }
...@@ -1349,7 +1349,7 @@ int elpa_index_print_all_parameters(elpa_index_t index, char *file_name) { ...@@ -1349,7 +1349,7 @@ int elpa_index_print_all_parameters(elpa_index_t index, char *file_name) {
return 1; return 1;
} }
int elpa_index_load_all_parameters(elpa_index_t index, char *file_name) { int elpa_index_load_settings(elpa_index_t index, char *file_name) {
const int LEN = 1000; const int LEN = 1000;
char line[LEN], s[LEN]; char line[LEN], s[LEN];
int n; int n;
......
...@@ -437,8 +437,8 @@ int elpa_index_print_autotune_parameters(elpa_index_t index, int autotune_level, ...@@ -437,8 +437,8 @@ int elpa_index_print_autotune_parameters(elpa_index_t index, int autotune_level,
/* /*
!f> interface !f> interface
!f> function elpa_index_print_all_parameters_c(index, file_name) result(success) & !f> function elpa_index_print_settings_c(index, file_name) result(success) &
!f> bind(C, name="elpa_index_print_all_parameters") !f> bind(C, name="elpa_index_print_settings")
!f> import c_int, c_ptr, c_char !f> import c_int, c_ptr, c_char
!f> type(c_ptr), intent(in), value :: index !f> type(c_ptr), intent(in), value :: index
!f> character(kind=c_char), intent(in) :: file_name(*) !f> character(kind=c_char), intent(in) :: file_name(*)
...@@ -447,12 +447,12 @@ int elpa_index_print_autotune_parameters(elpa_index_t index, int autotune_level, ...@@ -447,12 +447,12 @@ int elpa_index_print_autotune_parameters(elpa_index_t index, int autotune_level,
!f> end interface !f> end interface
!f> !f>
*/ */
int elpa_index_print_all_parameters(elpa_index_t index, char* filename); int elpa_index_print_settings(elpa_index_t index, char* filename);
/* /*
!f> interface !f> interface
!f> function elpa_index_load_all_parameters_c(index, file_name) result(success) & !f> function elpa_index_load_settings_c(index, file_name) result(success) &
!f> bind(C, name="elpa_index_load_all_parameters") !f> bind(C, name="elpa_index_load_settings")
!f> import c_int, c_ptr, c_char !f> import c_int, c_ptr, c_char
!f> type(c_ptr), intent(in), value :: index !f> type(c_ptr), intent(in), value :: index
!f> character(kind=c_char), intent(in) :: file_name(*) !f> character(kind=c_char), intent(in) :: file_name(*)
...@@ -461,7 +461,7 @@ int elpa_index_print_all_parameters(elpa_index_t index, char* filename); ...@@ -461,7 +461,7 @@ int elpa_index_print_all_parameters(elpa_index_t index, char* filename);
!f> end interface !f> end interface
!f> !f>
*/ */
int elpa_index_load_all_parameters(elpa_index_t index, char* filename); int elpa_index_load_settings(elpa_index_t index, char* filename);
/* /*
!f> interface !f> interface
......
...@@ -604,7 +604,7 @@ program test ...@@ -604,7 +604,7 @@ program test
! print all parameters ! print all parameters
call e%print_all_parameters() call e%print_settings()
#ifdef TEST_ALL_KERNELS #ifdef TEST_ALL_KERNELS
call e%timer_start(elpa_int_value_to_string(KERNEL_KEY, kernel)) call e%timer_start(elpa_int_value_to_string(KERNEL_KEY, kernel))
......
...@@ -219,8 +219,8 @@ program test ...@@ -219,8 +219,8 @@ program test
do while (e%autotune_step(tune_state)) do while (e%autotune_step(tune_state))
iter=iter+1 iter=iter+1
write(iter_string,'(I5.5)') iter write(iter_string,'(I5.5)') iter
!call e%print_all_parameters() !call e%print_settings()
!call e%save_all_parameters("saved_parameters_"//trim(iter_string)//".txt") !call e%store_settings("saved_parameters_"//trim(iter_string)//".txt")
call e%timer_start("eigenvectors: iteration "//trim(iter_string)) call e%timer_start("eigenvectors: iteration "//trim(iter_string))
call e%eigenvectors(a, ev, z, error) call e%eigenvectors(a, ev, z, error)
call e%timer_stop("eigenvectors: iteration "//trim(iter_string)) call e%timer_stop("eigenvectors: iteration "//trim(iter_string))
......
...@@ -190,19 +190,19 @@ program test ...@@ -190,19 +190,19 @@ program test
assert_elpa_ok(e1%setup()) assert_elpa_ok(e1%setup())
call e1%save_all_parameters("initial_parameters.txt") call e1%store_settings("initial_parameters.txt")
! try to load parameters into another object ! try to load parameters into another object
e2 => elpa_allocate() e2 => elpa_allocate()
call set_basic_params(e2, na, nev, na_rows, na_cols, my_prow, my_pcol) call set_basic_params(e2, na, nev, na_rows, na_cols, my_prow, my_pcol)
call e2%load_all_parameters("initial_parameters.txt") call e2%load_settings("initial_parameters.txt")
assert_elpa_ok(e2%setup()) assert_elpa_ok(e2%setup())
if(myid == 0) print *, "parameters of e1" if(myid == 0) print *, "parameters of e1"
call e1%print_all_parameters() call e1%print_settings()
if(myid == 0) print *, "" if(myid == 0) print *, ""
if(myid == 0) print *, "parameters of e2" if(myid == 0) print *, "parameters of e2"
call e2%print_all_parameters() call e2%print_settings()
e_ptr => e2 e_ptr => e2
...@@ -214,8 +214,8 @@ program test ...@@ -214,8 +214,8 @@ program test
do while (e_ptr%autotune_step(tune_state)) do while (e_ptr%autotune_step(tune_state))
iter=iter+1 iter=iter+1
write(iter_string,'(I5.5)') iter write(iter_string,'(I5.5)') iter
call e_ptr%print_all_parameters() call e_ptr%print_settings()
call e_ptr%save_all_parameters("saved_parameters_"//trim(iter_string)//".txt") call e_ptr%store_settings("saved_parameters_"//trim(iter_string)//".txt")
call e_ptr%timer_start("eigenvectors: iteration "//trim(iter_string)) call e_ptr%timer_start("eigenvectors: iteration "//trim(iter_string))
call e_ptr%eigenvectors(a, ev, z, error) call e_ptr%eigenvectors(a, ev, z, error)
......
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