Newsgroups: comp.parallel
From: Erik Demaine <eddemain@daisy.uwaterloo.ca>
Subject: Re: timers for multiprocessors
Organization: University of Waterloo
Date: 3 Apr 1997 14:53:35 GMT
Message-ID: <5i0g9f$kcd@server1.ctc.com>

A Leservot <leservot@limeil.cea.fr> wrote:
: I am looking for a portable API multiprocessor timer for f90, which 
: would give me between two points (in a f90 program with some directives) :
: [...]
: 2) total cpu time used
: 3) maximum number of cpu used
: 4) cpu time used when the program is running on 1, 2, 3,...n processors. 
: Points 2) 3) and 4) are supplied with MTIMESX() Cray T90 function, but
: I've not found similar function for DEC, SGI or IBM. 

First off: CPU time will not be very useful in most parallel applications,
because it includes *some* of the communication time *but not all*, and the
amount that it includes often varies.

The omition of a CPU time routine in Fortran 90 is IMO a mistake.
Meanwhile, you can use the following to determine the total number of
seconds used so far on the local processor (then use MPI_Reduce to find
max or sum, for example).  You should probably take a difference between
the current amount of time used and the time you thought you started at.

   * On RS/6000 (e.g., SP2):
        integer mclock
        seconds = mclock () / 100.0
   * On most Berkeley UNIX:
        real etime, vec(2)
        seconds = etime (vec)
   * On Cray:
        real second
        seconds = second ()

Erik
-- 
Erik Demaine                 ()  e-mail: eddemain@daisy.uwaterloo.ca
Dept. of Computer Science    ||  URL: http://daisy.uwaterloo.ca/~eddemain/
University of Waterloo       ||  PGP key: finger me.  "Maturity is switching
Waterloo, ON Canada N2L 3G1  ()  from passive voice to active voice" -P. Alder

--
Articles to parallel@ctc.com (Administrative: bigrigg@ctc.com)
Archive: http://www.hensa.ac.uk/parallel/internet/usenet/comp.parallel


