A preface Some time ago I started tinkering with OpenMP and forming a rough idea of how it worked when I discovered something that caught my eye. Of course, I tweeted it in a thread without missing a beat. 🧵 (1/6) I just made an interesting discovery in #OpenMP that, if you think about it, it makes total sense. So, if you parallelize a loop, it's actually slower than making it sequential: pic.twitter.com/CJCu4c3Agb — Mr. RattleBrain (@Mr_RattleBrain) November 24, 2024 A quick discovery I made: using a directive (I'll explain this in time) called #pragma omp parallel for can sometimes be less efficient than running a loop sequentially. Instead, there’s another directive we should be using, #pragma omp for , which works as expected for parallelizing this particular case. Now, this isn’t some obscure revelation I stumbled upon at 3 a.m. while sipping cold coffee. It’s ( should be ) actually pretty common knowledge for anyone who works with OpenMP regularly—or e...