timer_obj Derived Type

type, public :: timer_obj

Time management utility


Inherits

type~~timer_obj~~InheritsGraph type~timer_obj timer_obj type~hashtbl_obj hashtbl_obj type~timer_obj->type~hashtbl_obj tbl type~parallel_obj parallel_obj type~timer_obj->type~parallel_obj parallel type~parser_obj parser_obj type~timer_obj->type~parser_obj parser type~sllist_obj sllist_obj type~hashtbl_obj->type~sllist_obj vec MPI_Datatype MPI_Datatype type~parallel_obj->MPI_Datatype REAL_SP, REAL_DP, REAL_WP, COMPLEX_SP, COMPLEX_DP, COMPLEX_WP, INTEGER, INT8, LOGICAL MPI_Info MPI_Info type~parallel_obj->MPI_Info mpi_info type~communicators communicators type~parallel_obj->type~communicators comm type~patch patch type~parallel_obj->type~patch rank type~entry_obj entry_obj type~parser_obj->type~entry_obj entries MPI_Comm MPI_Comm type~communicators->MPI_Comm w, g type~sllist_obj->type~sllist_obj child

Inherited by

type~~timer_obj~~InheritedByGraph type~timer_obj timer_obj type~collision_obj collision_obj type~collision_obj->type~timer_obj timer type~marker_set marker_set type~collision_obj->type~marker_set IB type~particle_set particle_set type~collision_obj->type~particle_set PP type~respart_set ResPart_set type~collision_obj->type~respart_set RP type~marker_set->type~timer_obj timer type~particle_set->type~timer_obj timer type~respart_set->type~timer_obj timer type~respart_set->type~marker_set ib type~solver_obj solver_obj type~solver_obj->type~timer_obj timer type~cdifs_obj cdifs_obj type~cdifs_obj->type~collision_obj collisions type~cdifs_obj->type~marker_set IB type~cdifs_obj->type~respart_set RP type~cdifs_obj->type~solver_obj type~grans_obj grans_obj type~grans_obj->type~collision_obj collisions type~grans_obj->type~marker_set IB type~grans_obj->type~particle_set PP type~grans_obj->type~respart_set RP type~grans_obj->type~solver_obj type~solid_obj solid_obj type~solid_obj->type~marker_set type~solid_set solid_set type~solid_set->type~solid_obj p

Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: dt

Timestep

logical, public :: finish = .false.

Instructs simulation to end

real(kind=wp), public :: freq_output = huge(1.0_wp)

Frequency of visualization writes

real(kind=wp), public :: freq_write = huge(1.0_wp)

Frequency of restart writes

integer, public :: iter = 0

Current iteration

integer, public :: iter_max = huge(1)

Maximum iterations

real(kind=wp), public :: itertime

Wall clock time at beginning of iteration (in seconds)

real(kind=wp), public :: lasttime

Wall clock time at last update (in seconds)

type(parallel_obj), public, pointer :: parallel

Parallel object

type(parser_obj), public, pointer :: parser

Parser object

real(kind=wp), public :: starttime

Wall clock time at initialization (in seconds)

real(kind=wp), public :: time = 0.0_wp

Time at the n-th timestep

real(kind=wp), public :: time_max = huge(1.0_wp)

Maximum simulation time

real(kind=wp), public :: time_wall = huge(1.0_wp)

Wall time (in hours)

real(kind=wp), public, allocatable :: timing(:)

Timing array

type(hashtbl_obj), private :: tbl

Hash table for timing info


Type-Bound Procedures

procedure, public :: AddTiming => timer_obj_AddTiming

  • private subroutine timer_obj_AddTiming(this, name)

    Add timing info

    Arguments

    Type IntentOptional Attributes Name
    class(timer_obj), intent(inout) :: this

    Timer

    character(len=*), intent(in) :: name

    Name of timing data

procedure, public :: Done => timer_obj_Done

  • private function timer_obj_Done(this) result(res)

    Determines whether simulation is over

    Arguments

    Type IntentOptional Attributes Name
    class(timer_obj), intent(inout) :: this

    Timer

    Return Value logical

procedure, public :: EndRun => timer_obj_EndRun

  • private subroutine timer_obj_EndRun(this)

    Change run status to finished

    Arguments

    Type IntentOptional Attributes Name
    class(timer_obj), intent(inout) :: this

    Timer

procedure, public :: Finalize => timer_obj_Final

  • private subroutine timer_obj_Final(this)

    Finalize

    Arguments

    Type IntentOptional Attributes Name
    class(timer_obj), intent(inout) :: this

    Timer

procedure, public :: GetTiming => timer_obj_GetTiming

  • private function timer_obj_GetTiming(this, name) result(res)

    Updates timing info with elapsed time since beginning of current iteration

    Arguments

    Type IntentOptional Attributes Name
    class(timer_obj), intent(inout) :: this

    Timer

    character(len=*), intent(in) :: name

    Name of timing data

    Return Value real(kind=wp)

    Timing

procedure, public :: Initialize => timer_obj_Init

  • private subroutine timer_obj_Init(this, parallel, parser)

    Initialize the timer

    Arguments

    Type IntentOptional Attributes Name
    class(timer_obj), intent(inout) :: this

    Timer

    type(parallel_obj), intent(in), target :: parallel

    parallel structure from main program

    type(parser_obj), intent(in), target :: parser

    Input file parsing tool

procedure, public :: StepForward => timer_obj_StepForward

  • private subroutine timer_obj_StepForward(this)

    Move timer from n to n+1

    Arguments

    Type IntentOptional Attributes Name
    class(timer_obj), intent(inout) :: this

    Timer

procedure, public :: TimeToWriteOutputData => timer_obj_TimeToWriteOutputData

  • private function timer_obj_TimeToWriteOutputData(this) result(res)

    Determine whether it is time to write visualization files

    Arguments

    Type IntentOptional Attributes Name
    class(timer_obj), intent(inout) :: this

    Timer

    Return Value logical

procedure, public :: TimeToWriteRestartData => timer_obj_TimeToWriteRestartData

  • private function timer_obj_TimeToWriteRestartData(this) result(res)

    Determine whether it is time to write restart files

    Arguments

    Type IntentOptional Attributes Name
    class(timer_obj), intent(inout) :: this

    Timer

    Return Value logical

procedure, public :: UpdateTiming => timer_obj_UpdateTiming

  • private subroutine timer_obj_UpdateTiming(this, name)

    Updates timing info with elapsed time since beginning of current iteration

    Arguments

    Type IntentOptional Attributes Name
    class(timer_obj), intent(inout) :: this

    Timer

    character(len=*), intent(in) :: name

    Name of timing data