[comp.sys.atari.st] GCC times

gjh@otter.hpl.hp.com (Graham Higgins) (12/08/89)

Can anyone enlighten me on the following technical query?

The C system call "times(2)" -- my SysV manual states:

"The times are in units of 1/HZ seconds, where HZ is processor dependent (see
<sys/param.h>)."

The sys/param.h from J.Bammi's port of GCC to the ST doesn't have a definition
for HZ.

My local Sun's sys/param.h file defines it as:

#define HZ      60              
/* ticks/second according to syscalls that return values in ticks */

My HP9000/350 defines it as:

#define HZ      50              
/* Ticks/second of the clock (in kernel land) */

Can anyone provide me with an appropriate value for HZ for an (unaccelerated)
ST?

Background ...

I have a Prolog benchmark indicating a (literally) incredibly slow ST
performance level and here there's a caveat, the benchmark README file contains
the following warning:

    WARNING: Naive reverse is the classical benchmark for
             computing "LIPS" (Logical Inferences Per Second),
             but it's such a small benchmark that LIPS numbers
             so obtained may not necessarily reflect overall system
             performance, and should be taken with a large pinch of salt.


*However* -- on my HP9000/350, the same benchmark (run by the same Prolog)
indicates a performance level of 30KLips whereas the ST can apparently run only
1.5KLips!. I was surprised at (and suspicious of) the size of the difference in
apparent performance. I know they said "should be taken with a large pinch of
salt", but this requires a cartload!

Crude stopwatch timing indicates that the ST performs the benchmark in ~40
secs, the HP9000/350 in ~10 secs. From those crude timings, the ST benchmark
indicator should be around 5 to 6KLips, not 1.5KLips. So, perhaps a problem
with times(2) ??

The Prolog is SUNY/UArizona's StonyBrook Prolog, GCC-cross-compiled to ST. The
benchmark relies upon a "cputime" function ---

    int msec;
    struct tms t;
    times(&t);
    msec = t.tms_utime * 1000 / 60;

which is supposed to return the cpu time in millseconds. 

Can anyone tell me is this appropriate for GCC for the ST? --- it *looks*
plausible, but the times don't seem to pan out properly? 

If I can fix this, I'll make the ST port of Stony Brook Prolog available.

Cheers,

Graham
======

------------------------------------------------------------------
Graham Higgins             	|  Phone: (0272) 799910 x 24060
Hewlett-Packard Labs    	|  gray@hpl.hp.co.uk
Bristol                       	|  gray%hplb.uucp@ukc.ac.uk
U.K.                          	|  gray@hplb.hpl.hp.com
------------------------------------------------------------------
Disclaimer: My opinions above are exactly that, mine and opinions.
------------------------------------------------------------------

dag@per2.UUCP (Daniel A. Glasser) (12/20/89)

In article <570049@otter.hpl.hp.com>, 
	gjh@otter.hpl.hp.com (Graham Higgins) writes:
[edited for brevity]
> The C system call "times(2)" -- my SysV manual states:
> "The times are in units of 1/HZ seconds, where HZ is processor dependent (see
> <sys/param.h>)."
> The sys/param.h from J.Bammi's port of GCC to the ST doesn't have a definition
> for HZ.
> Can anyone provide me with an appropriate value for HZ for an (unaccelerated)
> ST?

I cannot tell you for sure about the particular times() function in the
particular library (if I were at home, I could), but the ST's system 'tick'
clock is a 200Hz clock.  Try that value out and see if the results
seem plausible.

							Daniel
-- 
 _____________________________________________________________________________
    Daniel A. Glasser                           One of those things that goes
    uwvax!per2!dag                              "BUMP!!!(ouch)" in the night. 
 ---Persoft, Inc.---------465 Science Drive-------Madison, WI 53711-----------