public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, fortran] PR 42434 Update documentation for SYSTEM_CLOCK
@ 2011-02-05 20:04 Janne Blomqvist
  2011-02-05 20:13 ` Steve Kargl
  0 siblings, 1 reply; 3+ messages in thread
From: Janne Blomqvist @ 2011-02-05 20:04 UTC (permalink / raw)
  To: GCC Patches, Fortran List

[-- Attachment #1: Type: text/plain, Size: 362 bytes --]

Hi,

the attached patch updates the documentation to match the
implementation of SYSTEM_CLOCK, where we now provide access to a
high-resolution monotonic clock via clock_gettime().

Tested with make pdf, Ok for trunk?

2011-02-05  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/42434
	* intrinsic.texi (SYSTEM_CLOCK): Update documentation.


-- 
Janne Blomqvist

[-- Attachment #2: sclockdoc.diff --]
[-- Type: text/x-patch, Size: 2626 bytes --]

diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index d8a97c5..f0287f6 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -11812,14 +11812,29 @@ and should considered in new code for future portability.
 
 @table @asis
 @item @emph{Description}:
-Determines the @var{COUNT} of milliseconds of wall clock time since 
-the Epoch (00:00:00 UTC, January 1, 1970) modulo @var{COUNT_MAX}, 
-@var{COUNT_RATE} determines the number of clock ticks per second.
-@var{COUNT_RATE} and @var{COUNT_MAX} are constant and specific to 
-@command{gfortran}.
+Determines the @var{COUNT} of a processor clock since an unspecified
+time in the past modulo @var{COUNT_MAX}, @var{COUNT_RATE} determines
+the number of clock ticks per second.  If the platform supports a high
+resolution monotonic clock, that clock is used and can provide up to
+nanosecond resolution.  If a high resolution monotonic clock is not
+available, the implementation falls back to a potentially lower
+resolution realtime clock.
+
+@var{COUNT_RATE} and @var{COUNT_MAX} vary depending on the kind of the
+arguments.  For @var{kind=8} arguments, @var{COUNT} represents
+nanoseconds, and for @var{kind=4} arguments, @var{COUNT} represents
+milliseconds. Other than the kind dependency, @var{COUNT_RATE} and
+@var{COUNT_MAX} are constant, however the particular values are
+specific to @command{gfortran}.
 
 If there is no clock, @var{COUNT} is set to @code{-HUGE(COUNT)}, and
-@var{COUNT_RATE} and @var{COUNT_MAX} are set to zero 
+@var{COUNT_RATE} and @var{COUNT_MAX} are set to zero.
+
+When running on a platform using the GNU C library (glibc), or a
+derivative thereof, the high resolution monotonic clock is available
+only when linking with the @var{rt} library.  This can be done
+explicitly by adding the @code{-lrt} flag when linking the
+application, but is also done implicitly when using OpenMP.
 
 @item @emph{Standard}:
 Fortran 95 and later
@@ -11832,11 +11847,11 @@ Subroutine
 
 @item @emph{Arguments}:
 @multitable @columnfractions .15 .70
-@item @var{COUNT}      @tab (Optional) shall be a scalar of type default 
+@item @var{COUNT}      @tab (Optional) shall be a scalar of type 
 @code{INTEGER} with @code{INTENT(OUT)}.
-@item @var{COUNT_RATE} @tab (Optional) shall be a scalar of type default 
+@item @var{COUNT_RATE} @tab (Optional) shall be a scalar of type 
 @code{INTEGER} with @code{INTENT(OUT)}.
-@item @var{COUNT_MAX}  @tab (Optional) shall be a scalar of type default 
+@item @var{COUNT_MAX}  @tab (Optional) shall be a scalar of type 
 @code{INTEGER} with @code{INTENT(OUT)}.
 @end multitable
 

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

* Re: [Patch, fortran] PR 42434 Update documentation for SYSTEM_CLOCK
  2011-02-05 20:04 [Patch, fortran] PR 42434 Update documentation for SYSTEM_CLOCK Janne Blomqvist
@ 2011-02-05 20:13 ` Steve Kargl
  2011-02-05 20:21   ` Janne Blomqvist
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Kargl @ 2011-02-05 20:13 UTC (permalink / raw)
  To: Janne Blomqvist; +Cc: GCC Patches, Fortran List

On Sat, Feb 05, 2011 at 10:03:50PM +0200, Janne Blomqvist wrote:
> Hi,
> 
> the attached patch updates the documentation to match the
> implementation of SYSTEM_CLOCK, where we now provide access to a
> high-resolution monotonic clock via clock_gettime().
> 
> Tested with make pdf, Ok for trunk?
> 
> 2011-02-05  Janne Blomqvist  <jb@gcc.gnu.org>
> 
> 	PR fortran/42434
> 	* intrinsic.texi (SYSTEM_CLOCK): Update documentation.
> 

OK.

-- 
Steve

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

* Re: [Patch, fortran] PR 42434 Update documentation for SYSTEM_CLOCK
  2011-02-05 20:13 ` Steve Kargl
@ 2011-02-05 20:21   ` Janne Blomqvist
  0 siblings, 0 replies; 3+ messages in thread
From: Janne Blomqvist @ 2011-02-05 20:21 UTC (permalink / raw)
  To: Steve Kargl; +Cc: GCC Patches, Fortran List

On Sat, Feb 5, 2011 at 22:13, Steve Kargl
<sgk@troutmask.apl.washington.edu> wrote:
> On Sat, Feb 05, 2011 at 10:03:50PM +0200, Janne Blomqvist wrote:
>> Hi,
>>
>> the attached patch updates the documentation to match the
>> implementation of SYSTEM_CLOCK, where we now provide access to a
>> high-resolution monotonic clock via clock_gettime().
>>
>> Tested with make pdf, Ok for trunk?
>>
>> 2011-02-05  Janne Blomqvist  <jb@gcc.gnu.org>
>>
>>       PR fortran/42434
>>       * intrinsic.texi (SYSTEM_CLOCK): Update documentation.
>>
>
> OK.
>
> --
> Steve
>

Thanks for the quick review,

Sending        fortran/ChangeLog
Sending        fortran/intrinsic.texi
Transmitting file data ..
Committed revision 169854.

-- 
Janne Blomqvist

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

end of thread, other threads:[~2011-02-05 20:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-05 20:04 [Patch, fortran] PR 42434 Update documentation for SYSTEM_CLOCK Janne Blomqvist
2011-02-05 20:13 ` Steve Kargl
2011-02-05 20:21   ` Janne Blomqvist

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).