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 3<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> and the proposedprogramming modelThe objective <str<strong>on</strong>g>of</str<strong>on</strong>g> this thesis is to provide a high-productivity programming model to thescientific programmer which is portable to both GPUs and multi-core CPUs. Increasingly,scientific programmers are choosing high-level programming languages such as Matlab and<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> over languages such as C and Fortran. For parallel programming, shared-memoryparadigms, such as OpenMP, are popular with C/C++ programmers.This thesis provides the programmer with a programming model based <strong>on</strong> a combinati<strong>on</strong><str<strong>on</strong>g>of</str<strong>on</strong>g> <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> and the c<strong>on</strong>cept <str<strong>on</strong>g>of</str<strong>on</strong>g> parallel loops inspired by OpenMP parallel loops. The choice<str<strong>on</strong>g>of</str<strong>on</strong>g> <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> was based <strong>on</strong> multiple reas<strong>on</strong>s.1. Unlike special-purpose languages such as Matlab, <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> is a fully featured generalpurposeprogramming language well known <str<strong>on</strong>g>for</str<strong>on</strong>g> its simplicity and productivity. NumPyis a multi-dimensi<strong>on</strong>al array 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> providing a very flexible array abstracti<strong>on</strong>with c<strong>on</strong>cise notati<strong>on</strong>s <str<strong>on</strong>g>for</str<strong>on</strong>g> operati<strong>on</strong>s such as slicing. <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> in combinati<strong>on</strong> withNumPy is well suited <str<strong>on</strong>g>for</str<strong>on</strong>g> rapidly developing full applicati<strong>on</strong>s in a wide variety <str<strong>on</strong>g>of</str<strong>on</strong>g>domains.2. <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> and NumPy are both open source and there<str<strong>on</strong>g>for</str<strong>on</strong>g>e it was much easier to understandthe inner workings <str<strong>on</strong>g>of</str<strong>on</strong>g> <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> and NumPy.3. <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>, in combinati<strong>on</strong> with NumPy, is becoming popular in the scientific and numericcomputati<strong>on</strong> community because <str<strong>on</strong>g>of</str<strong>on</strong>g> simplicity and productivity. A library collecti<strong>on</strong>aimed at scientific computati<strong>on</strong> <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 SciPy, and built up<strong>on</strong> NumPy isalso available. SciPy includes libraries <str<strong>on</strong>g>for</str<strong>on</strong>g> tasks such as functi<strong>on</strong> optimizati<strong>on</strong>. Anactive community is <str<strong>on</strong>g>for</str<strong>on</strong>g>ming around NumPy and SciPy. Various mailing lists, wikisand project listings can be found at the scipy.org website.This chapter introduces the relevant features <str<strong>on</strong>g>of</str<strong>on</strong>g> <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> and NumPy followed by theproposed extensi<strong>on</strong>s to <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> and NumPy.18

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

Saved successfully!

Ooh no, something went wrong!