In the era of multicore processors, one may ask himself “how do I make use of all this processing power on my hands?”. I won’t be writing any in-depth material here, but rather spreading out some interesting pointers.
If you are coding in C/C++, you can give OpenMP a try. I haven’t tried it yet, but I surely want to, as it seems extremely easy: you just add a couple
#pragma instructions in your code and it automagically parallelizes it for you! Really, check our their tutorials!
For those that are more Python-oriented, like me, you can try Parallel Python. Not only it can explore the available cores in your computer, but it may also use cores in other computers connected in your local network! I did some testing of this and it worked remarkably well. I plan on doing something fun with this someday.
Last, but not least, if you just have to run the same application several times and would like to use your several cores instead of queueing it all on a single one, then you might want to learn something about
xargs… It can do the job for you!
Detailed explanation of the use of
xargs is out of the scope of this blog post, so I’ll just point you to the
-P switch: it controls how many simultaneous processes it should run at a time. As soon as one terminates, it spawns another one. Great, isn’t it? Credit goes to this blog.
What about you? Any tips for exploring the processing powers of multicore CPUs? Share in the comments!