Closed Era-Dorta closed 8 years ago
it should be fixed now (at least it works on OS X), please have a go to it
Unfortunately it's still giving inconsistent results with the fix. However applying the same procedure in the point sampler random does work on my linux machine. Would it make sense to have the seed set to zero there as well? For the record, a there are more occurrences of rand() which might affect other filters.
Ah gosh, thanks for pointing this out. I will handle this "rand" issue from tomorrow, because I am travelling at the moment!
To your knowledge, is std::time thread safe? It could be a good alternative.
I'm sorry but I don't really know about thread safety for std::time. In the documentation for std::chrono::system_clock::now, which I've seen used as seed there are no warnings about thread safety. While for std::rand() it is specified clearly. However my use case is to get exactly the same image, I need reproducibility for the experiments. Maybe adding a macro to switch between a fixed seed and std::time could be a good solution.
I made some extra changes. Please have a look at them, and let me know what you think about those.
Works like a charm, thanks so much
cool, I am happy about that!
Results are not reproducible when using openMP.
Random number seeding is done with the rand() function for the samplers, like in the bilateral filter. When compiling with openMP, the function is called concurrently in each thread, but rand() is not thread safe.