
Hi Botond, Ah yes, our friend "rand()" is a problem in multi threaded code. You might want to look at some of the C++ random number generators in <random>. What I meant by prime the pump, is that when doing OpenMP benchmarks, the first time an OpenMP loop is encountered, the runtime creates the threads. This can really bias benchmarks. So to 'prime the pump' you should have a simple OpenMP loop before the one you want to time so that all the OpenMP threads are up before you start the benchmark.. Andrew On Mon, Dec 21, 2020 at 1:12 PM <btyukodi@brandeis.edu> wrote:
Hi Andrew,
Thank you for your answer. Indeed, there are many points where this could go wrong. For instance, I just noticed that using the rand() function on separate threads (which I do) may cause locks.
I guess my question is then rather whether OpenMesh itself uses any variables/algorithms that would cause locks when operating on different mesh objects or I can be almost sure that it's my poor algorithm that causes this? I will certainly look into thread profiling tools, sounds like it's tremendously useful and yes, scaling is the way to be precise about this. I'm not sure though what you mean by "priming the OpenMP pump"...
Thanks again, Botond _______________________________________________ OpenMesh mailing list -- openmesh@lists.rwth-aachen.de To unsubscribe send an email to openmesh-leave@lists.rwth-aachen.de https://lists.rwth-aachen.de/postorius/lists/openmesh.lists.rwth-aachen.de