This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, libfortran] Use high resolution clock if available, timing cleanup


On Mon, Jan 31, 2011 at 22:53, Janne Blomqvist
<blomqvist.janne@gmail.com> wrote:
> On Mon, Jan 31, 2011 at 22:46, Steve Kargl
> <sgk@troutmask.apl.washington.edu> wrote:
>> On Mon, Jan 31, 2011 at 10:18:45PM +0200, Janne Blomqvist wrote:
>>> 2011-01-31 ÂJanne Blomqvist Â<jb@gcc.gnu.org>
>>>
>>> Â Â Â * configure.ac: Check for clock_gettime().
>>> Â Â Â * configure: Regenerated.
>>> Â Â Â * config.h.in: Regenerated.
>>> Â Â Â * intrinsics/time_1.h (__time_1): Rename to gf_cputime, add
>>> Â Â Â times() fallback.
>>> Â Â Â (gf_gettime): New function.
>>> Â Â Â * intrinsics/cpu_time.c (__cpu_time_1): Update to call gf_cputime.
>>> Â Â Â * intrinsics/date_and_time.c (date_and_time): Use gf_gettime.
>>> Â Â Â * intrinsics/dtime.c (dtime_sub): Use gf_cputime.
>>> Â Â Â * intrinsics/etime.c (etime_sub): Use gf_cputime.
>>> Â Â Â * intrinsics/system_clock.c (system_clock_4): Use gf_gettime.
>>> Â Â Â (system_clock_8): Use gf_gettime, increase count rate to allow
>>> Â Â Â nanosecond precision, remove overflow prone branch.
>>>
>>
>> OK.
>
> Thanks for the quick review!
>
> Sending    Âlibgfortran/ChangeLog
> Sending    Âlibgfortran/config.h.in
> Sending    Âlibgfortran/configure
> Sending    Âlibgfortran/configure.ac
> Sending    Âlibgfortran/intrinsics/cpu_time.c
> Sending    Âlibgfortran/intrinsics/date_and_time.c
> Sending    Âlibgfortran/intrinsics/dtime.c
> Sending    Âlibgfortran/intrinsics/etime.c
> Sending    Âlibgfortran/intrinsics/system_clock.c
> Sending    Âlibgfortran/intrinsics/time_1.h
> Transmitting file data ..........
> Committed revision 169449.

Oops, I just noticed a small bug,

Index: intrinsics/time_1.h
===================================================================
--- intrinsics/time_1.h (revision 169449)
+++ intrinsics/time_1.h (working copy)
@@ -184,7 +184,7 @@ gf_cputime (long *user_sec, long *user_u
 #ifdef CLOCK_MONOTONIC
 #define GF_CLOCK_MONOTONIC CLOCK_MONOTONIC
 #else
-#define GF_CLOCK_REALTIME GF_CLOCK_REALTIME
+#define GF_CLOCK_MONOTONIC GF_CLOCK_REALTIME
 #endif

 /* Arguments:
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 169449)
+++ ChangeLog   (working copy)
@@ -1,5 +1,9 @@
 2011-01-31  Janne Blomqvist  <jb@gcc.gnu.org>

+       * intrinsics/time_1.h: Fix definition of GF_CLOCK_MONOTONIC macro.
+
+2011-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
+
        * configure.ac: Check for clock_gettime().
        * configure: Regenerated.
        * config.h.in: Regenerated.

Committed r169450 as obvious.


-- 
Janne Blomqvist


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]