Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Ross A Knepper <rak@zk3.dec.com>
To: axp-list@redhat.com
Subject: Re: A few questions about compiling code and performance
Date: Wed, 1 Nov 2000 14:34:55 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.21.0011011424140.25598-100000@imhotep.zk3.dec.com> (raw)
In-Reply-To: <B62586AA.75F5%amaral@ storeria.bio.ou.edu>

On Wed, 1 Nov 2000, J. Pedro Sousa do Amaral wrote:
> This FORTRAN code was initially set to compile with the flag
> -fast, but that wouldn't work in my system (AS 200, RH 5.2 highly modified,
> latest stable kernel, and pretty recent compilers--g77 version egcs-2.91.66
> 19990314). Is there an equivalent flag in the GNU FORTRAN compiler?

-fast is a compiler specific flag.  gnu compilers use -O for general
optimizations, which will probably make it run faster.  i dont use
fortran, but with gcc, there are multiple levels of optimization that get
more aggressive (eg -O6 is more sophisticated than -O2, which may or may
not mean it runs faster)

> Another question is about bogometer benchmarking. How useful is to use the
> function time to benchmark the performance of a given program compiled
> across different machines?

it depends what you want to know.  time is pretty accurate about how long
a program takes to run, but if you're comparing between systems, the
information you derive from it is limited.  it would be unfair to conclude
that one compiler generates faster code, or that one processor is
faster.  all you can safely say is that for your application, compiler A
gives better performance on platform A than compiler B gives on platform
B.

> From the man time: "The time utility executes and
> times utility. After the utility finishes, time writes the total time
> elapsed, the time consumed by system overhead, and the time used to execute
> utility to the standard error stream." What is exactly the meaning of the
> two last times reported?

wall clock time is simply the difference in time between when it begins
and when it ends.  on a busy system, this will be longer than the sum of
the system and user times, because other processes are running at the same
time.  user time is the actual time consumed by the processor in running
the code you wrote.  system time is the actual processor time spent
within the kernel executing on behalf of your process.  system time
includes system calls and some types of faults (like memory management).

on an idle system, user+system should be roughly equal to wall clock time.

>            parameter (nbound=max(nbins,ndatar))

you may need to define a macro for max, or include some file which defines
it.  not knowing fortran, i can't help much with this.  but in c, it would
be:

#define max(a,b) ((a) > (b) ? (a) : (b))

hope this helps

 -ross




  reply	other threads:[~2000-11-01 19:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-31 12:05 performance patches David Addison
2000-10-31 13:19 ` Rich Payne
2000-10-31 20:01 ` Custom AXP kernel Paul Allen
2000-11-01  1:05   ` Peter Petrakis
2000-11-01  1:55     ` rtlinux-3.0-pre8 running on an alpha pc164? Terry L. Ridder
2000-11-01 12:02   ` Custom AXP kernel Greg Lindahl
2000-11-01 14:36     ` A few questions about compiling code and performance J. Pedro Sousa do Amaral
2000-11-01 19:34       ` Ross A Knepper [this message]
2000-11-01 19:52       ` arthur m coucouvitis
2000-11-02  0:50         ` W Bauske
2000-11-01  1:48 ` performance patches Chai Mee Joon
  -- strict thread matches above, loose matches on Subject: below --
2000-11-01 20:38 A few questions about compiling code and performance Eugene Chu
2000-11-01 22:26 Brad Lucier
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox