11.07.2015 Views

A Compiler for Parallel Exeuction of Numerical Python Programs on ...

A Compiler for Parallel Exeuction of Numerical Python Programs on ...

A Compiler for Parallel Exeuction of Numerical Python Programs on ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1Introducti<strong>on</strong>In recent years, processor designers have hit a wall in increasing the per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance <str<strong>on</strong>g>of</str<strong>on</strong>g> a singleprocessor core. Processors have adopted multicore designs fitting multiple cores <strong>on</strong> a singledie or a single package. Quad-core CPUs are already comm<strong>on</strong> <strong>on</strong> the desktop and hexa-coreprocessors are available <str<strong>on</strong>g>for</str<strong>on</strong>g> servers. Another new development in the hardware field has beenthe emergence <str<strong>on</strong>g>of</str<strong>on</strong>g> programmable graphics processing units (GPUs). GPUs have evolved froma fixed functi<strong>on</strong> pipeline to a highly programmable pipeline. Modern GPUs are a massivelyparallel architecture c<strong>on</strong>taining hundreds <str<strong>on</strong>g>of</str<strong>on</strong>g> programmable ALUs that can be utilized <str<strong>on</strong>g>for</str<strong>on</strong>g>tasks such as numerical computati<strong>on</strong>. A programmable GPU which can be utilized <str<strong>on</strong>g>for</str<strong>on</strong>g>n<strong>on</strong>-graphic related tasks is termed a general-purpose GPU (GPGPU). GPGPUs are lessflexible than CPUs but <str<strong>on</strong>g>of</str<strong>on</strong>g>fer much greater floating-point capability. GPGPUs <str<strong>on</strong>g>of</str<strong>on</strong>g>fering up toa teraflop <str<strong>on</strong>g>of</str<strong>on</strong>g> floating-point per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance are already available. This per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance is an order<str<strong>on</strong>g>of</str<strong>on</strong>g> magnitude better than current x86 processors.The per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance gains <str<strong>on</strong>g>of</str<strong>on</strong>g>fered by multicores and GPGPUs comes at the cost <str<strong>on</strong>g>of</str<strong>on</strong>g> increasedprogrammning ef<str<strong>on</strong>g>for</str<strong>on</strong>g>t. To utilize multicores, a programmer is required to write parallel code.Many abstracti<strong>on</strong>s, such as threads and parallel loops, are available <str<strong>on</strong>g>for</str<strong>on</strong>g> writing parallel programs.For numerical programs, expressing parallelism through parallel <str<strong>on</strong>g>for</str<strong>on</strong>g>-loops (availablein APIs such as OpenMP) is a comm<strong>on</strong> choice <str<strong>on</strong>g>for</str<strong>on</strong>g> multicores as well as <str<strong>on</strong>g>for</str<strong>on</strong>g> symmetric multiprocessorarchitectures. Programming <str<strong>on</strong>g>for</str<strong>on</strong>g> GPGPUs requires the programmer to rewritemuch <str<strong>on</strong>g>of</str<strong>on</strong>g> her code to utilize a GPU specific API. GPGPUs usually have a completely separateaddress space and there<str<strong>on</strong>g>for</str<strong>on</strong>g>e the programmer has to copy data from the system RAM to theGPGPU address space.On the s<str<strong>on</strong>g>of</str<strong>on</strong>g>tware side, languages such as Matlab and <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> are becoming more popular<str<strong>on</strong>g>for</str<strong>on</strong>g> scientific computing. <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> in particular is starting to attract a lot <str<strong>on</strong>g>of</str<strong>on</strong>g> attenti<strong>on</strong> in thenumerical-programming community. <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> is a general-purpose object-oriented languagewith very clean syntax. An extensi<strong>on</strong> library <str<strong>on</strong>g>for</str<strong>on</strong>g> <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>, called NumPy, <str<strong>on</strong>g>of</str<strong>on</strong>g>fers very flexiblemulti-dimensi<strong>on</strong>al array abstracti<strong>on</strong>s and is particularly useful <str<strong>on</strong>g>for</str<strong>on</strong>g> scientific programming.However, while <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>of</str<strong>on</strong>g>fers great flexibility to the programmer, per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance is usually1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!