Commit 0dc40c32 authored by Pavel Kus's avatar Pavel Kus

reuisng print_tunable parameters routine

parent 9398ac60
......@@ -1071,7 +1071,7 @@ module elpa_impl
print *, "The following settings were found to be best:"
print *, "Best, i = ", ts_impl%min_loc, "best time = ", ts_impl%min_val
if (elpa_index_print_autotune_parameters_c(self%index, ts_impl%level, ts_impl%domain, ts_impl%min_loc) /= 1) then
if (elpa_index_print_autotune_parameters_c(self%index, ts_impl%level, ts_impl%domain) /= 1) then
stop "This should not happen (in elpa_autotune_print_best())"
endif
end subroutine
......
......@@ -989,14 +989,10 @@ int elpa_index_set_autotune_parameters(elpa_index_t index, int autotune_level, i
n /= int_entries[i].cardinality(index);
}
}
if (debug == 1) {
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", n_original);
for (int i = 0; i < nelements(int_entries); i++) {
if (is_tunable(index, i, autotune_level, autotune_domain)) {
elpa_index_print_int_parameter(index, buff, i);
fprintf(stderr, "%s", buff);
}
}
elpa_index_print_autotune_parameters(index, autotune_level, autotune_domain);
fprintf(stderr, "***\n\n");
}
......@@ -1004,30 +1000,17 @@ int elpa_index_set_autotune_parameters(elpa_index_t index, int autotune_level, i
return 1;
}
int elpa_index_print_autotune_parameters(elpa_index_t index, int autotune_level, int autotune_domain, int n) {
int elpa_index_print_autotune_parameters(elpa_index_t index, int autotune_level, int autotune_domain) {
char buff[100];
//int debug = elpa_index_get_int_value(index, "debug", NULL);
//for (int i = 0; i < nelements(int_entries); i++) {
// if (is_tunable(index, i, autotune_level, autotune_domain)) {
// int value = int_entries[i].enumerate(n % int_entries[i].cardinality());
// /* Try to set option i to that value */
// if (int_entries[i].valid(index, i, value)) {
// index->int_options.values[i] = value;
// } else {
// return 0;
// }
// n /= int_entries[i].cardinality();
// }
//}
for (int i = 0; i < nelements(int_entries); i++) {
if (is_tunable(index, i, autotune_level, autotune_domain)) {
elpa_index_print_int_parameter(index, buff, i);
fprintf(stderr, "%s", buff);
int is_process_id_zero = elpa_index_get_int_value(index, "is_process_id_zero", NULL);
if (is_process_id_zero) {
for (int i = 0; i < nelements(int_entries); i++) {
if (is_tunable(index, i, autotune_level, autotune_domain)) {
elpa_index_print_int_parameter(index, buff, i);
fprintf(stderr, "%s", buff);
}
}
}
fprintf(stderr, "\n");
/* Could set all values */
return 1;
}
......
......@@ -423,17 +423,17 @@ int elpa_index_set_autotune_parameters(elpa_index_t index, int autotune_level, i
/*
!f> interface
!f> function elpa_index_print_autotune_parameters_c(index, autotune_level, autotune_domain, n) result(success) &
!f> function elpa_index_print_autotune_parameters_c(index, autotune_level, autotune_domain) result(success) &
!f> bind(C, name="elpa_index_print_autotune_parameters")
!f> import c_int, c_ptr, c_char
!f> type(c_ptr), intent(in), value :: index
!f> integer(kind=c_int), intent(in), value :: autotune_level, autotune_domain, n
!f> integer(kind=c_int), intent(in), value :: autotune_level, autotune_domain
!f> integer(kind=c_int) :: success
!f> end function
!f> end interface
!f>
*/
int elpa_index_print_autotune_parameters(elpa_index_t index, int autotune_level, int autotune_domain, int n);
int elpa_index_print_autotune_parameters(elpa_index_t index, int autotune_level, int autotune_domain);
/*
!f> interface
......
......@@ -91,6 +91,7 @@ program test
use test_blacs_infrastructure
use test_check_correctness
use test_analytic
use iso_fortran_env
#ifdef HAVE_REDIRECT
use test_redirect
......@@ -206,7 +207,7 @@ program test
if (myid == 0) print *, ""
tune_state => e%autotune_setup(ELPA_AUTOTUNE_MEDIUM, AUTOTUNE_DOMAIN, error)
tune_state => e%autotune_setup(ELPA_AUTOTUNE_FAST, AUTOTUNE_DOMAIN, error)
assert_elpa_ok(error)
iter=0
......@@ -231,6 +232,7 @@ program test
call e%autotune_set_best(tune_state)
if (myid .eq. 0) then
print *, "The best combination found by the autotuning:"
flush(output_unit)
call e%autotune_print_best(tune_state)
endif
! de-allocate autotune object
......
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