High performance Python for direct numerical simulations of turbulent flows

02/11/2016
by   Mikael Mortensen, et al.
0

Direct Numerical Simulations (DNS) of the Navier Stokes equations is an invaluable research tool in fluid dynamics. Still, there are few publicly available research codes and, due to the heavy number crunching implied, available codes are usually written in low-level languages such as C/C++ or Fortran. In this paper we describe a pure scientific Python pseudo-spectral DNS code that nearly matches the performance of C++ for thousands of processors and billions of unknowns. We also describe a version optimized through Cython, that is found to match the speed of C++. The solvers are written from scratch in Python, both the mesh, the MPI domain decomposition, and the temporal integrators. The solvers have been verified and benchmarked on the Shaheen supercomputer at the KAUST supercomputing laboratory, and we are able to show very good scaling up to several thousand cores. A very important part of the implementation is the mesh decomposition (we implement both slab and pencil decompositions) and 3D parallel Fast Fourier Transforms (FFT). The mesh decomposition and FFT routines have been implemented in Python using serial FFT routines (either NumPy, pyFFTW or any other serial FFT module), NumPy array manipulations and with MPI communications handled by MPI for Python (mpi4py). We show how we are able to execute a 3D parallel FFT in Python for a slab mesh decomposition using 4 lines of compact Python code, for which the parallel performance on Shaheen is found to be slightly better than similar routines provided through the FFTW library. For a pencil mesh decomposition 7 lines of code is required to execute a transform.

READ FULL TEXT

page 9

page 10

research
07/01/2016

Massively parallel implementation in Python of a pseudo-spectral DNS code for turbulent flows

Direct Numerical Simulations (DNS) of the Navier Stokes equations is a v...
research
10/02/2019

Modernizing Titan2D, a Parallel AMR Geophysical Flow Code to Support Multiple Rheologies and Extendability

In this work, we report on strategies and results of our initial approac...
research
02/11/2016

Oasis: a high-level/high-performance open source Navier-Stokes solver

Oasis is a high-level/high-performance finite element Navier-Stokes solv...
research
07/03/2018

FluidSim: modular, object-oriented Python package for high-performance CFD simulations

The Python package fluidsim is introduced in this article as an extensib...
research
06/16/2016

D2O - a distributed data object for parallel high-performance computing in Python

We introduce D2O, a Python module for cluster-distributed multi-dimensio...
research
09/21/2023

Unlocking massively parallel spectral proper orthogonal decompositions in the PySPOD package

We propose a parallel (distributed) version of the spectral proper ortho...
research
11/13/2017

ABCpy: A High-Performance Computing Perspective to Approximate Bayesian Computation

ABCpy is a highly modular scientific library for Approximate Bayesian Co...

Please sign up or login with your details

Forgot password? Click here to reset