Commit f4568263 by Francois Gygi

print seed value. Broadcast unique value

git-svn-id: http://qboxcode.org/svn/qb/trunk@1258 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 4c66a9ba
......@@ -49,10 +49,22 @@ class RseedCmd : public Cmd
int action(int argc, char **argv)
{
long int seed = (long int) time(0);
int seed = (int) time(0);
if ( argc == 2 )
seed = atol(argv[1]);
srand48(seed);
seed = atoi(argv[1]);
else
{
if ( ui->onpe0() )
{
s->ctxt_.ibcast_send(1,1,&seed,1);
cout << "<seed> " << seed << " </seed>" << endl;
}
else
{
s->ctxt_.ibcast_recv(1,1,&seed,1,0,0);
}
}
srand48((long int)seed);
return 0;
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment