IO: Add module subroutines profiling.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2013-12-27 18:07:10 -02:00
parent 7a4e402c8a
commit f435a44065
2 changed files with 67 additions and 1 deletions

View File

@ -30,6 +30,12 @@
! !
module io module io
#ifdef PROFILE
! import external subroutines
!
use timers, only : set_timer, start_timer, stop_timer
#endif /* PROFILE */
! include external procedures ! include external procedures
! !
use blocks, only : pointer_meta use blocks, only : pointer_meta
@ -38,6 +44,12 @@ module io
! !
implicit none implicit none
#ifdef PROFILE
! timer indices
!
integer , save :: ioi, iow, ios
#endif /* PROFILE */
! data file type ! data file type
! !
character , save :: ftype = "p" character , save :: ftype = "p"
@ -106,6 +118,18 @@ module io
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
#ifdef PROFILE
! set timer descriptions
!
call set_timer('I/O initialization' , ioi)
call set_timer('I/O snapshot writing', iow)
call set_timer('I/O snapshot reading', ios)
! start accounting time for module initialization/finalization
!
call start_timer(ioi)
#endif /* PROFILE */
! read values of the module parameters ! read values of the module parameters
! !
call get_parameter_integer("nres" , nres ) call get_parameter_integer("nres" , nres )
@ -129,6 +153,12 @@ module io
with_ghosts = .false. with_ghosts = .false.
end select end select
#ifdef PROFILE
! stop accounting time for module initialization/finalization
!
call stop_timer(ioi)
#endif /* PROFILE */
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
end subroutine initialize_io end subroutine initialize_io
@ -155,6 +185,12 @@ module io
! !
if (dtout <= 0.0d+0 .or. nfile > (int(t / dtout))) return if (dtout <= 0.0d+0 .or. nfile > (int(t / dtout))) return
#ifdef PROFILE
! start accounting time for the data writing
!
call start_timer(iow)
#endif /* PROFILE */
#ifdef HDF5 #ifdef HDF5
! store data file ! store data file
! !
@ -165,6 +201,12 @@ module io
! !
nfile = nfile + 1 nfile = nfile + 1
#ifdef PROFILE
! stop accounting time for the data writing
!
call stop_timer(iow)
#endif /* PROFILE */
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
end subroutine write_data end subroutine write_data
@ -185,6 +227,12 @@ module io
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
#ifdef PROFILE
! start accounting time for the data writing
!
call start_timer(iow)
#endif /* PROFILE */
! increase the file counter ! increase the file counter
! !
nrest = nrest + 1 nrest = nrest + 1
@ -195,6 +243,12 @@ module io
call write_data_h5('r') call write_data_h5('r')
#endif /* HDF5 */ #endif /* HDF5 */
#ifdef PROFILE
! stop accounting time for the data writing
!
call stop_timer(iow)
#endif /* PROFILE */
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
end subroutine write_restart_data end subroutine write_restart_data
@ -216,6 +270,12 @@ module io
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
#ifdef PROFILE
! start accounting time for the data reading
!
call start_timer(ios)
#endif /* PROFILE */
! set restart file number ! set restart file number
! !
nrest = nres nrest = nres
@ -226,6 +286,12 @@ module io
call read_data_h5() call read_data_h5()
#endif /* HDF5 */ #endif /* HDF5 */
#ifdef PROFILE
! stop accounting time for the data reading
!
call stop_timer(ios)
#endif /* PROFILE */
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
end subroutine restart_job end subroutine restart_job

View File

@ -140,7 +140,7 @@ integrals.o : integrals.F90 blocks.o coordinates.o equations.o \
evolution.o mpitools.o evolution.o mpitools.o
interpolations.o : interpolations.F90 blocks.o coordinates.o parameters.o interpolations.o : interpolations.F90 blocks.o coordinates.o parameters.o
io.o : io.F90 blocks.o coordinates.o equations.o error.o \ io.o : io.F90 blocks.o coordinates.o equations.o error.o \
evolution.o mpitools.o random.o refinement.o evolution.o mpitools.o random.o refinement.o timers.o
mesh.o : mesh.F90 blocks.o coordinates.o domains.o equations.o \ mesh.o : mesh.F90 blocks.o coordinates.o domains.o equations.o \
error.o interpolations.o mpitools.o problems.o refinement.o \ error.o interpolations.o mpitools.o problems.o refinement.o \
timers.o timers.o