walltime_module.f90 Source File


This file depends on

sourcefile~~walltime_module.f90~~EfferentGraph sourcefile~walltime_module.f90 walltime_module.f90 sourcefile~base_module.f90 base_module.f90 sourcefile~walltime_module.f90->sourcefile~base_module.f90 sourcefile~coarray_module.f90 coarray_module.f90 sourcefile~base_module.f90->sourcefile~coarray_module.f90

Files dependent on this one

sourcefile~~walltime_module.f90~~AfferentGraph sourcefile~walltime_module.f90 walltime_module.f90 sourcefile~swiftest_module.f90 swiftest_module.f90 sourcefile~swiftest_module.f90->sourcefile~walltime_module.f90 sourcefile~walltime_implementations.f90 walltime_implementations.f90 sourcefile~walltime_implementations.f90->sourcefile~walltime_module.f90 sourcefile~walltime_implementations.f90->sourcefile~swiftest_module.f90 sourcefile~collision_io.f90 collision_io.f90 sourcefile~collision_io.f90->sourcefile~swiftest_module.f90 sourcefile~tides_getacch_pl.f90 tides_getacch_pl.f90 sourcefile~tides_getacch_pl.f90->sourcefile~swiftest_module.f90 sourcefile~tides_spin_step.f90 tides_spin_step.f90 sourcefile~tides_spin_step.f90->sourcefile~swiftest_module.f90 sourcefile~symba_util.f90 symba_util.f90 sourcefile~symba_util.f90->sourcefile~swiftest_module.f90 sourcefile~symba_module.f90 symba_module.f90 sourcefile~symba_util.f90->sourcefile~symba_module.f90 sourcefile~fraggle_module.f90 fraggle_module.f90 sourcefile~symba_util.f90->sourcefile~fraggle_module.f90 sourcefile~shgrav_accel.f90 shgrav_accel.f90 sourcefile~shgrav_accel.f90->sourcefile~swiftest_module.f90 sourcefile~shgrav_module.f90 shgrav_module.f90 sourcefile~shgrav_accel.f90->sourcefile~shgrav_module.f90 sourcefile~rmvs_discard.f90 rmvs_discard.f90 sourcefile~rmvs_discard.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_module.f90 rmvs_module.f90 sourcefile~rmvs_discard.f90->sourcefile~rmvs_module.f90 sourcefile~swiftest_driver.f90 swiftest_driver.f90 sourcefile~swiftest_driver.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_kick.f90 rmvs_kick.f90 sourcefile~rmvs_kick.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_kick.f90->sourcefile~rmvs_module.f90 sourcefile~symba_encounter_check.f90 symba_encounter_check.f90 sourcefile~symba_encounter_check.f90->sourcefile~swiftest_module.f90 sourcefile~symba_encounter_check.f90->sourcefile~symba_module.f90 sourcefile~helio_module.f90 helio_module.f90 sourcefile~helio_module.f90->sourcefile~swiftest_module.f90 sourcefile~whm_module.f90 whm_module.f90 sourcefile~helio_module.f90->sourcefile~whm_module.f90 sourcefile~symba_module.f90->sourcefile~swiftest_module.f90 sourcefile~symba_module.f90->sourcefile~helio_module.f90 sourcefile~fraggle_util.f90 fraggle_util.f90 sourcefile~fraggle_util.f90->sourcefile~swiftest_module.f90 sourcefile~fraggle_util.f90->sourcefile~fraggle_module.f90 sourcefile~main.f90 main.f90 sourcefile~main.f90->sourcefile~swiftest_module.f90 sourcefile~helio_gr.f90 helio_gr.f90 sourcefile~helio_gr.f90->sourcefile~swiftest_module.f90 sourcefile~helio_gr.f90->sourcefile~helio_module.f90 sourcefile~symba_drift.f90 symba_drift.f90 sourcefile~symba_drift.f90->sourcefile~swiftest_module.f90 sourcefile~symba_drift.f90->sourcefile~symba_module.f90 sourcefile~swiftest_user.f90 swiftest_user.f90 sourcefile~swiftest_user.f90->sourcefile~swiftest_module.f90 sourcefile~whm_kick.f90 whm_kick.f90 sourcefile~whm_kick.f90->sourcefile~swiftest_module.f90 sourcefile~whm_kick.f90->sourcefile~whm_module.f90 sourcefile~whm_module.f90->sourcefile~swiftest_module.f90 sourcefile~helio_step.f90 helio_step.f90 sourcefile~helio_step.f90->sourcefile~swiftest_module.f90 sourcefile~helio_step.f90->sourcefile~helio_module.f90 sourcefile~collision_regime.f90 collision_regime.f90 sourcefile~collision_regime.f90->sourcefile~swiftest_module.f90 sourcefile~operator_cross.f90 operator_cross.f90 sourcefile~operator_cross.f90->sourcefile~swiftest_module.f90 sourcefile~whm_coord.f90 whm_coord.f90 sourcefile~whm_coord.f90->sourcefile~swiftest_module.f90 sourcefile~whm_coord.f90->sourcefile~whm_module.f90 sourcefile~helio_drift.f90 helio_drift.f90 sourcefile~helio_drift.f90->sourcefile~swiftest_module.f90 sourcefile~helio_drift.f90->sourcefile~helio_module.f90 sourcefile~symba_step.f90 symba_step.f90 sourcefile~symba_step.f90->sourcefile~swiftest_module.f90 sourcefile~symba_step.f90->sourcefile~symba_module.f90 sourcefile~collision_check.f90 collision_check.f90 sourcefile~collision_check.f90->sourcefile~swiftest_module.f90 sourcefile~collision_check.f90->sourcefile~symba_module.f90 sourcefile~swiftest_drift.f90 swiftest_drift.f90 sourcefile~swiftest_drift.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_discard.f90 swiftest_discard.f90 sourcefile~swiftest_discard.f90->sourcefile~swiftest_module.f90 sourcefile~symba_discard.f90 symba_discard.f90 sourcefile~symba_discard.f90->sourcefile~swiftest_module.f90 sourcefile~symba_discard.f90->sourcefile~symba_module.f90 sourcefile~fraggle_module.f90->sourcefile~swiftest_module.f90 sourcefile~helio_kick.f90 helio_kick.f90 sourcefile~helio_kick.f90->sourcefile~swiftest_module.f90 sourcefile~helio_kick.f90->sourcefile~helio_module.f90 sourcefile~fraggle_generate.f90 fraggle_generate.f90 sourcefile~fraggle_generate.f90->sourcefile~swiftest_module.f90 sourcefile~fraggle_generate.f90->sourcefile~symba_module.f90 sourcefile~fraggle_generate.f90->sourcefile~fraggle_module.f90 sourcefile~swiftest_kick.f90 swiftest_kick.f90 sourcefile~swiftest_kick.f90->sourcefile~swiftest_module.f90 sourcefile~whm_step.f90 whm_step.f90 sourcefile~whm_step.f90->sourcefile~swiftest_module.f90 sourcefile~whm_step.f90->sourcefile~whm_module.f90 sourcefile~rmvs_util.f90 rmvs_util.f90 sourcefile~rmvs_util.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_util.f90->sourcefile~rmvs_module.f90 sourcefile~swiftest_orbel.f90 swiftest_orbel.f90 sourcefile~swiftest_orbel.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_gr.f90 swiftest_gr.f90 sourcefile~swiftest_gr.f90->sourcefile~swiftest_module.f90 sourcefile~shgrav_module.f90->sourcefile~swiftest_module.f90 sourcefile~symba_gr.f90 symba_gr.f90 sourcefile~symba_gr.f90->sourcefile~swiftest_module.f90 sourcefile~symba_gr.f90->sourcefile~symba_module.f90 sourcefile~rmvs_step.f90 rmvs_step.f90 sourcefile~rmvs_step.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_step.f90->sourcefile~rmvs_module.f90 sourcefile~whm_gr.f90 whm_gr.f90 sourcefile~whm_gr.f90->sourcefile~swiftest_module.f90 sourcefile~whm_gr.f90->sourcefile~whm_module.f90 sourcefile~helio_util.f90 helio_util.f90 sourcefile~helio_util.f90->sourcefile~swiftest_module.f90 sourcefile~helio_util.f90->sourcefile~helio_module.f90 sourcefile~swiftest_util.f90 swiftest_util.f90 sourcefile~swiftest_util.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_util.f90->sourcefile~helio_module.f90 sourcefile~swiftest_util.f90->sourcefile~symba_module.f90 sourcefile~swiftest_util.f90->sourcefile~whm_module.f90 sourcefile~swiftest_util.f90->sourcefile~fraggle_module.f90 sourcefile~swiftest_util.f90->sourcefile~rmvs_module.f90 sourcefile~whm_drift.f90 whm_drift.f90 sourcefile~whm_drift.f90->sourcefile~swiftest_module.f90 sourcefile~whm_drift.f90->sourcefile~whm_module.f90 sourcefile~whm_util.f90 whm_util.f90 sourcefile~whm_util.f90->sourcefile~swiftest_module.f90 sourcefile~whm_util.f90->sourcefile~whm_module.f90 sourcefile~swiftest_coarray.f90 swiftest_coarray.f90 sourcefile~swiftest_coarray.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_coarray.f90->sourcefile~whm_module.f90 sourcefile~swiftest_coarray.f90->sourcefile~rmvs_module.f90 sourcefile~collision_generate.f90 collision_generate.f90 sourcefile~collision_generate.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_module.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_module.f90->sourcefile~whm_module.f90 sourcefile~swiftest_io.f90 swiftest_io.f90 sourcefile~swiftest_io.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_io.f90->sourcefile~symba_module.f90 sourcefile~shgrav_pot.f90 shgrav_pot.f90 sourcefile~shgrav_pot.f90->sourcefile~swiftest_module.f90 sourcefile~shgrav_pot.f90->sourcefile~shgrav_module.f90 sourcefile~encounter_io.f90 encounter_io.f90 sourcefile~encounter_io.f90->sourcefile~swiftest_module.f90 sourcefile~bindings_module.f90 bindings_module.f90 sourcefile~bindings_module.f90->sourcefile~swiftest_module.f90 sourcefile~collision_resolve.f90 collision_resolve.f90 sourcefile~collision_resolve.f90->sourcefile~swiftest_module.f90 sourcefile~collision_resolve.f90->sourcefile~symba_module.f90 sourcefile~encounter_check.f90 encounter_check.f90 sourcefile~encounter_check.f90->sourcefile~swiftest_module.f90 sourcefile~symba_kick.f90 symba_kick.f90 sourcefile~symba_kick.f90->sourcefile~swiftest_module.f90 sourcefile~symba_kick.f90->sourcefile~symba_module.f90 sourcefile~coarray_clone.f90 coarray_clone.f90 sourcefile~coarray_clone.f90->sourcefile~swiftest_module.f90 sourcefile~collision_util.f90 collision_util.f90 sourcefile~collision_util.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_encounter_check.f90 rmvs_encounter_check.f90 sourcefile~rmvs_encounter_check.f90->sourcefile~swiftest_module.f90 sourcefile~rmvs_encounter_check.f90->sourcefile~rmvs_module.f90 sourcefile~encounter_util.f90 encounter_util.f90 sourcefile~encounter_util.f90->sourcefile~swiftest_module.f90 sourcefile~encounter_util.f90->sourcefile~symba_module.f90 sourcefile~swiftest_obl.f90 swiftest_obl.f90 sourcefile~swiftest_obl.f90->sourcefile~swiftest_module.f90 sourcefile~swiftest_obl.f90->sourcefile~shgrav_module.f90 sourcefile~coarray_collect.f90 coarray_collect.f90 sourcefile~coarray_collect.f90->sourcefile~swiftest_module.f90

Contents

Source Code


Source Code

! Copyright 2024 - The Minton Group at Purdue University
! This file is part of Swiftest.
! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License 
! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
! You should have received a copy of the GNU General Public License along with Swiftest. 
! If not, see: https://www.gnu.org/licenses. 

module walltime
   !! author: David A. Minton
   !!
   !! Classes and methods used to compute elasped wall time
   use globals
   use base
   implicit none
   public

   integer(I4B) :: INTERACTION_TIMER_CADENCE = 1000 
         !! Minimum number of steps to wait before timing an interaction loop in ADAPTIVE mode
   character(len=*), parameter :: INTERACTION_TIMER_LOG_OUT  = "interaction_timer.log" 
         !! Name of log file for recording results of interaction loop timing
   character(len=*), parameter :: ENCOUNTER_PLPL_TIMER_LOG_OUT  = "encounter_check_plpl_timer.log" 
         !! Name of log file for recording results of encounter check method timing
   character(len=*), parameter :: ENCOUNTER_PLTP_TIMER_LOG_OUT  = "encounter_check_pltp_timer.log" 
         !! Name of log file for recording results of encounter check method timing

   type :: walltimer
      integer(I8B) :: count_rate                 
         !! Rate at wich the clock ticks
      integer(I8B) :: count_max                  
         !! Maximum value of the clock ticker
      integer(I8B) :: count_start_main           
         !! Value of the clock ticker at when the timer is first called
      integer(I8B) :: count_start_step           
         !! Value of the clock ticker at the start of a timed step
      integer(I8B) :: count_stop_step            
         !! Value of the clock ticker at the end of a timed step
      integer(I8B) :: count_pause                
         !! Value of the clock ticker at the end of a timed step
      integer(I4B) :: nsubsteps                  
         !! Number of substeps in an interval (number of times the timer is turned off and back on again)
      real(DP)     :: wall_step                  
         !! Value of the step elapsed time
      real(DP)     :: wall_main                  
         !! Value of the main clock elapsed time
      real(DP)     :: wall_per_substep           
         !! Value of time per substep 
      logical      :: main_is_started = .false. 
         !! Logical flag indicating whether or not the main timer has been reset or not
      logical      :: is_paused = .false. 
         !! Logical flag indicating whether or not the timer is paused

   contains
      procedure :: reset       => walltime_reset      
         !! Resets the clock ticker, settting main_start to the current ticker value
      procedure :: start       => walltime_start      
         !! Starts or resumes the step timer
      procedure :: start_main  => walltime_start_main 
         !! Starts the main timer
      procedure :: stop        => walltime_stop       
         !! Pauses the step timer
      procedure :: report      => walltime_report     
         !! Prints the elapsed time information to the terminal
   end type walltimer


   interface
      module subroutine walltime_report(self, message, unit)
         implicit none
         class(walltimer),           intent(inout) :: self      
            !! Walltimer object
         character(len=*),           intent(in)    :: message   
            !! Message to prepend to the wall time terminal output
         integer(I4B),               intent(in)    :: unit      
            !! Output file unit for report text to be directed
      end subroutine walltime_report

      module subroutine walltime_reset(self)
         implicit none
         class(walltimer),           intent(inout) :: self  
            !! Walltimer object
      end subroutine walltime_reset 

      module subroutine walltime_start(self)
         implicit none
         class(walltimer),           intent(inout) :: self  
            !! Walltimer object
      end subroutine walltime_start

      module subroutine walltime_start_main(self)
         implicit none
         class(walltimer),           intent(inout) :: self  
            !! Walltimer object
      end subroutine walltime_start_main

      module subroutine walltime_stop(self)
         implicit none
         class(walltimer),           intent(inout) :: self  
            !! Walltimer object
      end subroutine walltime_stop
   end interface

end module walltime