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
709 call mpi_initialized(initialized, ierrMPI)
710 if (
.not. initialized
.and. ierrMPI
== 0)
call mpi_init(ierrMPI)
711 if (ierrMPI
/= 0)
error stop MODULE_NAME//SK_
"@timerMPI_typer(): Failed to initialize the MPI library."
712 timer
%resol
= real(mpi_wtick(), RKD)
713 timer
%start
= timer
%time()
753#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
758 timer
%resol
= real(omp_get_wtick(), RKD)
759 timer
%start
= timer
%time()
795#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
800 timer
%start
= timer
%time()
858#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
859 !DEC$ ATTRIBUTES DLLEXPORT ::
getTime
861 real(RKD),
intent(in),
optional :: since
862 real(RKD) :: timeInSec
918#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
921 real(RKD),
intent(in),
optional :: since
922 real(RKD) :: timeInSec
923 call cpu_time(timeInSec)
924 CHECK_ASSERTION(__LINE__, timeInSec
>= 0._RKD, SK_
"@getTimeCPU(): The CPU does not have a clock.")
925 if (
present(since)) timeInSec
= timeInSec
- since
973#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
979 real(
RKD),
intent(in),
optional :: since
980 real(
RKD) :: timeInSec
981 integer(
IK) :: values(
8)
982 call date_and_time(values
= values)
984 if (
present(since)) timeInSec
= timeInSec
- since
1036#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1041 real(
RKD),
intent(in),
optional :: since
1042 real(
RKD) :: timeInSec
1043 timeInSec
= mpi_wtime()
1044 if (
present(since)) timeInSec
= timeInSec
- since
1097#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1101 use omp_lib,
only: omp_get_wtime
1102 real(
RKD),
intent(in),
optional :: since
1103 real(
RKD) :: timeInSec
1104 timeInSec
= omp_get_wtime()
1105 if (
present(since)) timeInSec
= timeInSec
- since
1198#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1201 real(RKD),
intent(in),
optional :: since
1202 real(RKD) :: timeInSec
1203 real(RKD) :: count_rate
1204 integer(IKD) :: count
1206 call system_clock(count, count_rate)
1207 CHECK_ASSERTION(__LINE__, count
> 0_IKD .and. count_rate
> 0._RKD, SK_
"@getTimeSYS(): The system does not have a clock.")
1208 timeInSec
= count
/ count_rate
1209 if (
present(since)) timeInSec
= timeInSec
- since
1261#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1264 real(RKD) :: resolution
1316#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1319 real(RKD) :: resolution
1320 real(RKD) :: resolution_
1321 call cpu_time(time
= resolution_)
1322 CHECK_ASSERTION(__LINE__, resolution_
>= 0._RKD, SK_
"@getResTimerCPU(): The CPU does not have a clock.")
1324 call cpu_time(time
= resolution)
1325 if (resolution
== resolution_)
cycle
1326 resolution
= resolution
- resolution_
1373#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1376 real(RKD) :: resolution
1377 resolution
= 0.001_RKD
1424#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1428 real(RKD) :: resolution
1429 resolution
= real(mpi_wtick(), RKD)
1477#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1480 use omp_lib,
only: omp_get_wtick
1481 real(RKD) :: resolution
1482 resolution
= real(omp_get_wtick(), RKD)
1528#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1531 real(RKD) :: resolution
1532 call system_clock(count_rate
= resolution)
1533 CHECK_ASSERTION(__LINE__, resolution
> 0._RKD, SK_
"@getResTimerSYS(): The system does not have a clock.")
1534 resolution
= 1._RKD / resolution
1593#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1594 !DEC$ ATTRIBUTES DLLEXPORT ::
setIdle
1597 real(RKD) ,
intent(in) :: seconds
1658#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1662 real(RKD) ,
intent(in) :: seconds
1721#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1725 real(RKD) ,
intent(in) :: seconds
1787#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1791 real(RKD) ,
intent(in) :: seconds
1850#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1854 real(RKD) ,
intent(in) :: seconds
1914#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1918 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...