{"id":756,"date":"2010-10-04T16:55:45","date_gmt":"2010-10-04T20:55:45","guid":{"rendered":"https:\/\/www.bu.edu\/pasi\/?page_id=756"},"modified":"2019-07-05T12:25:53","modified_gmt":"2019-07-05T16:25:53","slug":"python-for-parallel-scientific-computing","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/pasi\/courses\/python-for-parallel-scientific-computing\/","title":{"rendered":"Python for parallel scientific computing"},"content":{"rendered":"<h3>by Dr Lisandro Dalc\u00edn<\/h3>\n<p><strong>Centro Internacional de M\u00e9todos Computacionales en Ingenier\u00eda<\/strong><\/p>\n<h3><a href=\"\/pasi\/files\/2010\/10\/python-logo-master_sm.png\"><img loading=\"lazy\" class=\"size-full wp-image-762 alignright\" title=\"python-logo-master_sm\" src=\"\/pasi\/files\/2010\/10\/python-logo-master_sm.png\" alt=\"python-logo-master_sm\" width=\"250\" height=\"81\" \/><\/a><\/h3>\n<p>The <a href=\"http:\/\/www.python.org\/\" target=\"_blank\">Python<\/a> programming language has attracted the attention of many end-users and developers in the scientific community. \u00a0Python is a very powerful language, offers a clean and simple syntax, and has efficient high-level data structures.<\/p>\n<p>Sophisticated but easy to use and well integrated packages are available for interactive command-line work (<a href=\"http:\/\/ipython.scipy.org\" target=\"_blank\">IPython<\/a>), efficient multi-dimensional array processing (<a href=\"http:\/\/numpy.scipy.org\/\" target=\"_blank\">NumPy<\/a>), symbolic computing (<a href=\"http:\/\/code.google.com\/p\/sympy\/\" target=\"_blank\">SymPy<\/a>), and\u00a02D and 3D visualization (<a href=\"http:\/\/matplotlib.sourceforge.net\/\" target=\"_blank\">matplotlib<\/a> and <a href=\"http:\/\/code.enthought.com\/projects\/mayavi\/\" target=\"_blank\">Mayavi<\/a>).<\/p>\n<p>Python allows skilled users to build their own computing environment, tailored to their specific needs and based on their favorite high-performance Fortran, C or C++ codes. \u00a0These tasks are facilitated by tools like <a href=\"http:\/\/www.cython.org\/\" target=\"_blank\">Cython<\/a>, <a href=\"http:\/\/www.swig.org\/\" target=\"_blank\">SWIG<\/a>, <a href=\"http:\/\/www.scipy.org\/F2py\" target=\"_blank\">F2PY<\/a> and <a href=\"http:\/\/github.com\/kwmsmith\/fwrap\" target=\"_blank\">fwrap<\/a>.<\/p>\n<p>This course will cover concepts of parallel computing on distributed memory architectures using MPI and PETSc within a Python programming environment. \u00a0In particular, we will discuss two open-source tools providing Python access to MPI and PETSc functionalities. \u00a0We will cover the following topics:<\/p>\n<ul>\n<li>MPI for Python (<a href=\"http:\/\/code.google.com\/p\/mpi4py\/\" target=\"_blank\">mpi4py<\/a>)\n<ul>\n<li>high-level but slow communication of general Python objects<\/li>\n<li>low-level but fast communication of NumPy array data<\/li>\n<li>point to point and collective communications<\/li>\n<li>dynamic process management<\/li>\n<li>parallel input\/output<\/li>\n<\/ul>\n<\/li>\n<li>PETSc for Python (<a href=\"http:\/\/code.google.com\/p\/mpi4py\/\" target=\"_blank\">petsc4py<\/a>)\n<ul>\n<li>assemble distributed vector and matrices in parallel<\/li>\n<li>solve linear and nonlinear systems (including matrix-free methods)<\/li>\n<li>profiling and logging<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>We will produce quick Python scripts exercising these functionalities\u00a0on extensive laboratory sessions. These simple codes will serve as\u00a0building blocks to be reused for larger simulations. By incorporating\u00a0C\/C++ and Fortran codes to the game for selected,\u00a0performance-sensitive parts, we will show that Python codes can\u00a0achieve high performance while retaining high-level and flexibility.<\/p>\n<h2>Supplementary Material<\/h2>\n<ul>\n<li><a href=\"http:\/\/infohost.nmt.edu\/tcc\/help\/pubs\/lang\/pytut\/pytut.pdf\" target=\"_blank\">A Python Programming Tutorial<\/a>, by John W. Shipman (also <a href=\"http:\/\/infohost.nmt.edu\/tcc\/help\/pubs\/lang\/pytut\/\" target=\"_blank\">on html<\/a>)<\/li>\n<li><a href=\"http:\/\/www.scipy.org\/\" target=\"_blank\">Scientific Tools for Python<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>by Dr Lisandro Dalc\u00edn Centro Internacional de M\u00e9todos Computacionales en Ingenier\u00eda The Python programming language has attracted the attention of many end-users and developers in the scientific community. \u00a0Python is a very powerful language, offers a clean and simple syntax, and has efficient high-level data structures. Sophisticated but easy to use and well integrated packages [&hellip;]<\/p>\n","protected":false},"author":3344,"featured_media":0,"parent":321,"menu_order":4,"comment_status":"closed","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/pasi\/wp-json\/wp\/v2\/pages\/756"}],"collection":[{"href":"https:\/\/www.bu.edu\/pasi\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/pasi\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/pasi\/wp-json\/wp\/v2\/users\/3344"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/pasi\/wp-json\/wp\/v2\/comments?post=756"}],"version-history":[{"count":18,"href":"https:\/\/www.bu.edu\/pasi\/wp-json\/wp\/v2\/pages\/756\/revisions"}],"predecessor-version":[{"id":1648,"href":"https:\/\/www.bu.edu\/pasi\/wp-json\/wp\/v2\/pages\/756\/revisions\/1648"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/pasi\/wp-json\/wp\/v2\/pages\/321"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/pasi\/wp-json\/wp\/v2\/media?parent=756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}