Computer Science ›› 2020, Vol. 47 ›› Issue (1): 17-23.doi: 10.11896/jsjkx.190500009

• Computer Architecture • Previous Articles     Next Articles

Large-scale High-performance Lattice Boltzmann Multi-phase Flow Simulations Based on Python

XU Chuan-fu,WANG Xi,LIU Shu,CHEN Shi-zhao,LIN Yu   

  1. (College of Computer,National University of Defense Technology,Changsha 410073,China)
  • Received:2019-05-05 Published:2020-01-19
  • About author:XU Chuan-fu,born in 1980,Ph.D,associate professor,is member of China Computer Federation(CCF).His main research interests include parallel computing and applications.

Abstract: Due to the plenty of third-party libraries and development productivity,Python is becoming increasingly popular as a programming language in areas such as data science and artificial intelligence.Python has been providing fundamental support for scientific and engineering computing.For example,libraries such as NumPy and SciPy provide efficient data structures for multi-dimensional arrays and rich numerical functions.Traditionally,Python was used as a script language,gluing preprocessors,solvers and postprocessors and enhancing automation in numerical simulations.Recently,some foreign researchers implement their solvers using Python and parallelize their Python codes on high performance computers,with impressive results achieved.Because of its intrinsic features,implementation and optimization of high performance large-scale numerical simulations with Python are quite different with traditional language such as C/C++ and Fortran.This paper presented a large-scale parallel open source 3D Lattice Boltzmann multi-phase flow simulation code PyLBMFlow with Python,and investigated large-scale parallel computing and performance optimization for Python numerical applications.It designed LBM flow data structures and computational kernels with NumPy multi-dimensional arrays and universal functions.Through a range of optimization including reconstruction of boundary processing,it dramatically improves the efficiency of Python computing by about 100X,compared with the baseline version,on a CPU core.Furthermore,this paper designed a 3D decomposition method and implement hybrid MPI+OpenMP parallelization using mpi4py and Cython.Tests for 3D multi-phase(liquid and gases) problem(about 10 Billion lattices) simulating drop impact with gravity effect using D3Q19 Lattice Boltzmann discretization and Shan-Chen BGK single relaxation time collision model were presented,achieving a weak parallel efficiency of above 90% in going from 64 to 1024 compute nodes.

Key words: Lattice Boltzmann method, Parallel computing, Performance optimization, High performance Python, Multi-phase flow simulation

CLC Number: 

  • TP391
[1]ANDERSON J D.Computational Fluid Dynamics[M].McGraw-Hill,1995:1-30.
[2]SUCCI S,BENZI R,HIGUERA F.The lattice Boltzmann equation:A new tool for computational fluid dynamics[J].Physica D:Nonlinear Phenomena,1991,47(1):219-230.
[3]DAWSON S P,CHEN S,DOOLEN G D.Lattice Boltzmann computations for reaction-di_usion equations[J].The Journal of Chemical Physics,1993,98(2):1514-1523.
[4]SHAN X,CHEN H.Lattice Boltzmann model for simulating flows with multiple phases and components[J].Physics Review E,1993,47(3):1815-1819.
[5]ZHAO Y,WANG L,QIU F,et al.Melting and flowing in multiphase environment[J].Computers and Graphics,2006,30(4):519-528.
[6]BOSL W J,DVORKIN J,NUR A.A study of porosity and permeability using a lattice Boltzmann simulation[J].Geophysical Research Letters,1998,25(9):1475-1478.
[7]BAILEY P,MYRE J,WALSH S D,et al.Accelerating lattice Boltzmann fluid flow simulations using graphics processors[C]∥Internation al Conference on Parallel Processing.2009:550-557.
[8]BIFERALE L,MANTOVANI F,PIVANTI M,et al.Optimization of Multi-Phase Compressible Lattice Boltzmann Codes on Massively Parallel Multi-Core Systems[J].Procedia Computer Science,2011,4(4):994-1003.
[9]MOUNTRAKIS L,LORENZ E,MALASPINAS O,et al.Parallel performance of an IB-LBM suspension simulation framework[J].Journal of Computational Science,2015,9:45-50.
[10]WILLIAMS S,CARTER J,OLIKER L,et al.Optimization of a lattice boltzmann computation on state-of-the-art multicore platforms[J].Journal of Parallel and Distributed Computing,2009,69(9):762-777.
[11]PANANILATH I,ACHARYA A,VASISTA V,et al.An optimizing code generator for a class of lattice-boltzmann computations[J].ACM Transactions on Architecture and Code Optimization,2015,12(2):1-14.
[12]FEICHTINGER C,HABICH J,KESTLER H,et al.Perform- ance modeling and analysis of heterogeneous lattice boltzmann simulations on cpu-gpu clusters[J].Parallel Computing,2015,46(C):1-13.
[13]LI D,XU C,WANG Y,et al.Parallelizing and optimizing large-scale 3d multi-phase flow simulations on the tianhe-2 supercomputer[J].Concurrency and Computation:Practice and Expe-rience,2016,28:1678-1692.
[14]NumPy Official. Scipy Official.
[16]MORTENSEN M,LANGTANGEN H P.High performance Python for direct numerical simulations of turbulent flows[J].Computer Physics Communications,2016,203:53-65.
[17]VINCENT P,WITHERDENY F,VERMERIRE B,et al.Towards Green Aviation with Python at Petascale∥IEEE International Conference for High Performance Computing and Data analytic.2016:1-11.
[18]LIAO X,XIAO L,YANG C.Milkyway-2 supercomputer:system and application[J].Frontier of Computer Science,2004,8(3):345-356.
[1] MA Meng-yu, WU Ye, CHEN Luo, WU Jiang-jiang, LI Jun, JING Ning. Display-oriented Data Visualization Technique for Large-scale Geographic Vector Data [J]. Computer Science, 2020, 47(9): 117-122.
[2] CHEN Guo-liang, ZHANG Yu-jie, . Development of Parallel Computing Subject [J]. Computer Science, 2020, 47(8): 1-4.
[3] YANG Wang-dong, WANG Hao-tian, ZHANG Yu-feng, LIN Sheng-le, CAI Qin-yun. Survey of Heterogeneous Hybrid Parallel Computing [J]. Computer Science, 2020, 47(8): 5-16.
[4] XU Jiang-feng and TAN Yu-long. Research on HBase Configuration Parameter Optimization Based on Machine Learning [J]. Computer Science, 2020, 47(6A): 474-479.
[5] LV Xiao-jing, LIU Zhao, CHU Xue-sen, SHI Shu-peng, MENG Hong-song, HUANG Zhen-chun. Extreme-scale Simulation Based LBM Computing Fluid Dynamics Simulations [J]. Computer Science, 2020, 47(4): 13-17.
[6] YANG Zong-lin, LI Tian-rui, LIU Sheng-jiu, YIN Cheng-feng, JIA Zhen, ZHU Jie. Streaming Parallel Text Proofreading Based on Spark Streaming [J]. Computer Science, 2020, 47(4): 36-41.
[7] ZHANG Peng-yi, SONG Jie. Research Advance on Efficiency Optimization of Blockchain Consensus Algorithms [J]. Computer Science, 2020, 47(12): 296-303.
[8] DENG Ding-sheng. Application of Improved DBSCAN Algorithm on Spark Platform [J]. Computer Science, 2020, 47(11A): 425-429.
[9] XU Lei, CHEN Rong-liang, CAI Xiao-chuan. Scalable Parallel Finite Volume Lattice Boltzmann Method Based on Unstructured Grid [J]. Computer Science, 2019, 46(8): 84-88.
[10] SHU Na,LIU Bo,LIN Wei-wei,LI Peng-fei. Survey of Distributed Machine Learning Platforms and Algorithms [J]. Computer Science, 2019, 46(3): 9-18.
[11] ZHANG Ling-hao, GUI Sheng-lin, MU Feng-jun, WANG Sheng. Clone Detection Algorithm for Binary Executable Code with Suffix Tree [J]. Computer Science, 2019, 46(10): 141-147.
[12] XU Qi-ze, HAN Wen-ting, CHEN Jun-shi, AN Hong. Optimization of Breadth-first Search Algorithm Based on Many-core Platform [J]. Computer Science, 2019, 46(1): 314-319.
[13] ZHANG Bin, LE Jia-jin. Hash Join in MapReduce Distributed Environment Based on Column-store [J]. Computer Science, 2018, 45(6A): 471-475.
[14] LIAO Xing, YUAN Jing-ling and CHEN Min-cheng. Parallel PSO Container Packing Algorithm with Adaptive Weight [J]. Computer Science, 2018, 45(3): 231-234.
[15] ZHANG Xiao-chuan, LI Qin, NAN Hai, PENG Li-rong. Application of Improved UCT Algorithm in EinStein Würfelt Nicht! Computer Game [J]. Computer Science, 2018, 45(12): 196-200.
Full text



[1] LEI Li-hui and WANG Jing. Parallelization of LTL Model Checking Based on Possibility Measure[J]. Computer Science, 2018, 45(4): 71 -75 .
[2] SUN Qi, JIN Yan, HE Kun and XU Ling-xuan. Hybrid Evolutionary Algorithm for Solving Mixed Capacitated General Routing Problem[J]. Computer Science, 2018, 45(4): 76 -82 .
[3] ZHANG Jia-nan and XIAO Ming-yu. Approximation Algorithm for Weighted Mixed Domination Problem[J]. Computer Science, 2018, 45(4): 83 -88 .
[4] WU Jian-hui, HUANG Zhong-xiang, LI Wu, WU Jian-hui, PENG Xin and ZHANG Sheng. Robustness Optimization of Sequence Decision in Urban Road Construction[J]. Computer Science, 2018, 45(4): 89 -93 .
[5] SHI Wen-jun, WU Ji-gang and LUO Yu-chun. Fast and Efficient Scheduling Algorithms for Mobile Cloud Offloading[J]. Computer Science, 2018, 45(4): 94 -99 .
[6] ZHOU Yan-ping and YE Qiao-lin. L1-norm Distance Based Least Squares Twin Support Vector Machine[J]. Computer Science, 2018, 45(4): 100 -105 .
[7] LIU Bo-yi, TANG Xiang-yan and CHENG Jie-ren. Recognition Method for Corn Borer Based on Templates Matching in Muliple Growth Periods[J]. Computer Science, 2018, 45(4): 106 -111 .
[8] GENG Hai-jun, SHI Xin-gang, WANG Zhi-liang, YIN Xia and YIN Shao-ping. Energy-efficient Intra-domain Routing Algorithm Based on Directed Acyclic Graph[J]. Computer Science, 2018, 45(4): 112 -116 .
[9] CUI Qiong, LI Jian-hua, WANG Hong and NAN Ming-li. Resilience Analysis Model of Networked Command Information System Based on Node Repairability[J]. Computer Science, 2018, 45(4): 117 -121 .
[10] WANG Zhen-chao, HOU Huan-huan and LIAN Rui. Path Optimization Scheme for Restraining Degree of Disorder in CMT[J]. Computer Science, 2018, 45(4): 122 -125 .