M_stopwatch Module

                 M_StopWatch Version 1.1

M_StopWatch is a Fortran 90 module for portable, easy-to-use measurement of execution time. It supports four clocks

  o wall clock
  o CPU clock
  o user CPU clock
  o system CPU clock

and returns all times in seconds.

It provides a simple means of determining which clocks are available, and the precision of those clocks.

M_StopWatch is used by instrumenting your code with subroutine calls that mimic the operation of a stop watch. M_StopWatch supports multiple watches, and provides the concept of watch groups to allow functions to operate on multiple watches simultaneously.

For further information on using M_StopWatch, see the User Guide or man pages.

The M_StopWatch software and documentation have been produced as part of work done by the U.S. Government, and are not subject to copyright in the United States.

William F. Mitchell mitchell@cam.nist.gov National Institute of Standards and Technology December 2, 1996

The research software provided on this web site (“software”) is provided by NIST as a public service. You may use, copy and distribute copies of the software in any medium, provided that you keep intact this entire notice. You may improve, modify and create derivative works of the software or any portion of the software, and you may copy and distribute such modifications or works. Modified works should carry a notice stating that you changed the software and should note the date and nature of any such change. Please explicitly acknowledge the National Institute of Standards and Technology as the source of the software.

The software is expressly provided “AS IS.” NIST MAKES NO WARRANTY OF ANY KIND,

EXPRESS, IMPLIED, IN FACT OR ARISING BY OPERATION OF LAW, INCLUDING, WITHOUT

LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR

PURPOSE, NON-INFRINGEMENT AND DATA ACCURACY. NIST NEITHER REPRESENTS NOR

WARRANTS THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE,

OR THAT ANY DEFECTS WILL BE CORRECTED. NIST DOES NOT WARRANT OR MAKE ANY

REPRESENTATIONS REGARDING THE USE OF THE SOFTWARE OR THE RESULTS THEREOF,

INCLUDING BUT NOT LIMITED TO THE CORRECTNESS, ACCURACY, RELIABILITY, OR

USEFULNESS OF THE SOFTWARE.

You are solely responsible for determining the appropriateness of using and distributing the software and you assume all risks associated with its use, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of operation. This software is not intended to be used in any situation where a failure could cause risk of injury or damage to property. The software was developed by NIST employees. NIST employee contributions are not subject to copyright protection within the United States.



Contents


Interfaces

public interface create_watch

  • private subroutine create_watch_aa(watch, clock, name, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(out), dimension(:):: watch
    character(len=*), intent(in), dimension(:):: clock
    character(len=*), intent(in), optional dimension(:):: name
    integer, intent(out), optional :: err
  • private subroutine create_watch_as(watch, clock, name, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(out), dimension(:):: watch
    character(len=*), intent(in), optional :: clock
    character(len=*), intent(in), optional dimension(:):: name
    integer, intent(out), optional :: err
  • private subroutine create_watch_sa(watch, clock, name, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(out) :: watch
    character(len=*), intent(in), dimension(:):: clock
    character(len=*), intent(in), optional :: name
    integer, intent(out), optional :: err
  • private subroutine create_watch_ss(watch, clock, name, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(out) :: watch
    character(len=*), intent(in), optional :: clock
    character(len=*), intent(in), optional :: name
    integer, intent(out), optional :: err

public interface create_watchgroup

  • private subroutine create_watchgroup_a(watch, handle, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    type(watchgroup), intent(out) :: handle
    integer, intent(out), optional :: err
  • private subroutine create_watchgroup_s(watch, handle, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), optional :: watch
    type(watchgroup), intent(out), optional :: handle
    integer, intent(out), optional :: err

public interface destroy_watch

  • private subroutine destroy_watch_aa(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(inout), dimension(:):: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine destroy_watch_as(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(inout), dimension(:):: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err
  • private subroutine destroy_watch_sa(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(inout) :: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine destroy_watch_ss(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(inout) :: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err

public interface end_pause_watch

  • private subroutine end_pause_watch_aa(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine end_pause_watch_as(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err
  • private subroutine end_pause_watch_sa(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine end_pause_watch_ss(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err
  • private subroutine end_pause_watch_ga(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchgroup), intent(in) :: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine end_pause_watch_gs(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchgroup), intent(in) :: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err

public interface join_watchgroup

  • private subroutine join_watchgroup_a(watch, handle, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    type(watchgroup), intent(inout) :: handle
    integer, intent(out), optional :: err
  • private subroutine join_watchgroup_s(watch, handle, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    type(watchgroup), intent(inout) :: handle
    integer, intent(out), optional :: err

public interface leave_watchgroup

  • private subroutine leave_watchgroup_a(watch, handle, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    type(watchgroup), intent(inout) :: handle
    integer, intent(out), optional :: err
  • private subroutine leave_watchgroup_s(watch, handle, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    type(watchgroup), intent(inout) :: handle
    integer, intent(out), optional :: err

public interface option_stopwatch

  • private subroutine option_stopwatch_a(default_clock, io_unit_print, io_unit_error, print_errors, abort_errors, print_form, err)

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in), dimension(:):: default_clock
    integer, intent(in), optional :: io_unit_print
    integer, intent(in), optional :: io_unit_error
    logical, intent(in), optional :: print_errors
    logical, intent(in), optional :: abort_errors
    character(len=*), intent(in), optional :: print_form
    integer, intent(out), optional :: err
  • private subroutine option_stopwatch_s(default_clock, io_unit_print, io_unit_error, print_errors, abort_errors, print_form, err)

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in), optional :: default_clock
    integer, intent(in), optional :: io_unit_print
    integer, intent(in), optional :: io_unit_error
    logical, intent(in), optional :: print_errors
    logical, intent(in), optional :: abort_errors
    character(len=*), intent(in), optional :: print_form
    integer, intent(out), optional :: err

public interface pause_watch

  • private subroutine pause_watch_aa(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine pause_watch_as(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err
  • private subroutine pause_watch_sa(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine pause_watch_ss(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err
  • private subroutine pause_watch_ga(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchgroup), intent(in) :: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine pause_watch_gs(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchgroup), intent(in) :: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err

public interface print_watch

  • private subroutine print_watch_aa(watch, clock, title, form, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), dimension(:):: clock
    character(len=*), intent(in), optional :: title
    character(len=*), intent(in), optional :: form
    integer, intent(out), optional :: err
  • private subroutine print_watch_as(watch, clock, title, form, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), optional :: clock
    character(len=*), intent(in), optional :: title
    character(len=*), intent(in), optional :: form
    integer, intent(out), optional :: err
  • private subroutine print_watch_sa(watch, clock, title, form, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), dimension(:):: clock
    character(len=*), intent(in), optional :: title
    character(len=*), intent(in), optional :: form
    integer, intent(out), optional :: err
  • private subroutine print_watch_ss(watch, clock, title, form, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), optional :: clock
    character(len=*), intent(in), optional :: title
    character(len=*), intent(in), optional :: form
    integer, intent(out), optional :: err
  • private subroutine print_watch_ga(watch, clock, title, form, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchgroup), intent(in) :: watch
    character(len=*), intent(in), dimension(:):: clock
    character(len=*), intent(in), optional :: title
    character(len=*), intent(in), optional :: form
    integer, intent(out), optional :: err
  • private subroutine print_watch_gs(watch, clock, title, form, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchgroup), intent(in) :: watch
    character(len=*), intent(in), optional :: clock
    character(len=*), intent(in), optional :: title
    character(len=*), intent(in), optional :: form
    integer, intent(out), optional :: err

public interface read_watch

  • private subroutine read_watch_aa(read_result, watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    real, pointer, dimension(:,:):: read_result
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine read_watch_as(read_result, watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    real, pointer, dimension(:):: read_result
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in) :: clock
    integer, intent(out), optional :: err
  • private subroutine read_watch_ax(read_result, watch, err)

    Arguments

    Type IntentOptional AttributesName
    real, pointer, dimension(:,:):: read_result
    type(watchtype), intent(in), dimension(:):: watch
    integer, intent(out), optional :: err
  • private subroutine read_watch_sa(read_result, watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    real, pointer, dimension(:):: read_result
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine read_watch_ss(read_result, watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    real, intent(out) :: read_result
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in) :: clock
    integer, intent(out), optional :: err
  • private subroutine read_watch_sx(read_result, watch, err)

    Arguments

    Type IntentOptional AttributesName
    real, pointer, dimension(:):: read_result
    type(watchtype), intent(in) :: watch
    integer, intent(out), optional :: err

public interface reset_watch

  • private subroutine reset_watch_aa(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine reset_watch_as(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err
  • private subroutine reset_watch_sa(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine reset_watch_ss(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err
  • private subroutine reset_watch_ga(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchgroup), intent(in) :: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine reset_watch_gs(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchgroup), intent(in) :: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err

public interface start_watch

  • private subroutine start_watch_aa(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine start_watch_as(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err
  • private subroutine start_watch_sa(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine start_watch_ss(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err
  • private subroutine start_watch_ga(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchgroup), intent(inout) :: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine start_watch_gs(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchgroup), intent(inout) :: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err

public interface stop_watch

  • private subroutine stop_watch_aa(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine stop_watch_as(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in), dimension(:):: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err
  • private subroutine stop_watch_sa(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine stop_watch_ss(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchtype), intent(in) :: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err
  • private subroutine stop_watch_ga(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchgroup), intent(in) :: watch
    character(len=*), intent(in), dimension(:):: clock
    integer, intent(out), optional :: err
  • private subroutine stop_watch_gs(watch, clock, err)

    Arguments

    Type IntentOptional AttributesName
    type(watchgroup), intent(in) :: watch
    character(len=*), intent(in), optional :: clock
    integer, intent(out), optional :: err

Derived Types

type, public :: watchgroup

type, public :: watchtype


Subroutines

public subroutine destroy_watchgroup(handle, err)

Arguments

Type IntentOptional AttributesName
type(watchgroup), intent(inout) :: handle
integer, intent(out), optional :: err

public 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)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(out), optional dimension(:):: default_clock
integer, intent(out), optional :: io_unit_print
integer, intent(out), optional :: io_unit_error
logical, intent(out), optional :: print_errors
logical, intent(out), optional :: abort_errors
character(len=*), intent(out), optional :: print_form
logical, intent(out), optional :: cpu_avail
logical, intent(out), optional :: user_avail
logical, intent(out), optional :: sys_avail
logical, intent(out), optional :: wall_avail
real, intent(out), optional :: cpu_prec
real, intent(out), optional :: wall_prec
character(len=*), intent(out), optional :: version
integer, intent(out), optional :: err