Hi, I need for initialisation the random values on a cluster (64 cores on 8 machines) different seeds. I would like to use the time and thread id: I can't use only the time, because I will get the same random numbers on every core, so I would like to use thread id and time together. I dont' work with boost threads, so I try to read the thread id with boost::thread::get_id(). Compiling works, but on linking I get the error "that boost threads can't linking", but I don't have any library like "boost thread" ? Should I compile the library like the iostream lib? Is this the right way to read the thread id? I need only a value which I can use for the random seed of all cores and the value must be different on every core. Thanks for help Phil
I dont' work with boost threads, so I try to read the thread id with boost::thread::get_id().
Look at thread::native_handle() member function.
Compiling works, but on linking I get the error "that boost threads can't linking", but I don't have any library like "boost thread" ? Should I compile the library like the iostream lib?
Yes, you have to build Boost.Thread library.
On 7 July 2010 07:47, Kraus Philipp
I need only a value which I can use for the random seed of all cores and the value must be different on every core.
How about just getting a value from the OS via boost::random_device? http://www.boost.org/doc/html/boost/random_device.html
Am 07.07.2010 um 17:38 schrieb Scott McMurray:
On 7 July 2010 07:47, Kraus Philipp
wrote: I need only a value which I can use for the random seed of all cores and the value must be different on every core.
How about just getting a value from the OS via boost::random_device?
Is this like /dev/random, because that's can be a better solution lilke my "thread id" Thanks a lot Phil
participants (3)
-
Igor R
-
Kraus Philipp
-
Scott McMurray