Skip to content
GitLab
Menu
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
a87ab950
Commit
a87ab950
authored
Aug 14, 2018
by
Pavel Kus
Browse files
output fix and few improvements
parent
fdbfc2a9
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/elpa_index.c
View file @
a87ab950
...
...
@@ -706,11 +706,11 @@ static int gpu_is_valid(elpa_index_t index, int n, int new_value) {
static
int
band_to_full_cardinality
(
elpa_index_t
index
)
{
return
10
;
}
static
int
band_to_full_enumerate
(
elpa_index_t
index
,
int
i
)
{
return
i
+
1
;
}
// TODO shouldnt it be only for ELPA2??
static
int
band_to_full_is_valid
(
elpa_index_t
index
,
int
n
,
int
new_value
)
{
int
max_block
=
10
;
return
(
1
<=
new_value
)
&&
(
new_value
<=
max_block
);
...
...
@@ -985,19 +985,23 @@ int elpa_index_set_autotune_parameters(elpa_index_t index, int autotune_level, i
int
current_cpy
=
current
;
char
buff
[
100
];
int
debug
=
elpa_index_get_int_value
(
index
,
"debug"
,
NULL
);
int
is_process_id_zero
=
elpa_index_get_int_value
(
index
,
"is_process_id_zero"
,
NULL
);
//if(is_process_id_zero) fprintf(stderr, "***Trying a new autotuning index %d\n", current);
for
(
int
i
=
0
;
i
<
nelements
(
int_entries
);
i
++
)
{
if
(
is_tunable
(
index
,
i
,
autotune_level
,
autotune_domain
))
{
int
value
=
int_entries
[
i
].
enumerate
(
index
,
current_cpy
%
int_entries
[
i
].
cardinality
(
index
));
//if(is_process_id_zero) fprintf(stderr, " * val[%d] = %d -> %d\n", i, current_cpy % int_entries[i].cardinality(index), value);
/* Try to set option i to that value */
if
(
int_entries
[
i
].
valid
(
index
,
i
,
value
))
{
index
->
int_options
.
values
[
i
]
=
value
;
}
else
{
//if(is_process_id_zero) fprintf(stderr, " *NOT VALID becaluse of i %d (%s) and value %d translated to %d\n", i, int_entries[i].base.name, current_cpy % int_entries[i].cardinality(index), value);
return
0
;
}
current_cpy
/=
int_entries
[
i
].
cardinality
(
index
);
}
}
int
is_process_id_zero
=
elpa_index_get_int_value
(
index
,
"is_process_id_zero"
,
NULL
);
if
(
debug
==
1
&&
is_process_id_zero
)
{
fprintf
(
stderr
,
"
\n
*** AUTOTUNING: setting a new combination of parameters, idx %d ***
\n
"
,
current
);
elpa_index_print_autotune_parameters
(
index
,
autotune_level
,
autotune_domain
);
...
...
@@ -1030,7 +1034,7 @@ int elpa_index_print_autotune_state(elpa_index_t index, int autotune_level, int
FILE
*
f
;
if
(
file_name
==
""
)
f
=
std
err
;
f
=
std
out
;
else
f
=
fopen
(
file_name
,
"w"
);
...
...
@@ -1050,6 +1054,8 @@ int elpa_index_print_autotune_state(elpa_index_t index, int autotune_level, int
}
int
is_process_id_zero
=
elpa_index_get_int_value
(
index
,
"is_process_id_zero"
,
NULL
);
if
(
is_process_id_zero
)
{
if
(
file_name
==
""
)
fprintf
(
f
,
"
\n
"
);
fprintf
(
f
,
"*** AUTOTUNING STATE ***
\n
"
);
fprintf
(
f
,
"** This is the state of the autotuning object
\n
"
);
fprintf
(
f
,
"autotune level = %d
\n
"
,
autotune_level
);
...
...
@@ -1069,7 +1075,7 @@ int elpa_index_print_autotune_state(elpa_index_t index, int autotune_level, int
fprintf
(
f
,
"** The following parameters would be autotuned on the selected autotuning level, but were overridden by the set() method
\n
"
);
for
(
int
i
=
0
;
i
<
nelements
(
int_entries
);
i
++
)
{
if
(
is_tunable_but_overriden
(
index
,
i
,
autotune_level
,
autotune_domain
))
{
elpa_index_print_int_parameter
(
index
_best
,
buff
,
i
);
elpa_index_print_int_parameter
(
index
,
buff
,
i
);
fprintf
(
f
,
"%s"
,
buff
);
}
}
...
...
@@ -1107,7 +1113,9 @@ int elpa_index_print_all_parameters(elpa_index_t index) {
elpa_index_print_int_parameter
(
index
,
buff
,
i
);
sprintf
(
*
out
,
"%s%s"
,
*
out
,
buff
);
}
fprintf
(
stderr
,
"%s
\n
%s
\n
%s
\n
"
,
out_structure
,
out_set
,
out_defaults
);
fprintf
(
stdout
,
"*** ELPA STATE ***
\n
"
);
fprintf
(
stdout
,
"%s
\n
%s
\n
%s"
,
out_structure
,
out_set
,
out_defaults
);
fprintf
(
stdout
,
"*** END OF ELPA STATE ***
\n
"
);
}
return
1
;
}
test/Fortran/test_autotune.F90
View file @
a87ab950
...
...
@@ -204,7 +204,7 @@ program test
call
e
%
set
(
"debug"
,
1
)
call
e
%
set
(
"gpu"
,
0
)
call
e
%
set
(
"max_stored_rows"
,
30
)
!
call e%set("max_stored_rows",
15, error
)
assert_elpa_ok
(
e
%
setup
())
...
...
@@ -213,10 +213,13 @@ program test
tune_state
=>
e
%
autotune_setup
(
ELPA_AUTOTUNE_MEDIUM
,
AUTOTUNE_DOMAIN
,
error
)
assert_elpa_ok
(
error
)
assert_elpa_ok
(
error
)
iter
=
0
do
while
(
e
%
autotune_step
(
tune_state
))
iter
=
iter
+1
write
(
iter_string
,
'(I5.5)'
)
iter
call
e
%
print_all_parameters
()
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
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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