TABLE OF CONTENTS


ABINIT/m_gwls_TimingLog [ Modules ]

[ Top ] [ Modules ]

NAME

 m_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 module m_gwls_TimingLog
29 !----------------------------------------------------------------------------------------------------
30 ! This module will control the opening, writing and closing of a log file which will contain
31 ! timing information. By making this a module, which can be called from anywhere, existing
32 ! routines can easily write to this log without modifying their arguments.
33 !----------------------------------------------------------------------------------------------------
34 ! local modules
35 use m_gwls_utility
36 
37 ! Abinit modules
38 use m_abicore
39 use defs_basis
40 
41 use m_io_tools,  only : get_unit
42 
43 implicit none
44 private

m_hamiltonian/close_timing_log [ Functions ]

[ Top ] [ m_hamiltonian ] [ Functions ]

NAME

  close_timing_log

FUNCTION

  .

INPUTS

OUTPUT

PARENTS

      gwls_sternheimer

CHILDREN

SOURCE

155 subroutine close_timing_log()
156 !--------------------------------------------------------------------------------
157 ! This routine closes the timing log file.
158 !--------------------------------------------------------------------------------
159 
160 !This section has been created automatically by the script Abilint (TD).
161 !Do not modify the following lines by hand.
162 #undef ABI_FUNC
163 #define ABI_FUNC 'close_timing_log'
164 !End of the abilint section
165 
166 implicit none
167 ! *************************************************************************
168 
169 if (head_node_timing) close(io_unit_timing_log)
170 
171 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

 82 subroutine setup_timing_log()
 83 !--------------------------------------------------------------------------------
 84 ! This routine opens the timing log file.
 85 !--------------------------------------------------------------------------------
 86 use m_gwls_hamiltonian, only: mpi_enreg
 87 
 88 !This section has been created automatically by the script Abilint (TD).
 89 !Do not modify the following lines by hand.
 90 #undef ABI_FUNC
 91 #define ABI_FUNC 'setup_timing_log'
 92 !End of the abilint section
 93 
 94 implicit none
 95 
 96 
 97 logical        :: file_exists
 98 integer        :: i
 99 
100 ! *************************************************************************
101 
102 
103 head_node_timing = (mpi_enreg%me == 0)
104 
105 
106 if (head_node_timing) then
107   inquire(file=timing_log_filename,exist=file_exists)
108 
109   i = 0
110   do while (file_exists)
111   i = i+1
112   write (timing_log_filename,'(A,I0,A)') "Timing_Log_",i,".dat"
113   inquire(file=timing_log_filename,exist=file_exists)
114   end do
115 
116 
117   io_unit_timing_log = get_unit()
118   open(io_unit_timing_log,file=timing_log_filename,status=files_status_new)
119   write(io_unit_timing_log,10) ''
120   write(io_unit_timing_log,10) '#============================================================================================'
121   write(io_unit_timing_log,10) '# This file contains timing information for various routines from gw_sternheimer.'
122   write(io_unit_timing_log,10) '# The purpose of this information is to establish which parts of the computation'
123   write(io_unit_timing_log,10) '# are time consuming.'
124   write(io_unit_timing_log,10) '#============================================================================================'
125   write(io_unit_timing_log,10) '#   computation                                     time (seconds)       '
126   write(io_unit_timing_log,10) '#============================================================================================'
127   write(io_unit_timing_log,10) '#'
128   flush(io_unit_timing_log)
129 end if
130 
131 10 format(A)
132 
133 
134 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

285 subroutine write_block_lanczos_timing_log(list_time,ntime)
286 !--------------------------------------------------------------------------------
287 ! This routine writes the timing for the block lanczos routine.
288 !--------------------------------------------------------------------------------
289 use m_gwls_hamiltonian, only: mpi_enreg
290 
291 !This section has been created automatically by the script Abilint (TD).
292 !Do not modify the following lines by hand.
293 #undef ABI_FUNC
294 #define ABI_FUNC 'write_block_lanczos_timing_log'
295 !End of the abilint section
296 
297 implicit none
298 
299 
300 integer , intent(in) :: ntime
301 real(dp), intent(in) :: list_time(ntime)
302 
303 logical        :: file_exists
304 
305 integer, save  :: icounter = 0
306 
307 integer        :: io_unit
308 
309 character(128) :: block_lanczos_log_filename = "block_lanczos_timing.log"
310 
311 logical        :: head_node
312 
313 ! *************************************************************************
314 
315 head_node = (mpi_enreg%me == 0)
316 if (head_node) then
317 
318   inquire(file=block_lanczos_log_filename,exist=file_exists)
319 
320   io_unit = get_unit()
321 
322   if (.not. file_exists) then
323     open(io_unit,file=block_lanczos_log_filename,status=files_status_new)
324     write(io_unit,10) ''
325     write(io_unit,10) '#==============================================================================================='
326     write(io_unit,10) '# This file contains timing information for the block Lanczos algorithm.                        '
327     write(io_unit,10) '# The purpose of this information is to establish which parts of the computation'
328     write(io_unit,10) '# are time consuming.'
329     write(io_unit,10) '#==============================================================================================='
330     write(io_unit,10) '#   computation                                     time (seconds)       '
331     write(io_unit,10) '#==============================================================================================='
332     write(io_unit,10) '#'
333   else 
334     open(io_unit,file=block_lanczos_log_filename,position='append',status=files_status_old)
335   end if
336 
337 
338   icounter = icounter + 1 
339   write(io_unit,10) ''
340   write(io_unit,10) '#=========================='
341   write(io_unit,15) '# Call number ', icounter 
342   write(io_unit,10) '#=========================='
343   write(io_unit,10) ''
344 
345   write(io_unit,20) '        Apply Matrix Function          :', list_time(1)
346   write(io_unit,20) '        Compute Alpha                  :', list_time(2)
347   write(io_unit,20) '        Update residual array (1-ZGEMM):', list_time(3)
348   write(io_unit,20) '        Update residual array (2-ZGEMM):', list_time(4)
349   write(io_unit,20) '        Orthogonalize                  :', list_time(5)
350   write(io_unit,20) '        Extract QR factorization       :', list_time(6)
351   write(io_unit,10) '-------------------------------------------------------'
352   write(io_unit,20) '        Sum of the above               :', sum(list_time(1:6))
353   write(io_unit,20) '        TOTAL ROUTINE TIME             :', list_time(7)
354 
355 
356   close(io_unit)
357 
358 end if 
359 
360 10 format(A)
361 15 format(A,I5)
362 20 format(A,ES10.2)
363 
364 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

192 subroutine write_text_block_in_Timing_log(string)
193 !--------------------------------------------------------------------------------
194 ! This routine opens the timing log file.
195 !--------------------------------------------------------------------------------
196 
197 !This section has been created automatically by the script Abilint (TD).
198 !Do not modify the following lines by hand.
199 #undef ABI_FUNC
200 #define ABI_FUNC 'write_text_block_in_Timing_log'
201 !End of the abilint section
202 
203 implicit none
204 
205 character(256):: string
206 ! *************************************************************************
207 
208 if (head_node_timing) then
209   write(io_unit_timing_log,10) trim(string)
210   flush(io_unit_timing_log)
211 end if
212 
213 10 format(A)
214 
215 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

236 subroutine write_timing_log(string,time)
237 !--------------------------------------------------------------------------------
238 ! This routine opens the timing log file.
239 !--------------------------------------------------------------------------------
240 
241 !This section has been created automatically by the script Abilint (TD).
242 !Do not modify the following lines by hand.
243 #undef ABI_FUNC
244 #define ABI_FUNC 'write_timing_log'
245 !End of the abilint section
246 
247 implicit none
248 
249 
250 character(256):: string
251 real(dp)     :: time
252 ! *************************************************************************
253 
254 if (head_node_timing) then
255   write(io_unit_timing_log,20) trim(string),time
256   flush(io_unit_timing_log)
257 end if
258 
259 
260 20 format(A,ES12.4)
261 
262 end subroutine write_timing_log