Next: Obtaining and Compiling
Up: StopWatch User's Guide
Previous: Introduction
This section
provides just enough information to start using the basic features
of StopWatch . If you run into trouble or want to learn about the advanced
features, read the rest of the StopWatch User's Guide and the man pages.
- 1.
- Select a makefile that matches the configuration of your
system. The makefile names are of the form mf.<os>.<compiler>.<cpusec>
where <os> is the operating system, <compiler> is the Fortran 90
compiler, and <cpusec> is the form of subroutine cpu_second.
If you don't find your system, select a makefile for a similar
system and modify it. The makefile contains examples of how to
compile your program along with StopWatch .
- 2.
- Using an example program as a model (for example, ``simple''),
modify the makefile to compile your program.
- 3.
- In each program unit that calls a StopWatch subroutine, insert
the statement
use stopwatch
- 4.
- Declare one or more variables to be of type watchtype, for example
type (watchtype) w
- 5.
- Instrument your code as appropriate with subroutine calls:
call create_watch(w)
call start_watch(w)
call stop_watch(w)
call reset_watch(w)
call print_watch(w)
call read_watch(val,w,s)
call destroy_watch(w)
where s in read_watch is one of the character strings 'cpu',
'user', 'sys', or 'wall', depending on what clock you want to read, and
val is a real variable (of default kind) in which the clock value is
returned.