public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: g77 second function always returns 0.0 on mingw32/egcs-1.1
@ 1998-09-24 23:18 N8TM
  1998-09-25  6:49 ` Mumit Khan
  1998-09-25 10:00 ` Dave Love
  0 siblings, 2 replies; 7+ messages in thread
From: N8TM @ 1998-09-24 23:18 UTC (permalink / raw)
  To: David.Billinghurst, egcs

In a message dated 9/24/98 10:57:09 PM Pacific Daylight Time,
David.Billinghurst@riotinto.com.au writes:

> double G77_etime_0 (real tarray[2]
>  {
>    tarray[0] = ((real)clock()) / CLOCK_PER_SEC;  /* user time */
>    tarray[1] = 0.0; /* system time */
>    return (tarray[0]+tarray[1]);
>  }
>  
I would have thought that the W9x- compatible etime_.c which Mumit used for
his egcs-1.1 cygwin32 distribution would work also for mingw32.  It should be
in his libf2c patches. It returns elapsed time, using the WinAPI
QueryPerformancexxxx(). The one distributed with standard egcs "always"
returns 0. on W95, but works with a resolution of .010 seconds on NT4.

clock() from the newlib used in cygwinb19.dll is broken also on W95.  If there
is one which works in mingw32, why isn't it used in the egcs-1.1 cygwin
distribution?

Using clock() this way fails when the 32-bit value rolls over from INT_MAX to
INT_MIN, even if you have a working clock(). Technically, clock is typed
clock_t, which isn't necessarily int. You may lose resolution by rounding off
low order bits when casting to (float).

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: g77 second function always returns 0.0 on mingw32/egcs-1.1
  1998-09-24 23:18 g77 second function always returns 0.0 on mingw32/egcs-1.1 N8TM
@ 1998-09-25  6:49 ` Mumit Khan
  1998-09-25 10:00 ` Dave Love
  1 sibling, 0 replies; 7+ messages in thread
From: Mumit Khan @ 1998-09-25  6:49 UTC (permalink / raw)
  To: N8TM; +Cc: David.Billinghurst, egcs

N8TM@aol.com writes:
> In a message dated 9/24/98 10:57:09 PM Pacific Daylight Time,
> David.Billinghurst@riotinto.com.au writes:
> 
> > double G77_etime_0 (real tarray[2]
> >  {
> >    tarray[0] = ((real)clock()) / CLOCK_PER_SEC;  /* user time */
> >    tarray[1] = 0.0; /* system time */
> >    return (tarray[0]+tarray[1]);
> >  }
> >  
> I would have thought that the W9x- compatible etime_.c which Mumit used for
> his egcs-1.1 cygwin32 distribution would work also for mingw32.  It should be
> in his libf2c patches. It returns elapsed time, using the WinAPI
> QueryPerformancexxxx(). The one distributed with standard egcs "always"
> returns 0. on W95, but works with a resolution of .010 seconds on NT4.

It's probably a screwup on my part. I'll check it out and put up a fixed
library.

Tim, could you send me a testcase for your changes so that I can do the
right thing in the future. Thanks. 

Regards,
Mumit

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: g77 second function always returns 0.0 on mingw32/egcs-1.1
  1998-09-24 23:18 g77 second function always returns 0.0 on mingw32/egcs-1.1 N8TM
  1998-09-25  6:49 ` Mumit Khan
@ 1998-09-25 10:00 ` Dave Love
  1998-09-25 19:05   ` Mumit Khan
  1 sibling, 1 reply; 7+ messages in thread
From: Dave Love @ 1998-09-25 10:00 UTC (permalink / raw)
  To: egcs

>>>>> "Tim" == Tim Prince <N8TM@aol.com> writes:

 Tim> I would have thought that the W9x- compatible etime_.c which
 Tim> Mumit used for his egcs-1.1 cygwin32 distribution would work
 Tim> also for mingw32.  It should be in his libf2c patches.

Have these patches been submitted?  I haven't seen them and can't find
them.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: g77 second function always returns 0.0 on mingw32/egcs-1.1
  1998-09-25 10:00 ` Dave Love
@ 1998-09-25 19:05   ` Mumit Khan
  0 siblings, 0 replies; 7+ messages in thread
From: Mumit Khan @ 1998-09-25 19:05 UTC (permalink / raw)
  To: Dave Love; +Cc: egcs, N8TM

Dave Love <d.love@dl.ac.uk> writes:
> >>>>> "Tim" == Tim Prince <N8TM@aol.com> writes:
> 
>  Tim> I would have thought that the W9x- compatible etime_.c which
>  Tim> Mumit used for his egcs-1.1 cygwin32 distribution would work
>  Tim> also for mingw32.  It should be in his libf2c patches.
> 
> Have these patches been submitted?  I haven't seen them and can't find
> them.

Damn. Another thing I haven't gotten around to ... too many things going
on to spend any time on this.

I do have the unedited patches available at:

   ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygwin32/egcs-1.1/
				patches/broken-down/egcs-1.1-libf2c.diff

I have a slightly edited version somewhere, but I can't seem to find it
right now.

Regards,
Mumit


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: g77 second function always returns 0.0 on mingw32/egcs-1.1
@ 1998-09-26  0:52 N8TM
  0 siblings, 0 replies; 7+ messages in thread
From: N8TM @ 1998-09-26  0:52 UTC (permalink / raw)
  To: khan; +Cc: David.Billinghurst, egcs

In a message dated 9/25/98 12:21:32 PM Pacific Daylight Time,
khan@xraylith.wisc.edu writes:

> a testcase for your changes
I checked the results of running libf2c/libU77/u77-test.f (Dave Love's test
program) on your binary distribution of egcs-1.1 for cygwin32, and with the
standard egcs-19980914, under W95.  Reading somewhat between the lines, I see
that the standard version requires over 1000 times as long to obtain a clock
tick, and even so never registers a non-zero result for etime() or dtime().
So this test program shows that your distribution behaves as I intended.  The
test program doesn't call cpu_time() or second(), but the compiler treats
these as aliases for etime().

A longer way to test the timers is to use them to run Livermore Kernels or
some similar application which tests the resolution, overhead, and
repeatability of timer calls.  The resolution of cpu_time et al under W95 with
Mumit's egcs-1.1 binary is about 6 microseconds, or about 7 ticks of the SCT
timer.

BTW, the hpux version of etime() has .010 seconds resolution for the returned
value of (user + system time) but the resolution of user time by itself is
1.000 second, so I won't shed any tears when they get around to providing
cpu_time(), which doesn't give access to separate user and system times.
Likewise, my linux has a resolution of .050 seconds for the separate
components of etime() and a resolution of .01 seconds for their sum.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: g77 second function always returns 0.0 on mingw32/egcs-1.1
  1998-09-24 18:34 Billinghurst, David (RTD)
@ 1998-09-25 10:10 ` Dave Love
  0 siblings, 0 replies; 7+ messages in thread
From: Dave Love @ 1998-09-25 10:10 UTC (permalink / raw)
  To: egcs

>>>>> "DB" == Billinghurst, David (RTD) <David.Billinghurst@riotinto.com.au> writes:

 DB> The fortran function second() always returns 0.0 on
 DB> mingw32/egcs-1.1.  second() uses etime()

Do you mean that the g77 `second' intrinsic calls something actually
called `etime'?  The implementation in egcs-1.1 is a trivial interface
to `G77_etime_0' and I thought the Doze problems were with the latter
or, rather, the libc routines it calls.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* g77 second function always returns 0.0 on mingw32/egcs-1.1
@ 1998-09-24 18:34 Billinghurst, David (RTD)
  1998-09-25 10:10 ` Dave Love
  0 siblings, 1 reply; 7+ messages in thread
From: Billinghurst, David (RTD) @ 1998-09-24 18:34 UTC (permalink / raw)
  To: 'egcs@cygnus.com'

The fortran function second() always returns 0.0 on mingw32/egcs-1.1.
second() uses etime() which isn't ANSI and doesn't seem to be present in
mingw32,
so it defaults to zero.

mingw32 does have the clock() function, so we could do something like

double G77_etime_0 (real tarray[2]
{
  tarray[0] = ((real)clock()) / CLOCK_PER_SEC;  /* user time */
  tarray[1] = 0.0; /* system time */
  return (tarray[0]+tarray[1]);
}

Any comments before I try it?

+++++++++++++++++++++++++++++++++++++++++
(Mr) David Billinghurst
Comalco Research and Technical Support
PO Box 316, Thomastown, Vic, Australia, 3074
Phone:	+61 3 9469 0642
FAX:	+61 3 9462 2700
Email:	David.Billinghurst@riotinto.com.au


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1998-09-26  0:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-24 23:18 g77 second function always returns 0.0 on mingw32/egcs-1.1 N8TM
1998-09-25  6:49 ` Mumit Khan
1998-09-25 10:00 ` Dave Love
1998-09-25 19:05   ` Mumit Khan
  -- strict thread matches above, loose matches on Subject: below --
1998-09-26  0:52 N8TM
1998-09-24 18:34 Billinghurst, David (RTD)
1998-09-25 10:10 ` Dave Love

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).