arrow
Return

Parallel distributed computing using Python

delete2011-09-01
delete407
delete
OA
AI
L
Lisandro Dalcín *
R
Rodrigo R. Paz
P
Pablo A. Kler
A
Alejandro Cósimo
DOI:10.1016/j.advwatres.2011.04.013delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
This work presents two software components aimed to relieve the costs of accessing high-performance parallel computing resources within a Python programming environment: MPI for Python and PETSc for Python. MPI for Python is a general-purpose Python package that provides bindings for the Message Passing Interface (MPI) standard using any back-end MPI implementation. Its facilities allow parallel Python programs to easily exploit multiple processors using the message passing paradigm. PETSc for Python provides access to the Portable, Extensible Toolkit for Scientific Computation (PETSc) libraries. Its facilities allow sequential and parallel Python applications to exploit state of the art algorithms and data structures readily available in PETSc for the solution of large-scale problems in science and engineering. MPI for Python and PETSc for Python are fully integrated to PETSc-FEM, an MPI and PETSc based parallel, multiphysics, finite elements code developed at CIMEC laboratory. This software infrastructure supports research activities related to simulation of fluid flows with applications ranging from the design of microfluidic devices for biochemical analysis to modeling of large-scale stream/aquifer interactions. (C) 2011 Elsevier Ltd. All rights reserved.
Keywords:
Python
MPI
PETSc

AI Summary

Brief Overview

In September 2011, Dalcin, Lisandro D.; Paz, Rodrigo R.; Kler, Pablo A.; Cosimo, Alejandro published the paper "Parallel distributed computing using Python" online in ADVANCES IN WATER RESOURCES. This research developed two open-source tools (mpi4py and petsc4py), addressing the challenge for researchers of accessing supercomputers conveniently for large-scale scientific computing. By adding high-performance parallel computing interfaces to the Python language, it enabled the invocation of underlying complex parallel algorithms with concise and readable code, significantly lowering the programming barrier in engineering simulation fields such as fluid mechanics and groundwater simulation, and providing a scalable software foundation for the integration of engineering simulation and artificial intelligence.

Research Abstract

As the scale of tasks in fluid simulation and environmental modeling continues to grow, scientists urgently need to orchestrate hundreds to thousands of processors for collaborative computation. However, traditional parallel programming languages (such as C/Fortran) have high learning costs and difficult debugging. Existing commercial tools (such as the MATLAB Parallel Toolbox) have limited functionality and high prices, while open-source solutions often require manual management of memory and communication details, making them error-prone. This study seamlessly integrates mainstream international parallel computing standards (the Message Passing Interface MPI and the scientific computing toolkit PETSc) into Python, enabling researchers to write parallel programs in a natural style similar to writing mathematical formulas. It has been successfully applied to microfluidic chip design and large-scale river-aquifer coupled simulations, significantly shortening modeling cycles and promoting computational science from "expert-only" to "engineer-accessible".

Background

Due to its concise syntax and rich ecosystem, Python has become the preferred language for scientific research modeling, particularly suitable for quickly validating new ideas and visualizing results. However, it does not natively support multi-machine collaborative computation; when facing hydrological models or 3D flow field simulations requiring massive computation, a single computer may take hours or more to complete the calculations. Strategy A, which uses C language to call supercomputers, allows leveraging high-performance resources but requires rewriting all code and has a debugging process akin to rock climbing. Strategy B, which uses MATLAB, simplifies the workflow but cannot freely extend algorithms and has licensing fees comparable to the price of a small car. Therefore, how to make Python retain its ease of use while enabling the "one-click orchestration" of hundreds to thousands of servers working together has become a critical bottleneck between scientific research efficiency and engineering implementation.

Key Highlights

  1. Enabling Python to call supercomputers with user-friendly syntax: Complex network communication instructions are encapsulated into a few lines of everyday code, allowing multiple computers to be coordinated as easily as sending a group message via WeChat, avoiding the need to hand-write thousands of lines of low-level communication code, and improving development efficiency by more than 5 times.
  2. Reusing top international algorithm libraries: Directly calling scientific computing cores that have been validated in over 20 years and thousands of engineering applications (such as solving large-scale systems of equations) is equivalent to borrowing the "computing engines" of NASA and the Los Alamos National Laboratory, offering accuracy and stability far superior to in-house developed code.
  3. One codebase compatible with various devices: From dual-core laptops to thousand-node supercomputing centers, automatic adaptation occurs without code modification, similar to a single Word document that can be previewed on a smartphone and played in high definition on a large screen.

Summary and Outlook

Based on the deep integration of the Python language ecosystem and industrial-grade parallel computing frameworks, the technology achieves a unity of "high usability + high scalability" by encapsulating low-level communication logic and algorithm interfaces. It possesses the dual advantages of being open-source and free, as well as cross-platform compatibility. The results show that on a cluster of 8 ordinary workstations, the computing speed increased by nearly 7.8 times compared to a single machine, and in microfluidic chip simulation, the modeling time was compressed from 3 days to 4 hours. This study not only addresses the common pain point of researchers who "want to use supercomputers but do not know how to write parallel code" but also, through the methodological innovation of "driving low-level computing power with high-level languages," provides plug-and-play infrastructure support for cutting-edge directions such as climate simulation, digital twin cities, and AI for Science.

errShare
errSave
pytRIBS: An open, modular, and reproducible python-based framework for distributed hydrologic modeling
err2025-04-01
err0
PREAI
errRaming, L. Wren; Vivoni, Enrique R.; Cederstrom, C. Josh; Hossain, M. Akram; Becerra, Jose A.
errShare
errSave
Bio2Py: An API for integrating Python with BioWin for enhanced data acquisition in wastewater treatment simulations
err2024-06-01
err1
PREAI
errCaro, Florencia; Ferreira, Jimena; Castell, Elena; Pinto, Jose Carlos; Santiviago, Claudia
errShare
errSave
PyTheis-A Python Tool for Analyzing Pump Test Data
err2021-08-09
err3
errOAAI
errChang, Sun Woo; Memari, Sama S.; Clement, T. Prabhakar
errShare
errSave
amerta: a Python library for idealized 1D Saint–Venant dam-break simulation
err2026-08-04
err0
errOAAI
errDE Dasapta E. Irawan; SH Sandy H. S. Herho; IP Iwan P. Anwar; FK Faruq Khadami; AP Astyka Pamumpuni; RD Rendy D. Kartiko; ER Edi Riawan; RS Rusmawan Suwarman; DJ Deny J. Puradimaja
errShare
errSave
Shooting the Numerical Solution of Moisture Flow Equation with Root Water Uptake Models: A Python Tool
err2021-06-03
err17
PREAI
errDifonzo, Fabio V.; Masciopinto, Costantino; Vurro, Michele; Berardi, Marco
errShare
errSave
SeqIA: A Python framework for extracting drought impacts from news archives
err2025-04-01
err0
PREAI
errLopez-Otal, Miguel; Dominguez-Castro, Fernando; Vela-Tambo, Javier; Gracia, Jorge
errShare
errSave

Journal

Advances in Water Resources cover
Advances in Water Resources
IF:
4.2
Papers:
4.7K
Citations:
2.0W

Organization

Cited Papers

Cited Papers

errShare
errSave
IEF in microfluidic devices
err2009-03-03
err64
PREAI
errSommer, Greg J.; Hatch, Anson V.
errShare
errSave
Finite element simulation of Off-Gel™ buffering
err2002-10-01
err29
PREAI
errArnaud, IL; Josserand, J; Rossier, JS; Girault, HH
errShare
errSave
Surface Display of Recombinant Proteins onBacillus subtilisSpores
err2001-11-01
err0
errOAAI
errRachele Isticato; Giuseppina Cangiano; Hoa T. Tran; Annalisa Ciabattini; Donata Medaglini; Marco R. Oggioni; Maurilio De Felice; Gianni Pozzi; Ezio Ricca
errShare
errSave
A parallel finite element program on a Beowulf cluster
err2002-07-01
err46
errOAAI
errSonzogni, VE; Yommi, AM; Nigro, NM; Storti, MA
errShare
errSave
errShare
errSave
researcher View more