IO: Account time for disk operations (for snapshots).
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
063a6b1db4
commit
5213004734
32
src/io.F90
32
src/io.F90
@ -33,9 +33,7 @@ module io
|
||||
! import external subroutines
|
||||
!
|
||||
use blocks, only : pointer_meta
|
||||
#ifdef PROFILE
|
||||
use timers, only : set_timer, start_timer, stop_timer
|
||||
#endif /* PROFILE */
|
||||
|
||||
! module variables are not implicit by default
|
||||
!
|
||||
@ -89,9 +87,10 @@ module io
|
||||
#endif /* HDF5 */
|
||||
end interface
|
||||
|
||||
#ifdef PROFILE
|
||||
! timer indices
|
||||
!
|
||||
integer , save :: iio
|
||||
#ifdef PROFILE
|
||||
integer , save :: ioi, iow, ios
|
||||
#endif /* PROFILE */
|
||||
|
||||
@ -204,9 +203,10 @@ module io
|
||||
!
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
#ifdef PROFILE
|
||||
! set timer descriptions
|
||||
!
|
||||
call set_timer('SNAPSHOTS I/O' , iio)
|
||||
#ifdef PROFILE
|
||||
call set_timer('io:: initialization' , ioi)
|
||||
call set_timer('io:: snapshot writing', iow)
|
||||
call set_timer('io:: snapshot reading', ios)
|
||||
@ -360,12 +360,20 @@ module io
|
||||
call start_timer(ios)
|
||||
#endif /* PROFILE */
|
||||
|
||||
! start accounting time for I/O
|
||||
!
|
||||
call start_timer(iio)
|
||||
|
||||
#ifdef HDF5
|
||||
! read HDF5 restart file and rebuild the meta and data block structures
|
||||
!
|
||||
call read_restart_snapshot_h5(iret)
|
||||
#endif /* HDF5 */
|
||||
|
||||
! stop accounting time for I/O
|
||||
!
|
||||
call stop_timer(iio)
|
||||
|
||||
! calculate the shift of the snapshot counter, and the next snapshot time
|
||||
!
|
||||
ishift = int(time / hsnap) - isnap + 1
|
||||
@ -421,12 +429,20 @@ module io
|
||||
call start_timer(iow)
|
||||
#endif /* PROFILE */
|
||||
|
||||
! start accounting time for I/O
|
||||
!
|
||||
call start_timer(iio)
|
||||
|
||||
#ifdef HDF5
|
||||
! store restart file
|
||||
!
|
||||
call write_restart_snapshot_h5(nrun, iret)
|
||||
#endif /* HDF5 */
|
||||
|
||||
! stop accounting time for I/O
|
||||
!
|
||||
call stop_timer(iio)
|
||||
|
||||
! increase the restart snapshot counter
|
||||
!
|
||||
irest = irest + 1
|
||||
@ -476,6 +492,10 @@ module io
|
||||
call start_timer(iow)
|
||||
#endif /* PROFILE */
|
||||
|
||||
! start accounting time for I/O
|
||||
!
|
||||
call start_timer(iio)
|
||||
|
||||
#ifdef HDF5
|
||||
! store variable snapshot file
|
||||
!
|
||||
@ -486,6 +506,10 @@ module io
|
||||
end if
|
||||
#endif /* HDF5 */
|
||||
|
||||
! stop accounting time for I/O
|
||||
!
|
||||
call stop_timer(iio)
|
||||
|
||||
! increase the snapshot counter and calculate the next snapshot time
|
||||
!
|
||||
isnap = isnap + 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user