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: Random seed initialization


Il 23/04/2013 11.43, Janne Blomqvist ha scritto:
On Sat, Apr 6, 2013 at 6:53 PM, Janus Weil <janus@gcc.gnu.org> wrote:
Could you please post the output of:


PROGRAM test_system_clock
   INTEGER(4) :: count4, rate4, max4
   INTEGER(8) :: count8, rate8, max8

   CALL SYSTEM_CLOCK(count4, rate4, max4)
   WRITE(*,*) count4, rate4, max4

   CALL SYSTEM_CLOCK(count8, rate8, max8)
   WRITE(*,*) count8, rate8, max8
END PROGRAM

Hello Angelo,

now that you apparently have managed to build current trunk on cygwin,
can you post the output of the above test program again? I'd like to
confirm that my patch to improve system_clock on mingw and cygwin
(http://gcc.gnu.org/ml/fortran/2013-04/msg00147.html ) actually works.
GetTickCount and AFAIU QueryPerformanceCounter as well should return a
count of zero at boot time, so if you could also verify that the
counts are consistent with the uptime of your computer that would give
a bit of extra confidence that it works as expected.

Oh yes... :)

Now, on Cygwin with

$ gfortran-4.9 -v
Using built-in specs.
COLLECT_GCC=gfortran-4.9
COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/i686-pc-cygwin/4.9.0/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /work/gcc-4.9-20130421/configure --prefix=/usr/local/gfortran --program-suffix=-4.9 --enable-languages=c,c++,fortran --enable-checking=release --enable-threads=posix --enable-libgomp --with-arch=native --with-tune=native --with-fpmath=sse --disable-bootstrap --disable-libmudflap --disable-shared
Thread model: posix
gcc version 4.9.0 20130421 (experimental) (GCC)

the result is:

$ gfortran-4.9 test_system_clock.f90

$ ./a.exe
     8011015        1000  2147483647
          28675453725              3579545  9223372036854775807

$ ./a.exe
     8016000        1000  2147483647
          28693299811              3579545  9223372036854775807

$ ./a.exe
     8017562        1000  2147483647
          28698882653              3579545  9223372036854775807

[...]

which looks good to me... :-)


Ciao,
 Angelo.


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