arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1002.0705cs.DCcs.PL
收藏

在Python中通过函数中心方法简化科学代码的并行化

Simplifying Parallelization of Scientific Codes by a Function-Centric Approach in Python

Jon K. Nilsen, Xing Cai, Bjorn Hoyland, Hans Petter Langtangen

摘要:

本文的目的是展示如何使用一个单独的Python代码薄层来并行化现有的科学软件,其中所有的并行通信都是实现的。我们提供了具体的例子,这些层的代码,这些例子可以作为模板并行化一系列广泛的串行科学代码。使用Python进行并行化的动机是,该语言非常适合重用用其他语言编程的现有串行代码。Python在处理函数方面的极大灵活性使得将串行科学应用程序的分解计算任务包装为Python函数非常容易。许多特定于并行化的组件可以实现为通用Python函数,这些函数可以将执行具体计算任务的函数作为输入。这种并行化方法所需的总体编程工作量相当有限,并且产生的并行Python脚本具有紧凑和干净的结构。并行化方法的有用性体现在自然科学和社会科学中的三个不同类别的应用程序。

英文摘要:

The purpose of this paper is to show how existing scientific software can be parallelized using a separate thin layer of Python code where all parallel communication is implemented. We provide specific examples on such layers of code, and these examples may act as templates for parallelizing a wide set of serial scientific codes. The use of Python for parallelization is motivated by the fact that the language is well suited for reusing existing serial codes programmed in other languages. The extreme flexibility of Python with regard to handling functions makes it very easy to wrap up decomposed computational tasks of a serial scientific application as Python functions. Many parallelization-specific components can be implemented as generic Python functions, which may take as input those functions that perform concrete computational tasks. The overall programming effort needed by this parallelization approach is rather limited, and the resulting parallel Python scripts have a compact and clean structure. The usefulness of the parallelization approach is exemplified by three different classes of applications in natural and social sciences.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑