Данный пост будет первым из, надеюсь, серии небольших очерков о применении различных библиотек распараллеливания вычислений. В качестве прикладной задачи выбрано графическое построение всем хорошо знакомого множества Мандельброта. В качестве библиотеки реализации вычислений в этот раз возьму OpenMP, а для унификации работы с разными оконными подсистемами - GLUT/OpenGL.
Note. PVS-Studio is an add-in module for Visual Studio 2005/2008 (and 2010 soon) that allows you to detect a lot of various errors in 64-bit and parallel OpenMP applications. PVS-Studio is a contemporary interactive static C/C++ code analyzer. By 'interactive', for instance, we mean the capability of warning filtration and suppression without relaunching the analysis.
Particle systems are an ideal candidate for multi-threading in games. Most games have particle systems and their general nature of independent entities lends well to parallelism. However, a naïve approach won’t load balance well on modern architectures. There are two complementary approaches, task-based threading and SSE, which are ideally suited for particle systems and will obtain maximum performance from multi-core processors.
Though I wrote my previous TBB task scheduler blog just a few days after TBB 3.0 Update 4 had been released, I ignored that remarkable event, and instead delved into more than two year old past. So today I’m going to redeem that slight, and talk about a couple of small but quite useful improvements in the TBB scheduler behavior made in the aforementioned update.
Though Intel® Threading Building Blocks 3.0 Update 4 that introduces a concept of Community Preview feature has just been released, my today's blog will be about something that happened quite long time ago. One of the recent posts on the TBB forum attracted my attention to the issue of information rapidly becoming obsolete.
My plan to go parallel this time was thwarted by concerns that I may still have left some serial performance on the table. So I’ll take one more look (OK, well, no more than three). Leading the contenders was Jim Dempsey’s suggestion that accumulating forces instead of accelerations would save some divides. His numbers did not show a dramatic difference but did suggest summing forces to be ever so slightly faster than accumulating accelerations.