C++11 Thread safety of Random number generators

The C++11 standard library is broadly thread safe. The thread safety guarantees on PRNG objects are the same as on containers. More specifically, since the PRNG classes are all pseudo-random, i.e. they generate a deterministic sequence based on a definite current state, there is really no room to be peeking or poking at anything outside … Read more

OpenMP Dynamic vs Guided Scheduling

What affects the runtime of guided scheduling? There are three effects to consider: 1. Load balance The whole point of dynamic/guided scheduling is to improve the distribution of work in the case where not each loop iteration contains the same amount of work. Fundamentally: schedule(dynamic, 1) provides optimal load balancing dynamic, k will always have … Read more

Does multithreading emphasize memory fragmentation?

Ok, picked up the bait. This is on a system with Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz 4×5666.59 bogomips Linux meerkat 2.6.35-28-generic-pae #50-Ubuntu SMP Fri Mar 18 20:43:15 UTC 2011 i686 GNU/Linux gcc version 4.4.5 total used free shared buffers cached Mem: 8127172 4220560 3906612 0 374328 2748796 -/+ buffers/cache: 1097436 7029736 Swap: 0 … Read more

Understanding the collapse clause in openmp

The problem with your code is that the iterations of the inner loop depend on the outer loop. According to the OpenMP specification under the description of the section on binding and the collapse clause: If execution of any associated loop changes any of the values used to compute any of the iteration counts, then … Read more

Can I safely use OpenMP with C++11?

Walter, I believe I not only told you the current state of things in that other discussion, but also provided you with information directly from the source (i.e. from my colleague who is part of the OpenMP language committee). OpenMP was designed as a lightweight data-parallel addition to FORTRAN and C, later extended to C++ … Read more