Skip to main content

Posts

Showing posts with the label concurrency

A practical comparision of multitasking libraries

The following code-base attempts to compare multiple libraries on a simple experiment of Algebraic operations. The results are in favour of certain libraries because they are more natural in he application of Compute bound tasks, whereas the others are better at I/O bound tasks. Threading in Python is considered broken... I've also refrained from using the MPI library of C. I've made a driver.py program which create 5 sets of test-cases of increasing size to test the excution times of each version of each program. The comparison is across different libraries and languages, with the following programs: C : optimal serial code openMP directive based parallelism pthread library Python : optimal serial pyMP Python multiprocessing module Note that the gcc compiler automatically vectorizes the addition of arrays x and y using SIMD compliant hardware and appropriate data-types. I'll be adding the GPU comparison as soon as I can! Currently I don't h...

Hi there!

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: 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...