mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Commented type-bound procedures from timers since support in gfortran is still limited. Will change this back later once better support exists.
This commit is contained in:
parent
f7f61257f5
commit
8a5111857d
4 changed files with 19 additions and 13 deletions
|
|
@ -65,6 +65,7 @@ initialize.o: mpi_routines.o
|
|||
initialize.o: output.o
|
||||
initialize.o: source.o
|
||||
initialize.o: string.o
|
||||
initialize.o: timing.o
|
||||
|
||||
input_old.o: constants.o
|
||||
input_old.o: datatypes.o
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ module initialize
|
|||
print_particle, header
|
||||
use source, only: init_source
|
||||
use string, only: int_to_str
|
||||
use timing, only: timer_start, timer_stop
|
||||
|
||||
contains
|
||||
|
||||
|
|
@ -29,9 +30,12 @@ contains
|
|||
!===============================================================================
|
||||
|
||||
subroutine initialize_run()
|
||||
|
||||
|
||||
type(Universe), pointer :: univ
|
||||
|
||||
! Start initialization timer
|
||||
call timer_start(time_init)
|
||||
|
||||
! Setup MPI
|
||||
call setup_mpi()
|
||||
|
||||
|
|
@ -98,6 +102,9 @@ contains
|
|||
call print_summary()
|
||||
end if
|
||||
|
||||
! Stop initialization timer
|
||||
call timer_stop(time_init)
|
||||
|
||||
end subroutine initialize_run
|
||||
|
||||
!===============================================================================
|
||||
|
|
|
|||
|
|
@ -23,9 +23,7 @@ program main
|
|||
call timer_start(time_total)
|
||||
|
||||
! set up problem
|
||||
call timer_start(time_init)
|
||||
call initialize_run()
|
||||
call timer_stop(time_init)
|
||||
|
||||
! start problem
|
||||
call run_problem()
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ module timing
|
|||
logical :: running = .false. ! is timer running?
|
||||
integer :: start_counts = 0 ! counts when started
|
||||
real(8) :: elapsed = 0. ! total time elapsed in seconds
|
||||
contains
|
||||
procedure :: start => timer_start
|
||||
procedure :: get_value => timer_get_value
|
||||
procedure :: stop => timer_stop
|
||||
procedure :: reset => timer_reset
|
||||
!!$ contains
|
||||
!!$ procedure :: start => timer_start
|
||||
!!$ procedure :: get_value => timer_get_value
|
||||
!!$ procedure :: stop => timer_stop
|
||||
!!$ procedure :: reset => timer_reset
|
||||
end type Timer
|
||||
|
||||
contains
|
||||
|
|
@ -29,7 +29,7 @@ contains
|
|||
|
||||
subroutine timer_start(self)
|
||||
|
||||
class(Timer), intent(inout) :: self
|
||||
type(Timer), intent(inout) :: self
|
||||
|
||||
! Turn timer on and measure starting time
|
||||
self % running = .true.
|
||||
|
|
@ -43,7 +43,7 @@ contains
|
|||
|
||||
function timer_get_value(self) result(elapsed)
|
||||
|
||||
class(Timer), intent(in) :: self ! the timer
|
||||
type(Timer), intent(in) :: self ! the timer
|
||||
real(8) :: elapsed ! total elapsed time
|
||||
|
||||
integer :: end_counts ! current number of counts
|
||||
|
|
@ -66,13 +66,13 @@ contains
|
|||
|
||||
subroutine timer_stop(self)
|
||||
|
||||
class(Timer), intent(inout) :: self
|
||||
type(Timer), intent(inout) :: self
|
||||
|
||||
! Check to make sure timer was running
|
||||
if (.not. self % running) return
|
||||
|
||||
! Stop timer and add time
|
||||
self % elapsed = self % get_value()
|
||||
self % elapsed = timer_get_value(self)
|
||||
self % running = .false.
|
||||
|
||||
end subroutine timer_stop
|
||||
|
|
@ -83,7 +83,7 @@ contains
|
|||
|
||||
subroutine timer_reset(self)
|
||||
|
||||
class(Timer), intent(inout) :: self
|
||||
type(Timer), intent(inout) :: self
|
||||
|
||||
self % running = .false.
|
||||
self % start_counts = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue