ccm_time

CCM time routine

Routine:

ccm_time

Purpose:

Returns a time relative to some time in the past.

Minumal calling sequence:

t=ccm_time()

Required Arguments:

NONE
Returned value is double precision.

Call with all Optional Arguments:

NONE
See Specifying Optional Arguments for the syntax for using optional arguments.

Notes:

Time will not roll over for the duration of the program. Ccm_time is designed to be an easy to use routine, but might not provide the most accurate clock available on a system. The reference implementation is based on the Fortran 90 Date_and_time routine and thus has a resolution of 0.001 seconds. It returns the number of seconds since the beginning of the year in which the program was started and will handle running over December 31 to January 1 correctly.

Example:


program ccm_time_x1
    use ccm
    double precision :: t1,t2
    call ccm_init()
    t1=ccm_time()
    write(*,*)" t= ",t1
    call ccm_barrier(2.0)
    t2=ccm_time()
    write(*,*)"dt= ",t2-t1
    call ccm_close()
end program

Example output on 4 processors


[ccm_home:~/ccm/source] % ccm_time_x1
  t=   11626494.8120000
  t=   11626494.8140000
  t=   11626494.8170000
  t=   11626494.8180000
 dt=   2.00999999977648
 dt=   2.00300000049174
 dt=   2.00300000049174
 dt=   2.00999999977648
[ccm_home:~/ccm/source] % 

The call to ccm_init initializes the communication package. Each task obtaines and prints a time. The program waits at the barrier for 2 seconds then gets and prints the time difference. Ccm_close is called to close the package.

Error conditions:

NONE
Back to API and user's guide