public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/37832] New: System_Clock
@ 2008-10-15 4:01 DavidLNewton at yahoo dot com
2008-10-15 5:51 ` [Bug fortran/37832] System_Clock kargl at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: DavidLNewton at yahoo dot com @ 2008-10-15 4:01 UTC (permalink / raw)
To: gcc-bugs
Resolution of the System_Clock(TICKS,RATE,MAX) intrinsic degraded from about
3.6 MHz to 1,000 Hz when I upgraded from g77 to gfortran (for Windows).
There is a computer clock that I have accessed in Visual Basic that represents
elapsed time since my computer was turned on, returned as an integer*8
quantity, which operates at the higher frequency.
It should be possible for you to offer something similar by re-writing
System_Clock(TICKS,RATE,MAX) to operate at the higher frequency (as it was in
g77) and return TICKS as an integer*8.
--
Summary: System_Clock
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: DavidLNewton at yahoo dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37832
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/37832] System_Clock
2008-10-15 4:01 [Bug fortran/37832] New: System_Clock DavidLNewton at yahoo dot com
@ 2008-10-15 5:51 ` kargl at gcc dot gnu dot org
2008-10-15 6:34 ` burnus at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu dot org @ 2008-10-15 5:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from kargl at gcc dot gnu dot org 2008-10-15 05:50 -------
You can already get an integer(8) result.
integer(8) ticks,rate
call system_clock(count=ticks,count_rate=rate)
print *, ticks, rate
end
gfc -o z a.f90
./z
2131173368 1000
count_rate is determined from either /usr/include/sys/time.h or
/usr/include/time.h. You need to munge your system header files.
For the record, there is very little OS specific code in the
library, and I would actively oppose putting more OS specific code
in the library. If you want higher resolution try cpu_time, which
is one of the few routines that has OS specific code.
You can also write your timing routine in C and use ISO C binding
to call that routine.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37832
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/37832] System_Clock
2008-10-15 4:01 [Bug fortran/37832] New: System_Clock DavidLNewton at yahoo dot com
2008-10-15 5:51 ` [Bug fortran/37832] System_Clock kargl at gcc dot gnu dot org
@ 2008-10-15 6:34 ` burnus at gcc dot gnu dot org
2008-11-03 2:19 ` jvdelisle at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-10-15 6:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from burnus at gcc dot gnu dot org 2008-10-15 06:33 -------
See also PR 28484 comment 5.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37832
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/37832] System_Clock
2008-10-15 4:01 [Bug fortran/37832] New: System_Clock DavidLNewton at yahoo dot com
2008-10-15 5:51 ` [Bug fortran/37832] System_Clock kargl at gcc dot gnu dot org
2008-10-15 6:34 ` burnus at gcc dot gnu dot org
@ 2008-11-03 2:19 ` jvdelisle at gcc dot gnu dot org
2008-11-09 7:47 ` jvdelisle at gcc dot gnu dot org
2008-11-09 18:19 ` jvdelisle at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-11-03 2:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jvdelisle at gcc dot gnu dot org 2008-11-03 02:17 -------
I will add this to my list and see if we can get to what g77 does.
--
jvdelisle at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jvdelisle at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-11-03 02:17:47
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37832
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/37832] System_Clock
2008-10-15 4:01 [Bug fortran/37832] New: System_Clock DavidLNewton at yahoo dot com
` (2 preceding siblings ...)
2008-11-03 2:19 ` jvdelisle at gcc dot gnu dot org
@ 2008-11-09 7:47 ` jvdelisle at gcc dot gnu dot org
2008-11-09 18:19 ` jvdelisle at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-11-09 7:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jvdelisle at gcc dot gnu dot org 2008-11-09 07:46 -------
According to the g77 documentation, system_clock uses the times(2) function.
gfortran uses either the time(2) (note no 's' on the end of the name) or the
gettimeofday function. When I revise the gfortran routines to use the times(2)
function I get results similar to g77.
Now question is, how equivalent to g77 do we want to get in this case?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37832
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/37832] System_Clock
2008-10-15 4:01 [Bug fortran/37832] New: System_Clock DavidLNewton at yahoo dot com
` (3 preceding siblings ...)
2008-11-09 7:47 ` jvdelisle at gcc dot gnu dot org
@ 2008-11-09 18:19 ` jvdelisle at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-11-09 18:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jvdelisle at gcc dot gnu dot org 2008-11-09 18:18 -------
After doing some more testing and comparing g77 vs gfortran, gfortran actually
provides higher resolution 1000 ticks/sec then g77 100 ticks/second on at least
my platform (x86-64-linux) On Cygwin, results are identical except gfortran
does allow integer(kind=8) where g77 does not.
Therefore, I am closing this as "not a bug". If greater timing precision is
needed, then Steve's suggestion of binding to a custom C routine is the wy to
go.
--
jvdelisle at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |WORKSFORME
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37832
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-11-09 18:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-15 4:01 [Bug fortran/37832] New: System_Clock DavidLNewton at yahoo dot com
2008-10-15 5:51 ` [Bug fortran/37832] System_Clock kargl at gcc dot gnu dot org
2008-10-15 6:34 ` burnus at gcc dot gnu dot org
2008-11-03 2:19 ` jvdelisle at gcc dot gnu dot org
2008-11-09 7:47 ` jvdelisle at gcc dot gnu dot org
2008-11-09 18:19 ` jvdelisle at gcc dot gnu dot org
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).