ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_timer::timerMPI_type Interface Reference

This is the timerMPI_type class, containing attributes and static methods for setting up a timer based on the MPI intrinsic MPI_Wtime(). More...

Inheritance diagram for pm_timer::timerMPI_type:
Collaboration diagram for pm_timer::timerMPI_type:

Public Member Functions

procedure, nopass time => getTimeMPI
 See getTime_proc. More...
 
procedure, nopass wait => setIdleMPI
 See setIdle_proc. More...
 
type(timerMPI_type) function timerMPI_typer ()
 This is the constructor of the timerMPI_type class.
More...
 
- Public Member Functions inherited from pm_timer::timer_type
procedure(getTime_proc), deferred, nopass time
 See getTime_proc. More...
 
procedure(setIdle_proc), deferred, nopass wait
 See setIdle_proc. More...
 
type(timerMPI_type) type(timerOMP_type) type(timerSYS_type) function timer_typer ()
 This is the constructor of the timer_type class.
More...
 

Additional Inherited Members

- Public Attributes inherited from pm_timer::timer_type
real(RKD) start
 The protected scalar real of kind double precision RKD provided as a convenience for the user to contain the start time of the timer since the processor epoch (a processor-dependent past time) in seconds.
More...
 
real(RKD) clock
 The scalar real of kind double precision RKD provided as a convenience for the user to contain the total time in seconds elapsed since the start of the timer.
The clock time can be readily can be computed as timer%clock = timer%time(since = timer%start).
More...
 
real(RKD) delta
 The scalar real of kind double precision RKD provided as a convenience for the user to contain the delta time in seconds since the last timing (last timer call).
The delta time can be readily can be computed as timer%delta = timer%time(since = timer%start) - timer%clock where timer%clock is the last clock read as timer%clock = timer%time(since = timer%start).
More...
 
real(RKD) resol
 The protected scalar real of kind double precision RKD provided as a convenience for the user to contain the time in seconds between the timer clock tics.
More...
 

Detailed Description

This is the timerMPI_type class, containing attributes and static methods for setting up a timer based on the MPI intrinsic MPI_Wtime().

See the documentation of timerMPI_typer for the non-default constructor interface of this type.
See also the documentation details of pm_timer.


Possible calling interfaces

type(timerMPI_type) :: timer
timer = timerMPI_type()
This module contains the timer procedures and derived types to facilitate timing applications at runt...
Definition: pm_timer.F90:99
This is the timerMPI_type class, containing attributes and static methods for setting up a timer base...
Definition: pm_timer.F90:377
Note
This type is available only if the library is built with the preprocessor macro MPI_ENABLED=1.
See also
timer_type
timerDAT_type
timerMPI_type
timerOMP_type
timerSYS_type


Example usage

1program example
2
3 use pm_kind, only: IK, LK, SK, RKD
4 use pm_io, only: display_type
5
6 implicit none
7
8 type(display_type) :: disp
9 disp = display_type(file = "main.out.F90")
10
11#if !defined MPI_VERSION
12 call disp%show("The MPI timer is unavailable, because this example has not been linked with an MPI library.")
13#else
14 block
15 use pm_timer, only: timerMPI_type
16 type(timerMPI_type) :: timer
17 logical(LK) :: failed
18 integer :: i
19 call disp%skip()
20 call disp%show("timer = timerMPI_type()")
21 timer = timerMPI_type()
22 call showTimerComponents()
23 call disp%skip()
24
25 call disp%skip()
26 call disp%show("timer%clock = timer%time()")
27 timer%clock = timer%time()
28 call showTimerComponents()
29 call disp%skip()
30
31 call disp%skip()
32 call disp%show("timer%delta = timer%time(since = timer%start)")
33 timer%delta = timer%time(since = timer%start)
34 call showTimerComponents()
35 call disp%skip()
36
37 call disp%skip()
38 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
39 call disp%show("!Idle for a certain number of seconds.")
40 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
41 call disp%skip()
42
43 call disp%skip()
44 call disp%show("timer = timerMPI_type()")
45 timer = timerMPI_type()
46 call disp%show("call timer%wait(seconds = 0.1_RKD)")
47 call timer%wait(seconds = 0.1_RKD)
48 call disp%show("timer%delta = timer%time() - timer%start")
49 timer%delta = timer%time() - timer%start
50 call showTimerComponents()
51 call disp%skip()
52 end block
53contains
54 impure subroutine showTimerComponents()
55 call disp%show("timer%start")
56 call disp%show( timer%start )
57 call disp%show("timer%clock")
58 call disp%show( timer%clock )
59 call disp%show("timer%delta")
60 call disp%show( timer%delta )
61 call disp%show("timer%resol")
62 call disp%show( timer%resol )
63 end subroutine
64#endif
65
66end program example
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter RKD
The double precision real kind in Fortran mode. On most platforms, this is an 64-bit real kind.
Definition: pm_kind.F90:568
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1The MPI timer is unavailable, because this example has not been linked with an MPI library.
2
Test:
test_pm_timer


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas at Austin

Definition at line 377 of file pm_timer.F90.

Member Function/Subroutine Documentation

◆ time()

procedure, nopass pm_timer::timerMPI_type::time

See getTime_proc.

Implements pm_timer::timer_type.

Definition at line 379 of file pm_timer.F90.

◆ timerMPI_typer()

type(timerMPI_type) function pm_timer::timerMPI_type::timerMPI_typer

This is the constructor of the timerMPI_type class.

Upon return, the constructor initializes all components of the timer object.
See also the documentation details of pm_timer.


Possible calling interfaces

type(timerMPI_type) :: timer
timer = timerMPI_type()
Returns
timer : The output scalar object of class timerMPI_type.
Warning
This constructor requires the MPI library to have been initialized and not finalized.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
This constructor is available only if the library is built with the preprocessor macro MPI_ENABLED=1.
Remarks
See the documentation of timerMPI_type for example usage.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, March 22, 2012, 02:51 AM, National Institute for Fusion Studies, The University of Texas at Austin

Definition at line 689 of file pm_timer.F90.

◆ wait()

procedure, nopass pm_timer::timerMPI_type::wait

See setIdle_proc.

Implements pm_timer::timer_type.

Definition at line 380 of file pm_timer.F90.


The documentation for this interface was generated from the following file: