next up previous contents
Next: join_watchgroup Up: Reference Manual Previous: end_pause_watch

inquiry_stopwatch

INQUIRY_STOPWATCH

returns StopWatch options and system dependent values

SYNOPSIS
subroutine inquiry_stopwatch (default_clock, io_unit_print, io_unit_error, print_errors, abort_errors, print_form, cpu_avail, user_avail, sys_avail, wall_avail, cpu_prec, wall_prec, version, err)


character(len=*), optional, intent(OUT) :: default_clock(4)

integer, optional, intent(OUT) :: io_unit_print, io_unit_error

logical, optional, intent(OUT) :: print_errors, abort_errors

character(len=*), optional, intent(OUT) :: print_form

logical, optional, intent(OUT) :: cpu_avail, user_avail, sys_avail, wall_avail

real, optional, intent(OUT) :: cpu_prec, wall_prec

character(len=16), optional, intent(OUT) :: version

integer, optional, intent(OUT) :: err

DESCRIPTION
Returns the value of StopWatch options and other system and implementation dependent values. All arguments are optional and have intent OUT.

The following arguments can be set by option_stopwatch. See option_stopwatch(3) for further details on their meaning. default_clock is the set of clocks that are used when the clock argument is omitted in a call to a StopWatch routine. io_unit_print returns the unit for output from subroutine print_watch. io_unit_error returns the unit for any error messages printed by StopWatch . If print_errors is TRUE, then an error message will be printed to io_unit_error whenever an error condition occurs. If abort_errors is TRUE, then the program will terminate when an error condition occurs. print_form is the format used by print_watch(3) when the form argument is omitted.

The remaining arguments return system information that can not be changed.

Since an interface to the CPU clock is not part of the Fortran 90 standard, the availability of clocks and clock precisions are implementation dependent. Not all clocks are available in all implementations. The logical arguments cpu_avail, user_avail, sys_avail and wall_avail return TRUE if the respective clock is available in this implementation.

The precision (the shortest time interval that can be measured) of the clocks also varies between implementations. The real variables cpu_prec and wall_prec return the precision of the CPU and wall clocks, in seconds. It is assumed that the user and sys clocks have the same precision as the CPU clock. If the CPU clock is not available, then cpu_prec will return 0., and similar for the wall clock.

The character string version returns the version number of StopWatch .

DIAGNOSTICS
If present, the optional intent OUT integer argument err returns a status code. The code is the sum of the values listed below.

An error message will be printed to a specified I/O unit (unit 6 by default) if print_errors is TRUE (default is TRUE). The error message contains more detail about the cause of the error than can be obtained from just the status code, so you should set print_errors to TRUE if you have trouble determining the cause of the error.

If abort_errors is TRUE (default is FALSE), the program will terminate on an error condition. Otherwise, the program will continue execution but the requested value(s) might not be returned.

See option_stopwatch(3) for further information on print_errors, abort_errors and I/O units.

The relevant status codes and messages are:

0
No errors; execution successful.

512
Failed to allocate required memory. This error occurs if the Fortran allocate statement returns a nonzero status indicating that memory could not be allocated. Avoid memory leaks by always destroying watches and groups before recreating them, and destroying local variable watches and groups before returning from a subroutine.

EXAMPLES
logical user_is_there
real cpu_prec

call inquiry_stopwatch(user_avail=user_is_there)
call inquiry_stopwatch(cpu_prec=cpu_prec)

The first call determines if the user clock is available in this implementation. The second call determines the shortest time that can be measured by the CPU clock.

BUGS
None known.



next up previous contents
Next: join_watchgroup Up: Reference Manual Previous: end_pause_watch



william.mitchell@nist.gov