Commit d0c0e47e authored by Matthias Redies's avatar Matthias Redies

move timing summary to out-file

parent 3ee87fdc
...@@ -16,7 +16,7 @@ MODULE m_juDFT_time ...@@ -16,7 +16,7 @@ MODULE m_juDFT_time
IMPLICIT NONE IMPLICIT NONE
! List of different timers ! List of different timers
PRIVATE PRIVATE
INTEGER, PARAMETER :: max_subtimer = 5 ! blocks of subtimers are allocated in this size INTEGER, PARAMETER :: max_subtimer = 5 ! blocks of subtimers are allocated in this size
REAL :: min_time = 0.02 ! minimal time to display in output (part of total) REAL :: min_time = 0.02 ! minimal time to display in output (part of total)
LOGICAL :: l_debug !write out each start& stop of timer LOGICAL :: l_debug !write out each start& stop of timer
REAL :: debugtimestart = -1.0 REAL :: debugtimestart = -1.0
...@@ -348,8 +348,7 @@ CONTAINS ...@@ -348,8 +348,7 @@ CONTAINS
USE m_judft_usage USE m_judft_usage
IMPLICIT NONE IMPLICIT NONE
LOGICAL, INTENT(IN), OPTIONAL::stdout LOGICAL, INTENT(IN), OPTIONAL::stdout
INTEGER :: fn, irank = 0 INTEGER :: irank = 0
LOGICAL :: l_out
CHARACTER(len=:), allocatable :: json_str CHARACTER(len=:), allocatable :: json_str
#ifdef CPP_MPI #ifdef CPP_MPI
INCLUDE "mpif.h" INCLUDE "mpif.h"
...@@ -358,45 +357,28 @@ CONTAINS ...@@ -358,45 +357,28 @@ CONTAINS
CALL MPI_COMM_RANK(MPI_COMM_WORLD, irank, err) CALL MPI_COMM_RANK(MPI_COMM_WORLD, irank, err)
#endif #endif
IF (.NOT. ASSOCIATED(globaltimer)) RETURN !write nothing if no timing recorded IF (.NOT. ASSOCIATED(globaltimer)) RETURN !write nothing if no timing recorded
l_out = .FALSE.
IF (PRESENT(stdout)) l_out = stdout
IF (l_out) THEN
fn = 6
ELSE
IF (irank > 0) RETURN
fn = 2
OPEN (2, FILE='juDFT_times', STATUS="replace")
ENDIF
globaltimer%time = cputime() - globaltimer%starttime
globaltimer%starttime = cputime()
WRITE (fn, "('Total execution time: ',i0,'sec')") INT(globaltimer%time)
CALL add_usage_data("Runtime", globaltimer%time)
CALL priv_writetimes_longest(globaltimer, fid=fn)
WRITE (fn, "('Total execution time: ',i0,'sec, minimal timing printed:',i0,'sec')") &
INT(globaltimer%time), INT(min_time*globaltimer%time)
#ifdef CPP_MPI
CALL MPI_COMM_SIZE(MPI_COMM_WORLD, isize, err)
WRITE (fn, *) "Program used ", isize, " PE"
#endif
CALL priv_writetimes(globaltimer, 1, fn)
WRITE (fn, *) IF (irank == 0) THEN
WRITE (fn, *) "-------------------------------------------------" globaltimer%time = cputime() - globaltimer%starttime
WRITE (fn, *) globaltimer%starttime = cputime()
WRITE (fn, *) "Total timings:" WRITE (6, "('\n\nTotal execution time: ',i0,'sec')") INT(globaltimer%time)
min_time = 0.0 CALL add_usage_data("Runtime", globaltimer%time)
CALL priv_writetimes(globaltimer, 1, fn) CALL priv_writetimes_longest(globaltimer, fid=6)
FLUSH(fn)
IF (.NOT. l_out) CLOSE (2)
json_str = ""
call priv_genjson(globaltimer, 1, json_str)
open(32, file="juDFT_times.json")
write (32,"(A)") json_str
close(32)
WRITE (6, "('Total execution time: ',i0,'sec, minimal timing printed:',i0,'sec')") &
INT(globaltimer%time), INT(min_time*globaltimer%time)
#ifdef CPP_MPI
CALL MPI_COMM_SIZE(MPI_COMM_WORLD, isize, err)
WRITE (6, *) "Program used ", isize, " PE"
#endif
CALL priv_writetimes(globaltimer, 1, 6)
json_str = ""
call priv_genjson(globaltimer, 1, json_str)
open(32, file="juDFT_times.json")
write (32,"(A)") json_str
close(32)
ENDIF
END SUBROUTINE writetimes END SUBROUTINE writetimes
! writes all times to out.xml file ! writes all times to out.xml file
......
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