Commit 74c5b3d2 authored by Andreas Marek's avatar Andreas Marek

Optionally do not print times in analytic matrix prep/checks

parent 4d7e9ea3
! (c) Copyright Pavel Kus, 2017, MPCDF ! (c) Copyright Pavel Kus, 2017, MPCDF
! !
! This file is part of ELPA. ! This file is part of ELPA.
! !
...@@ -45,21 +45,28 @@ ...@@ -45,21 +45,28 @@
&MATH_DATATYPE& &MATH_DATATYPE&
&_& &_&
&PRECISION& &PRECISION&
&(na, a, nblk, myid, np_rows, np_cols, my_prow, my_pcol) &(na, a, nblk, myid, np_rows, np_cols, my_prow, my_pcol, print_times)
implicit none implicit none
integer(kind=ik), intent(in) :: na, nblk, myid, np_rows, np_cols, my_prow, my_pcol integer(kind=ik), intent(in) :: na, nblk, myid, np_rows, np_cols, my_prow, my_pcol
MATH_DATATYPE(kind=REAL_DATATYPE), intent(inout) :: a(:,:) MATH_DATATYPE(kind=REAL_DATATYPE), intent(inout) :: a(:,:)
logical, optional :: print_times
integer(kind=ik) :: globI, globJ, locI, locJ, pi, pj, levels(num_primes) logical :: print_timer
integer(kind=ik) :: globI, globJ, locI, locJ, pi, pj, levels(num_primes)
#ifdef HAVE_DETAILED_TIMINGS #ifdef HAVE_DETAILED_TIMINGS
type(timer_t) :: timer type(timer_t) :: timer
#else #else
type(timer_dummy_t) :: timer type(timer_dummy_t) :: timer
#endif #endif
call timer%enable() call timer%enable()
call timer%start("prepare_matrix_analytic") call timer%start("prepare_matrix_analytic")
print_timer = .true.
if (present(print_times)) then
print_timer = print_times
endif
! for debug only, do it systematicaly somehow ... unit tests ! for debug only, do it systematicaly somehow ... unit tests
call check_module_sanity_& call check_module_sanity_&
&MATH_DATATYPE& &MATH_DATATYPE&
...@@ -102,7 +109,7 @@ ...@@ -102,7 +109,7 @@
call timer%stop("loop") call timer%stop("loop")
call timer%stop("prepare_matrix_analytic") call timer%stop("prepare_matrix_analytic")
if(myid == 0) then if(myid == 0 .and. print_timer) then
call timer%print("prepare_matrix_analytic") call timer%print("prepare_matrix_analytic")
end if end if
call timer%free() call timer%free()
...@@ -112,7 +119,8 @@ ...@@ -112,7 +119,8 @@
&MATH_DATATYPE& &MATH_DATATYPE&
&_& &_&
&PRECISION& &PRECISION&
&(na, nev, ev, z, nblk, myid, np_rows, np_cols, my_prow, my_pcol, check_all_evals, check_eigenvectors) result(status) &(na, nev, ev, z, nblk, myid, np_rows, np_cols, my_prow, my_pcol, check_all_evals, &
check_eigenvectors, print_times) result(status)
implicit none implicit none
#include "../../src/general/precision_kinds.F90" #include "../../src/general/precision_kinds.F90"
integer(kind=ik), intent(in) :: na, nev, nblk, myid, np_rows, & integer(kind=ik), intent(in) :: na, nev, nblk, myid, np_rows, &
...@@ -149,7 +157,8 @@ ...@@ -149,7 +157,8 @@
num_checked_evals num_checked_evals
integer(kind=ik) :: max_idx_array(np_rows * np_cols), & integer(kind=ik) :: max_idx_array(np_rows * np_cols), &
rank rank
logical, optional :: print_times
logical :: print_timer
#ifdef HAVE_DETAILED_TIMINGS #ifdef HAVE_DETAILED_TIMINGS
type(timer_t) :: timer type(timer_t) :: timer
...@@ -161,6 +170,11 @@ ...@@ -161,6 +170,11 @@
call timer%start("check_correctness_analytic") call timer%start("check_correctness_analytic")
print_timer = .true.
if (present(print_times)) then
print_timer = print_times
endif
if(.not. decompose(na, levels)) then if(.not. decompose(na, levels)) then
print *, "can not decomopse matrix size" print *, "can not decomopse matrix size"
stop 1 stop 1
...@@ -291,7 +305,7 @@ ...@@ -291,7 +305,7 @@
endif endif
call timer%stop("check_correctness_analytic") call timer%stop("check_correctness_analytic")
if(myid == 0) then if(myid == 0 .and. print_timer) then
call timer%print("check_correctness_analytic") call timer%print("check_correctness_analytic")
end if end if
call timer%free() call timer%free()
......
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