From 322b8a141b3d411d21b8a9410a2a219a860d3e58 Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Thu, 9 Mar 2017 16:26:28 -0300 Subject: [PATCH 1/4] USER_PROBLEM: Reset acc in gravitational_acceleration_user(). Signed-off-by: Grzegorz Kowal --- src/user_problem.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/user_problem.F90 b/src/user_problem.F90 index 13624a6..a466f41 100644 --- a/src/user_problem.F90 +++ b/src/user_problem.F90 @@ -407,6 +407,10 @@ module user_problem call start_timer(img) #endif /* PROFILE */ +! reset gravitational acceleration +! + acc(:) = 0.0d+00 + #ifdef PROFILE ! stop accounting time for the gravitational acceleration calculation ! From 31bf3006b7c507a448f3d3d9da1fbcb75cde4032 Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Thu, 9 Mar 2017 16:28:30 -0300 Subject: [PATCH 2/4] GRAVITY: Reset acc in gacc_none(). Signed-off-by: Grzegorz Kowal --- src/gravity.F90 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gravity.F90 b/src/gravity.F90 index 200fb64..82824ec 100644 --- a/src/gravity.F90 +++ b/src/gravity.F90 @@ -216,11 +216,11 @@ module gravity ! ! t, dt - time and the time increment; ! x, y, z - rectangular coordinates; -! gacc - vector of the gravitational acceleration; +! acc - vector of the gravitational acceleration; ! !=============================================================================== ! - subroutine gacc_none(t, dt, x, y, z, gacc) + subroutine gacc_none(t, dt, x, y, z, acc) ! local variables are not implicit by default ! @@ -230,7 +230,7 @@ module gravity ! real(kind=8) , intent(in) :: t, dt real(kind=8) , intent(in) :: x, y, z - real(kind=8), dimension(3), intent(out) :: gacc + real(kind=8), dimension(3), intent(out) :: acc ! !------------------------------------------------------------------------------- ! @@ -240,6 +240,10 @@ module gravity call start_timer(imc) #endif /* PROFILE */ +! reset gravitational acceleration +! + acc(:) = 0.0d+00 + #ifdef PROFILE ! stop accounting time for the gravitational acceleration calculation ! From fe0e43b095160338631a565aded722b39fbdccfd Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Thu, 9 Mar 2017 16:31:16 -0300 Subject: [PATCH 3/4] IO: Reset iret in read_restart_snapshot() and write_restart_snapshot(). Signed-off-by: Grzegorz Kowal --- src/io.F90 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/io.F90 b/src/io.F90 index 1381bb2..9dfbf8c 100644 --- a/src/io.F90 +++ b/src/io.F90 @@ -360,6 +360,10 @@ module io call start_timer(ios) #endif /* PROFILE */ +! reset the return flag +! + iret = 0 + #ifdef HDF5 ! read HDF5 restart file and rebuild the meta and data block structures ! @@ -411,6 +415,10 @@ module io ! !------------------------------------------------------------------------------- ! +! reset the return flag +! + iret = 0 + ! check if conditions for storing the restart snapshot have been met ! if (hrest < 5.0d-02 .or. thrs < irest * hrest) return From 5213004734de1264d74e31777bcb01fa3e7729a7 Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Fri, 10 Mar 2017 12:04:42 -0300 Subject: [PATCH 4/4] IO: Account time for disk operations (for snapshots). Signed-off-by: Grzegorz Kowal --- src/io.F90 | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/io.F90 b/src/io.F90 index 1381bb2..2a013b2 100644 --- a/src/io.F90 +++ b/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