help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] random number sequence


From: Sergey Mkrtchyan
Subject: Re: [Help-gsl] random number sequence
Date: Mon, 19 May 2008 19:23:46 -0400

Steven, Frank huge thanks!

I did as Steven suggested and it worked smoothly, indeed I use script
to submit jobs to cluster and it was just a second to add the loop
parameter as an input for seed. I also played a bit with microseconds
which sounds like a good idea too :-)

I also tried not to use parameter given from the loop, but instead use
seed(rand()) function (anyways in 1000 runs, rand() won't show it's
badness I guess) but it didn't work. Now trying somehow to figure how
can I get random number in shell script to pass it to the program
argument instead of just parameter of the loop.

Thanks you very very much again!

Sergey

On Mon, May 19, 2008 at 5:52 PM, Steven Vancoillie
<address@hidden> wrote:
> Hi Sergey
>
> i suggest you use some input argument to your program, which is different
> for your jobs (e.g. you can assign this in a shell script that you use for
> submitting jobs)
>
> #!bin/bash
>
> ......
>
> for n in 1 2 3 4 5
> do
>  export n
>  submit_job my_program $n
> done
>
> -> with your my_program being:
>
> int main(int argc, char* argv[])
> {
>
> int change_seed = atoi(argv[1]);
>
> ....
>
> srand(change_seed); // or srand(time()*change_seed) for more divergence
>
> ....
>
> }
>
> grtz
> Steven




reply via email to

[Prev in Thread] Current Thread [Next in Thread]