Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
elpa
elpa
Commits
5d359402
Commit
5d359402
authored
Nov 13, 2018
by
Andreas Marek
Browse files
Rename the procedures to store, load, and print
parent
e65de0e4
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/elpa_api.F90
View file @
5d359402
...
...
@@ -153,9 +153,9 @@ module elpa_api
elpa_solve_tridiagonal_d
,
&
!< matrix
elpa_solve_tridiagonal_f
procedure
(
print_
all_parameter
s_i
),
deferred
,
public
::
print_
all_parameter
s
!< method to print all parameters
procedure
(
s
ave_all_parameter
s_i
),
deferred
,
public
::
s
ave_all_parameter
s
!< method to save all parameters
procedure
(
load_
all_parameter
s_i
),
deferred
,
public
::
load_
all_parameter
s
!< method to save all parameters
procedure
(
print_
setting
s_i
),
deferred
,
public
::
print_
setting
s
!< method to print all parameters
procedure
(
s
tore_setting
s_i
),
deferred
,
public
::
s
tore_setting
s
!< method to save all parameters
procedure
(
load_
setting
s_i
),
deferred
,
public
::
load_
setting
s
!< method to save all parameters
#ifdef ENABLE_AUTOTUNING
! Auto-tune
procedure
(
elpa_autotune_setup_i
),
deferred
,
public
::
autotune_setup
!< method to prepare the ELPA autotuning
...
...
@@ -252,27 +252,27 @@ module elpa_api
end
function
end
interface
!> \brief abstract definition of the print_
all_parameter
s method
!> \brief abstract definition of the print_
setting
s method
!> Parameters
!> \details
!> \param self class(elpa_t): the ELPA object
!> Prints all the elpa parameters
abstract
interface
subroutine
print_
all_parameter
s_i
(
self
)
subroutine
print_
setting
s_i
(
self
)
import
elpa_t
implicit
none
class
(
elpa_t
),
intent
(
inout
)
::
self
end
subroutine
end
interface
!> \brief abstract definition of the s
ave_all_parameter
s method
!> \brief abstract definition of the s
tore_setting
s method
!> Parameters
!> \details
!> \param self class(elpa_t): the ELPA object
!> \param file_name string, the name of the file where to save the parameters
!> Saves all the elpa parameters
abstract
interface
subroutine
s
ave_all_parameter
s_i
(
self
,
file_name
)
subroutine
s
tore_setting
s_i
(
self
,
file_name
)
import
elpa_t
implicit
none
class
(
elpa_t
),
intent
(
inout
)
::
self
...
...
@@ -280,14 +280,14 @@ module elpa_api
end
subroutine
end
interface
!> \brief abstract definition of the load_
all_parameter
s method
!> \brief abstract definition of the load_
setting
s method
!> Parameters
!> \details
!> \param self class(elpa_t): the ELPA object
!> \param file_name string, the name of the file from which to load the parameters
!> Loads all the elpa parameters
abstract
interface
subroutine
load_
all_parameter
s_i
(
self
,
file_name
)
subroutine
load_
setting
s_i
(
self
,
file_name
)
import
elpa_t
implicit
none
class
(
elpa_t
),
intent
(
inout
)
::
self
...
...
src/elpa_impl.F90
View file @
5d359402
...
...
@@ -155,9 +155,9 @@ module elpa_impl
procedure
,
private
::
elpa_transform_back_generalized_fc
#endif
procedure
,
public
::
print_
all_parameter
s
=>
elpa_print_
all_parameter
s
procedure
,
public
::
s
ave_all_parameters
=>
elpa_save_all_parameter
s
procedure
,
public
::
load_all_
parameter
s
=>
elpa_load_
all_parameter
s
procedure
,
public
::
print_
setting
s
=>
elpa_print_
setting
s
procedure
,
public
::
s
tore_settings
=>
elpa_store_setting
s
procedure
,
public
::
load_all_
setting
s
=>
elpa_load_
setting
s
#ifdef ENABLE_AUTOTUNING
procedure
,
public
::
autotune_setup
=>
elpa_autotune_setup
procedure
,
public
::
autotune_step
=>
elpa_autotune_step
...
...
@@ -1106,12 +1106,12 @@ module elpa_impl
!> \brief function to print all the parameters, that have been set
!> Parameters
!> \param self class(elpa_impl_t) the allocated ELPA object
subroutine
elpa_print_
all_parameter
s
(
self
)
subroutine
elpa_print_
setting
s
(
self
)
implicit
none
class
(
elpa_impl_t
),
intent
(
inout
)
::
self
if
(
elpa_index_print_
all_parameter
s_c
(
self
%
index
,
c_null_char
)
/
=
1
)
then
stop
"This should not happen (in elpa_print_
all_parameter
s())"
if
(
elpa_index_print_
setting
s_c
(
self
%
index
,
c_null_char
)
/
=
1
)
then
stop
"This should not happen (in elpa_print_
setting
s())"
endif
end
subroutine
...
...
@@ -1119,13 +1119,13 @@ module elpa_impl
!> Parameters
!> \param self class(elpa_impl_t) the allocated ELPA object
!> \param file_name string, the name of the file where to save the parameters
subroutine
elpa_s
ave_all_parameter
s
(
self
,
file_name
)
subroutine
elpa_s
tore_setting
s
(
self
,
file_name
)
implicit
none
class
(
elpa_impl_t
),
intent
(
inout
)
::
self
character
(
*
),
intent
(
in
)
::
file_name
if
(
elpa_index_print_
all_parameter
s_c
(
self
%
index
,
file_name
//
c_null_char
)
/
=
1
)
then
stop
"This should not happen (in elpa_s
ave_all_parameter
s())"
if
(
elpa_index_print_
setting
s_c
(
self
%
index
,
file_name
//
c_null_char
)
/
=
1
)
then
stop
"This should not happen (in elpa_s
tore_setting
s())"
endif
end
subroutine
...
...
@@ -1133,13 +1133,13 @@ module elpa_impl
!> Parameters
!> \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
subroutine
elpa_load_
all_parameter
s
(
self
,
file_name
)
subroutine
elpa_load_
setting
s
(
self
,
file_name
)
implicit
none
class
(
elpa_impl_t
),
intent
(
inout
)
::
self
character
(
*
),
intent
(
in
)
::
file_name
if
(
elpa_index_load_
all_parameter
s_c
(
self
%
index
,
file_name
//
c_null_char
)
/
=
1
)
then
stop
"This should not happen (in elpa_load_
all_parameter
s())"
if
(
elpa_index_load_
setting
s_c
(
self
%
index
,
file_name
//
c_null_char
)
/
=
1
)
then
stop
"This should not happen (in elpa_load_
setting
s())"
endif
end
subroutine
...
...
src/elpa_index.c
View file @
5d359402
// This file is part of ELPA.
settings
// This file is part of ELPA.
//
// The ELPA library was originally created by the ELPA consortium,
// consisting of the following organizations:
...
...
@@ -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
DEFAULT_PARAMETERS
[]
=
"* Parameters with default or environment value:
\n
"
;
int
elpa_index_print_
all_parameter
s
(
elpa_index_t
index
,
char
*
file_name
)
{
int
elpa_index_print_
setting
s
(
elpa_index_t
index
,
char
*
file_name
)
{
const
int
LEN
=
10000
;
char
out_structure
[
LEN
],
out_set
[
LEN
],
out_defaults
[
LEN
],
out_nowhere
[
LEN
],
buff
[
100
];
char
(
*
out
)[
LEN
];
...
...
@@ -1331,7 +1331,7 @@ int elpa_index_print_all_parameters(elpa_index_t index, char *file_name) {
if
(
output_to_file
)
{
f
=
fopen
(
file_name
,
"w"
);
if
(
f
==
NULL
){
fprintf
(
stderr
,
"Cannot open file %s in elpa_index_print_
all_parameter
s
\n
"
,
file_name
);
fprintf
(
stderr
,
"Cannot open file %s in elpa_index_print_
setting
s
\n
"
,
file_name
);
return
0
;
}
}
...
...
@@ -1349,7 +1349,7 @@ int elpa_index_print_all_parameters(elpa_index_t index, char *file_name) {
return
1
;
}
int
elpa_index_load_
all_parameter
s
(
elpa_index_t
index
,
char
*
file_name
)
{
int
elpa_index_load_
setting
s
(
elpa_index_t
index
,
char
*
file_name
)
{
const
int
LEN
=
1000
;
char
line
[
LEN
],
s
[
LEN
];
int
n
;
...
...
src/elpa_index.h
View file @
5d359402
...
...
@@ -437,8 +437,8 @@ int elpa_index_print_autotune_parameters(elpa_index_t index, int autotune_level,
/*
!f> interface
!f> function elpa_index_print_
all_parameter
s_c(index, file_name) result(success) &
!f> bind(C, name="elpa_index_print_
all_parameter
s")
!f> function elpa_index_print_
setting
s_c(index, file_name) result(success) &
!f> bind(C, name="elpa_index_print_
setting
s")
!f> import c_int, c_ptr, c_char
!f> type(c_ptr), intent(in), value :: index
!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,
!f> end interface
!f>
*/
int
elpa_index_print_
all_parameter
s
(
elpa_index_t
index
,
char
*
filename
);
int
elpa_index_print_
setting
s
(
elpa_index_t
index
,
char
*
filename
);
/*
!f> interface
!f> function elpa_index_load_
all_parameter
s_c(index, file_name) result(success) &
!f> bind(C, name="elpa_index_load_
all_parameter
s")
!f> function elpa_index_load_
setting
s_c(index, file_name) result(success) &
!f> bind(C, name="elpa_index_load_
setting
s")
!f> import c_int, c_ptr, c_char
!f> type(c_ptr), intent(in), value :: index
!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);
!f> end interface
!f>
*/
int
elpa_index_load_
all_parameter
s
(
elpa_index_t
index
,
char
*
filename
);
int
elpa_index_load_
setting
s
(
elpa_index_t
index
,
char
*
filename
);
/*
!f> interface
...
...
test/Fortran/test.F90
View file @
5d359402
...
...
@@ -604,7 +604,7 @@ program test
! print all parameters
call
e
%
print_
all_parameter
s
()
call
e
%
print_
setting
s
()
#ifdef TEST_ALL_KERNELS
call
e
%
timer_start
(
elpa_int_value_to_string
(
KERNEL_KEY
,
kernel
))
...
...
test/Fortran/test_autotune.F90
View file @
5d359402
...
...
@@ -219,8 +219,8 @@ program test
do
while
(
e
%
autotune_step
(
tune_state
))
iter
=
iter
+1
write
(
iter_string
,
'(I5.5)'
)
iter
!call e%print_
all_parameter
s()
!call e%s
ave_all_parameter
s("saved_parameters_"//trim(iter_string)//".txt")
!call e%print_
setting
s()
!call e%s
tore_setting
s("saved_parameters_"//trim(iter_string)//".txt")
call
e
%
timer_start
(
"eigenvectors: iteration "
//
trim
(
iter_string
))
call
e
%
eigenvectors
(
a
,
ev
,
z
,
error
)
call
e
%
timer_stop
(
"eigenvectors: iteration "
//
trim
(
iter_string
))
...
...
test/Fortran/test_multiple_objs.F90
View file @
5d359402
...
...
@@ -190,19 +190,19 @@ program test
assert_elpa_ok
(
e1
%
setup
())
call
e1
%
s
ave_all_parameter
s
(
"initial_parameters.txt"
)
call
e1
%
s
tore_setting
s
(
"initial_parameters.txt"
)
! try to load parameters into another object
e2
=>
elpa_allocate
()
call
set_basic_params
(
e2
,
na
,
nev
,
na_rows
,
na_cols
,
my_prow
,
my_pcol
)
call
e2
%
load_
all_parameter
s
(
"initial_parameters.txt"
)
call
e2
%
load_
setting
s
(
"initial_parameters.txt"
)
assert_elpa_ok
(
e2
%
setup
())
if
(
myid
==
0
)
print
*
,
"parameters of e1"
call
e1
%
print_
all_parameter
s
()
call
e1
%
print_
setting
s
()
if
(
myid
==
0
)
print
*
,
""
if
(
myid
==
0
)
print
*
,
"parameters of e2"
call
e2
%
print_
all_parameter
s
()
call
e2
%
print_
setting
s
()
e_ptr
=>
e2
...
...
@@ -214,8 +214,8 @@ program test
do
while
(
e_ptr
%
autotune_step
(
tune_state
))
iter
=
iter
+1
write
(
iter_string
,
'(I5.5)'
)
iter
call
e_ptr
%
print_
all_parameter
s
()
call
e_ptr
%
s
ave_all_parameter
s
(
"saved_parameters_"
//
trim
(
iter_string
)//
".txt"
)
call
e_ptr
%
print_
setting
s
()
call
e_ptr
%
s
tore_setting
s
(
"saved_parameters_"
//
trim
(
iter_string
)//
".txt"
)
call
e_ptr
%
timer_start
(
"eigenvectors: iteration "
//
trim
(
iter_string
))
call
e_ptr
%
eigenvectors
(
a
,
ev
,
z
,
error
)
...
...
Andreas Marek
@amarek
mentioned in commit
9653bb75
·
Nov 13, 2018
mentioned in commit
9653bb75
mentioned in commit 9653bb75a33c2a3500414ec1fedfa1dff7e43feb
Toggle commit list
Andreas Marek
@amarek
mentioned in commit
3784b538
·
Nov 13, 2018
mentioned in commit
3784b538
mentioned in commit 3784b5380748517326eec5a2d2344a492a5f0cd4
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment