I want to write a function which will be repeatedly called by other functions many times. Inside this function it is supposed to generate a lot of random numbers and this part will be treated in parallel. If only for one run, the seed can be chosen differently for each thread, so that the random numbers will be uncorrelated. However, if this function will be called the 2nd time, it seems that the random numbers will repeat unless the seed will be again changed during the later calls.
So my question is, is there a good way to generate the random numbers or reset the seed so that the random numbers generated by repeated calls to this function and also by different threads are really random?
I need to do this in openMP. Is it possible to store the state of the generator for each thread separately after each call of the function, so that when the next time the function is called, the random number generator start from the last state and continue to generate uncorrelated numbers?
Thank you.