The magical world of parallel computing awaits you!
We all know Serial computing using our favourite mainstream programming language( C, C++, Java, Python ) on a single faithful CPU with a module of RAM of a standard PC, one machine instruction after another. (Don't fret even if you don't! We'll discuss concepts gradually transitioning from serial processing to concurrency to parallelism and beyond!)
Now, suppose we have a 2.0 GHz single core CPU, so it is capable of about 2 billion instructions per second.
Compare that to Human calculation time, about 2 seconds per instruction!!! (assume simple addition or relocation instruction)
What if we want more than that? Just visit the closest computer hardware store and buy another PC with:
(Wauw, that is possibly going to hit your bank account...)
Now we're ready to go! We've got all necessary hardware for improving performance of our code! Right?
NOPE.
Parallelization being the next step of serial computing is a misconception. There are many optimizations and critical algorithm changes which can lead to amazing performance gains without even entering parallelism. So, remember that parallelization is not the only solution for multitasking.
Once the program is most logical and optimal, we can dive into parallelizing/multitasking. I'll describe many common techniques in future posts, so let's save that for later.
In this blog, I'm going to help you understand the principles behind parallelization and improving computation performance.
There is a lot to convey in this vast subject, so there's something new to learn everyday, so I'll keep the blog updated with latest bits of general advice and code snippets! (in mainstream programming languages)
Here's my (rather silly) animation of serial and parallel computing!
Static Image Source: Lemon shooter by Balderek
We all know Serial computing using our favourite mainstream programming language( C, C++, Java, Python ) on a single faithful CPU with a module of RAM of a standard PC, one machine instruction after another. (Don't fret even if you don't! We'll discuss concepts gradually transitioning from serial processing to concurrency to parallelism and beyond!)
Now, suppose we have a 2.0 GHz single core CPU, so it is capable of about 2 billion instructions per second.
Compare that to Human calculation time, about 2 seconds per instruction!!! (assume simple addition or relocation instruction)
What if we want more than that? Just visit the closest computer hardware store and buy another PC with:
- n processors with m cores, x.yz GHz
- Superscalar architecture, Hyper threading, etc
- r GB GDDR5 RAM and s GB SSD
- Integrated Graphics and Discrete Graphics card with abcd GPGPU cores
(Wauw, that is possibly going to hit your bank account...)
Now we're ready to go! We've got all necessary hardware for improving performance of our code! Right?
NOPE.
Parallelization being the next step of serial computing is a misconception. There are many optimizations and critical algorithm changes which can lead to amazing performance gains without even entering parallelism. So, remember that parallelization is not the only solution for multitasking.
Once the program is most logical and optimal, we can dive into parallelizing/multitasking. I'll describe many common techniques in future posts, so let's save that for later.
In this blog, I'm going to help you understand the principles behind parallelization and improving computation performance.
There is a lot to convey in this vast subject, so there's something new to learn everyday, so I'll keep the blog updated with latest bits of general advice and code snippets! (in mainstream programming languages)
Here's my (rather silly) animation of serial and parallel computing!
Static Image Source: Lemon shooter by Balderek
Comments
Post a Comment