102#define CHECK_ASSERTION(LINE,ASSERTION,MSG) \
110#define CHECK_ASSERTION(LINE,ASSERTION,MSG) continue;
132 real(
RKD),
intent(in),
optional :: since
133 real(
RKD) :: timeInSec
156 real(RKD),
intent(in) :: seconds
557#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
602#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
607 timer
%start
= timer
%time()
642#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
646 timer
%resol
= 0.001_RKD
647 timer
%start
= timer
%time()
690#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
695 logical :: initialized
710 call mpi_initialized(initialized, ierrMPI)
711 if (
.not. initialized
.and. ierrMPI
== 0)
call mpi_init(ierrMPI)
712 if (ierrMPI
/= 0)
error stop MODULE_NAME//SK_
"@timerMPI_typer(): Failed to initialize the MPI library."
713 timer
%resol
= real(mpi_wtick(), RKD)
714 timer
%start
= timer
%time()
754#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
759 timer
%resol
= real(omp_get_wtick(), RKD)
760 timer
%start
= timer
%time()
796#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
801 timer
%start
= timer
%time()
859#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
860 !DEC$ ATTRIBUTES DLLEXPORT ::
getTime
862 real(RKD),
intent(in),
optional :: since
863 real(RKD) :: timeInSec
919#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
922 real(RKD),
intent(in),
optional :: since
923 real(RKD) :: timeInSec
924 call cpu_time(timeInSec)
925 CHECK_ASSERTION(__LINE__, timeInSec
>= 0._RKD, SK_
"@getTimeCPU(): The CPU does not have a clock.")
926 if (
present(since)) timeInSec
= timeInSec
- since
974#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
980 real(
RKD),
intent(in),
optional :: since
981 real(
RKD) :: timeInSec
982 integer(
IK) :: values(
8)
983 call date_and_time(values
= values)
985 if (
present(since)) timeInSec
= timeInSec
- since
1037#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1042 real(
RKD),
intent(in),
optional :: since
1043 real(
RKD) :: timeInSec
1044 timeInSec
= mpi_wtime()
1045 if (
present(since)) timeInSec
= timeInSec
- since
1098#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1102 use omp_lib,
only: omp_get_wtime
1103 real(
RKD),
intent(in),
optional :: since
1104 real(
RKD) :: timeInSec
1105 timeInSec
= omp_get_wtime()
1106 if (
present(since)) timeInSec
= timeInSec
- since
1199#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1202 real(RKD),
intent(in),
optional :: since
1203 real(RKD) :: timeInSec
1204 real(RKD) :: count_rate
1205 integer(IKD) :: count
1207 call system_clock(count, count_rate)
1208 CHECK_ASSERTION(__LINE__, count
> 0_IKD .and. count_rate
> 0._RKD, SK_
"@getTimeSYS(): The system does not have a clock.")
1209 timeInSec
= count
/ count_rate
1210 if (
present(since)) timeInSec
= timeInSec
- since
1262#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1265 real(RKD) :: resolution
1317#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1320 real(RKD) :: resolution
1321 real(RKD) :: resolution_
1322 call cpu_time(time
= resolution_)
1323 CHECK_ASSERTION(__LINE__, resolution_
>= 0._RKD, SK_
"@getResTimerCPU(): The CPU does not have a clock.")
1325 call cpu_time(time
= resolution)
1326 if (resolution
== resolution_)
cycle
1327 resolution
= resolution
- resolution_
1374#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1377 real(RKD) :: resolution
1378 resolution
= 0.001_RKD
1425#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1429 real(RKD) :: resolution
1430 resolution
= real(mpi_wtick(), RKD)
1478#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1481 use omp_lib,
only: omp_get_wtick
1482 real(RKD) :: resolution
1483 resolution
= real(omp_get_wtick(), RKD)
1529#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1532 real(RKD) :: resolution
1533 call system_clock(count_rate
= resolution)
1534 CHECK_ASSERTION(__LINE__, resolution
> 0._RKD, SK_
"@getResTimerSYS(): The system does not have a clock.")
1535 resolution
= 1._RKD / resolution
1594#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1595 !DEC$ ATTRIBUTES DLLEXPORT ::
setIdle
1598 real(RKD) ,
intent(in) :: seconds
1659#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1663 real(RKD) ,
intent(in) :: seconds
1722#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1726 real(RKD) ,
intent(in) :: seconds
1788#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1792 real(RKD) ,
intent(in) :: seconds
1851#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1855 real(RKD) ,
intent(in) :: seconds
1915#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1919 real(RKD) ,
intent(in) :: seconds
Generate and return the Julian Date (Julian Day Number JDN + the fractional part of the day) from the...
Generate and return a decorated string resulting from the concatenation of getFile(FILE) and getLine(...
Verify the input assertion holds and if it does not, print the (optional) input message on stdout and...
This is the abstract interface of the setTime static type-bound procedure component of timer_type abs...
This is the abstract interface of the wait static type-bound procedure component of timer_type abstra...
Generate and return the conversion of the input value to an output Fortran string,...
This module contains classes and procedures for computing, manipulating, and styling dates and times.
integer(IK), parameter SECONDS_PER_DAY
The constant scalar of type integer of kind IK containing the number of seconds per day.
This module contains classes and procedures for reporting and handling errors.
character(*, SK), parameter MODULE_NAME
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter RKD
The double precision real kind in Fortran mode. On most platforms, this is an 64-bit real kind.
integer, parameter IKD
The double precision integer kind in Fortran mode. On most platforms, this is a 64-bit integer kind.
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
This module contains the timer procedures and derived types to facilitate timing applications at runt...
real(RKD) function getTimeDAT(since)
Generate and return the calendrical clock time in units of seconds since the specified time since or ...
real(RKD) function getTimeMPI(since)
Generate and return the MPI clock time in units of seconds since the specified time since or since an...
real(RKD) function getTimeOMP(since)
Generate and return the OpenMP clock time in units of seconds since the specified time since or since...
type(timerCPU_type) function timerCPU_typer()
This is the constructor of the timerCPU_type class.
real(RKD) function getTimeSYS(since)
Generate and return the system clock time in units of seconds since the specified time since or since...
pure real(RKD) function getResTimerDAT()
Generate and return the time resolution of the Fortran intrinsic date_and_time(), used in timerDAT_ty...
subroutine setIdleSYS(seconds)
Set the processor in sleep mode for the input requested number of seconds via the Fortran intrinsic s...
real(RKD) function getResTimerMPI()
Generate and return the time resolution of the MPI intrinsic timer, used in timerMPI_type,...
subroutine setIdleMPI(seconds)
Set the processor in sleep mode for the input requested number of seconds via the MPI intrinsic timer...
real(RKD) function getTimeCPU(since)
Generate and return the CPU time in units of seconds since the specified time since or since an arbit...
subroutine setIdleDAT(seconds)
Set the processor in sleep mode for the input requested number of seconds via the Fortran intrinsic d...
subroutine setIdleCPU(seconds)
Set the processor in sleep mode for the input requested number of seconds via the Fortran intrinsic c...
real(RKD) function getResTimer()
Generate and return the time resolution by the build-time default timer of the ParaMonte library as u...
type(timerMPI_type) type(timerOMP_type) type(timerSYS_type) function timer_typer()
This is the constructor of the timer_type class.
real(RKD) function getResTimerCPU()
Generate and return the time resolution of the Fortran intrinsic cpu_time(), used in timerCPU_type,...
real(RKD) function getResTimerSYS()
Generate and return the time resolution of the Fortran intrinsic system_clock(), used in timerSYS_typ...
subroutine setIdleOMP(seconds)
Set the processor in sleep mode for the input requested number of seconds via the OpenMP intrinsic ti...
type(timerMPI_type) function timerMPI_typer()
This is the constructor of the timerMPI_type class.
type(timerOMP_type) function timerOMP_typer()
This is the constructor of the timerOMP_type class.
type(timerSYS_type) function timerSYS_typer()
This is the constructor of the timerSYS_type class.
type(timerDAT_type) function timerDAT_typer()
This is the constructor of the timerDAT_type class.
real(RKD) function getResTimerOMP()
Generate and return the time resolution of the OpenMP intrinsic timer, used in timerOMP_type,...
subroutine setIdle(seconds)
Set the processor in sleep mode for the input requested number of seconds via the default timer of th...
real(RKD) function getTime(since)
Generate and return the time in units of seconds since the specified time since or since an arbitrary...
This module contains the generic procedures for converting values of different types and kinds to For...
This is the timerCPU_type class, containing attributes and static methods for setting up a timer base...
This is the timerDAT_type class, containing attributes and static methods for setting up a timer base...
This is the timerMPI_type class, containing attributes and static methods for setting up a timer base...
This is the timerMPI_type class, containing attributes and static methods for setting up a timer base...
This is the timerSYS_type class, containing attributes and static methods for setting up a timer base...
This is the abstract base derived type that serves as a simple container template for other timer cla...