From 2e386c299748632e6d8cfc9da61f0148b58ae917 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 17 Feb 2014 00:15:25 +0100 Subject: [PATCH] Using microseconds for random seed. --- u1casc-ordinary/sim.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/u1casc-ordinary/sim.hpp b/u1casc-ordinary/sim.hpp index af989c9..f88e650 100644 --- a/u1casc-ordinary/sim.hpp +++ b/u1casc-ordinary/sim.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "latlib/neigh.h" @@ -32,6 +33,8 @@ sim::sim(o815 *_O815) : o815::sim( _O815, sizeof(complex)* _O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[1]*(2+4) ) { + struct timeval tv; + lsize4 = _O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[1]; nb = new neigh(4, _O815->comargs.lsize[0], _O815->comargs.lsize[0], _O815->comargs.lsize[0], _O815->comargs.lsize[1]); @@ -39,8 +42,9 @@ sim::sim(o815 *_O815) : o815::sim( _O815, phi = (complex*)confMem; U = (complex*)(confMem + sizeof(complex)*lsize4*2); + gettimeofday(&tv, NULL); rangsl = gsl_rng_alloc(gsl_rng_ranlxs0); - gsl_rng_set(rangsl, time(NULL)); + gsl_rng_set(rangsl, 1000000 * tv.tv_sec + tv.tv_usec); } void sim::_makeSweep() { -- 2.39.5