TABLE OF CONTENTS
- ABINIT/gwls_TimingLog
- m_hamiltonian/close_timing_log
- m_hamiltonian/setup_timing_log
- m_hamiltonian/write_block_lanczos_timing_log
- m_hamiltonian/write_text_block_in_Timing_log
- m_hamiltonian/write_timing_log
ABINIT/gwls_TimingLog [ Modules ]
NAME
gwls_TimingLog
FUNCTION
.
COPYRIGHT
Copyright (C) 2009-2018 ABINIT group (JLJ, BR, MC) This file is distributed under the terms of the GNU General Public License, see ~abinit/COPYING or http://www.gnu.org/copyleft/gpl.txt .
PARENTS
CHILDREN
SOURCE
21 #if defined HAVE_CONFIG_H 22 #include "config.h" 23 #endif 24 25 #include "abi_common.h" 26 27 28 29 module gwls_TimingLog 30 !---------------------------------------------------------------------------------------------------- 31 ! This module will control the opening, writing and closing of a log file which will contain 32 ! timing information. By making this a module, which can be called from anywhere, existing 33 ! routines can easily write to this log without modifying their arguments. 34 !---------------------------------------------------------------------------------------------------- 35 ! local modules 36 use m_gwls_utility 37 38 ! Abinit modules 39 use m_profiling_abi 40 use defs_basis 41 42 use m_io_tools, only : get_unit 43 44 implicit none 45 private
m_hamiltonian/close_timing_log [ Functions ]
[ Top ] [ m_hamiltonian ] [ Functions ]
NAME
close_timing_log
FUNCTION
.
INPUTS
OUTPUT
PARENTS
gwls_sternheimer
CHILDREN
SOURCE
156 subroutine close_timing_log() 157 !-------------------------------------------------------------------------------- 158 ! This routine closes the timing log file. 159 !-------------------------------------------------------------------------------- 160 161 !This section has been created automatically by the script Abilint (TD). 162 !Do not modify the following lines by hand. 163 #undef ABI_FUNC 164 #define ABI_FUNC 'close_timing_log' 165 !End of the abilint section 166 167 implicit none 168 ! ************************************************************************* 169 170 if (head_node_timing) close(io_unit_timing_log) 171 172 end subroutine close_timing_log
m_hamiltonian/setup_timing_log [ Functions ]
[ Top ] [ m_hamiltonian ] [ Functions ]
NAME
setup_timing_log
FUNCTION
.
INPUTS
OUTPUT
PARENTS
gwls_sternheimer
CHILDREN
SOURCE
83 subroutine setup_timing_log() 84 !-------------------------------------------------------------------------------- 85 ! This routine opens the timing log file. 86 !-------------------------------------------------------------------------------- 87 use gwls_hamiltonian, only: mpi_enreg 88 89 !This section has been created automatically by the script Abilint (TD). 90 !Do not modify the following lines by hand. 91 #undef ABI_FUNC 92 #define ABI_FUNC 'setup_timing_log' 93 !End of the abilint section 94 95 implicit none 96 97 98 logical :: file_exists 99 integer :: i 100 101 ! ************************************************************************* 102 103 104 head_node_timing = (mpi_enreg%me == 0) 105 106 107 if (head_node_timing) then 108 inquire(file=timing_log_filename,exist=file_exists) 109 110 i = 0 111 do while (file_exists) 112 i = i+1 113 write (timing_log_filename,'(A,I0,A)') "Timing_Log_",i,".dat" 114 inquire(file=timing_log_filename,exist=file_exists) 115 end do 116 117 118 io_unit_timing_log = get_unit() 119 open(io_unit_timing_log,file=timing_log_filename,status=files_status_new) 120 write(io_unit_timing_log,10) '' 121 write(io_unit_timing_log,10) '#============================================================================================' 122 write(io_unit_timing_log,10) '# This file contains timing information for various routines from gw_sternheimer.' 123 write(io_unit_timing_log,10) '# The purpose of this information is to establish which parts of the computation' 124 write(io_unit_timing_log,10) '# are time consuming.' 125 write(io_unit_timing_log,10) '#============================================================================================' 126 write(io_unit_timing_log,10) '# computation time (seconds) ' 127 write(io_unit_timing_log,10) '#============================================================================================' 128 write(io_unit_timing_log,10) '#' 129 flush(io_unit_timing_log) 130 end if 131 132 10 format(A) 133 134 135 end subroutine setup_timing_log
m_hamiltonian/write_block_lanczos_timing_log [ Functions ]
[ Top ] [ m_hamiltonian ] [ Functions ]
NAME
write_block_lanczos_timing_log
FUNCTION
.
INPUTS
OUTPUT
PARENTS
gwls_GWlanczos
CHILDREN
SOURCE
286 subroutine write_block_lanczos_timing_log(list_time,ntime) 287 !-------------------------------------------------------------------------------- 288 ! This routine writes the timing for the block lanczos routine. 289 !-------------------------------------------------------------------------------- 290 use gwls_hamiltonian, only: mpi_enreg 291 292 !This section has been created automatically by the script Abilint (TD). 293 !Do not modify the following lines by hand. 294 #undef ABI_FUNC 295 #define ABI_FUNC 'write_block_lanczos_timing_log' 296 !End of the abilint section 297 298 implicit none 299 300 301 integer , intent(in) :: ntime 302 real(dp), intent(in) :: list_time(ntime) 303 304 logical :: file_exists 305 306 integer, save :: icounter = 0 307 308 integer :: io_unit 309 310 character(128) :: block_lanczos_log_filename = "block_lanczos_timing.log" 311 312 logical :: head_node 313 314 ! ************************************************************************* 315 316 head_node = (mpi_enreg%me == 0) 317 if (head_node) then 318 319 inquire(file=block_lanczos_log_filename,exist=file_exists) 320 321 io_unit = get_unit() 322 323 if (.not. file_exists) then 324 open(io_unit,file=block_lanczos_log_filename,status=files_status_new) 325 write(io_unit,10) '' 326 write(io_unit,10) '#===============================================================================================' 327 write(io_unit,10) '# This file contains timing information for the block Lanczos algorithm. ' 328 write(io_unit,10) '# The purpose of this information is to establish which parts of the computation' 329 write(io_unit,10) '# are time consuming.' 330 write(io_unit,10) '#===============================================================================================' 331 write(io_unit,10) '# computation time (seconds) ' 332 write(io_unit,10) '#===============================================================================================' 333 write(io_unit,10) '#' 334 else 335 open(io_unit,file=block_lanczos_log_filename,position='append',status=files_status_old) 336 end if 337 338 339 icounter = icounter + 1 340 write(io_unit,10) '' 341 write(io_unit,10) '#==========================' 342 write(io_unit,15) '# Call number ', icounter 343 write(io_unit,10) '#==========================' 344 write(io_unit,10) '' 345 346 write(io_unit,20) ' Apply Matrix Function :', list_time(1) 347 write(io_unit,20) ' Compute Alpha :', list_time(2) 348 write(io_unit,20) ' Update residual array (1-ZGEMM):', list_time(3) 349 write(io_unit,20) ' Update residual array (2-ZGEMM):', list_time(4) 350 write(io_unit,20) ' Orthogonalize :', list_time(5) 351 write(io_unit,20) ' Extract QR factorization :', list_time(6) 352 write(io_unit,10) '-------------------------------------------------------' 353 write(io_unit,20) ' Sum of the above :', sum(list_time(1:6)) 354 write(io_unit,20) ' TOTAL ROUTINE TIME :', list_time(7) 355 356 357 close(io_unit) 358 359 end if 360 361 10 format(A) 362 15 format(A,I5) 363 20 format(A,ES10.2) 364 365 end subroutine write_block_lanczos_timing_log
m_hamiltonian/write_text_block_in_Timing_log [ Functions ]
[ Top ] [ m_hamiltonian ] [ Functions ]
NAME
write_text_block_in_Timing_log
FUNCTION
.
INPUTS
OUTPUT
PARENTS
gwls_ComputeCorrelationEnergy,gwls_DielectricArray
CHILDREN
SOURCE
193 subroutine write_text_block_in_Timing_log(string) 194 !-------------------------------------------------------------------------------- 195 ! This routine opens the timing log file. 196 !-------------------------------------------------------------------------------- 197 198 !This section has been created automatically by the script Abilint (TD). 199 !Do not modify the following lines by hand. 200 #undef ABI_FUNC 201 #define ABI_FUNC 'write_text_block_in_Timing_log' 202 !End of the abilint section 203 204 implicit none 205 206 character(256):: string 207 ! ************************************************************************* 208 209 if (head_node_timing) then 210 write(io_unit_timing_log,10) trim(string) 211 flush(io_unit_timing_log) 212 end if 213 214 10 format(A) 215 216 end subroutine write_text_block_in_Timing_log
m_hamiltonian/write_timing_log [ Functions ]
[ Top ] [ m_hamiltonian ] [ Functions ]
NAME
write_timing_log
FUNCTION
.
INPUTS
OUTPUT
PARENTS
gwls_ComputeCorrelationEnergy,gwls_DielectricArray,gwls_GenerateEpsilon
CHILDREN
SOURCE
237 subroutine write_timing_log(string,time) 238 !-------------------------------------------------------------------------------- 239 ! This routine opens the timing log file. 240 !-------------------------------------------------------------------------------- 241 242 !This section has been created automatically by the script Abilint (TD). 243 !Do not modify the following lines by hand. 244 #undef ABI_FUNC 245 #define ABI_FUNC 'write_timing_log' 246 !End of the abilint section 247 248 implicit none 249 250 251 character(256):: string 252 real(dp) :: time 253 ! ************************************************************************* 254 255 if (head_node_timing) then 256 write(io_unit_timing_log,20) trim(string),time 257 flush(io_unit_timing_log) 258 end if 259 260 261 20 format(A,ES12.4) 262 263 end subroutine write_timing_log