Pyccel, a Fortran static compiler for scientific High-Performance Computing

Presenting Pyccel, a source-to-source Python-Fortran, and DSL enabling HPC capabilities.

Tags: Artificial Intelligence, Algorithms, Astronomy, Parallel Programming, Programming, Python, Science

Scheduled on wednesday 17:10 in room cubus


Dr. Ing. Ratnani Ahmed

  • since 09/2014 Max-Planck Institut für Plasmaphysik IPP, Garching bei München, Germany MHD group leader since 2016

  • 10/2013 - 09/2014 Université de Nice Sophia-Antipolis, Nice FRANCE PostDoc

  • 10/2011 - 10/2013 C.E.A./DSM/IRFM/SIPP, Cadarache FRANCE PostDoc, EuroFusion fellowship

  • 09/2008 - 10/2011 INRIA / IRMA - Institut de Recherche en Mathématiques Avancées, Strasbourg FRANCE Phd

  • 02/2006 - 09/2007 FERMAT - Risk Management Software Provider FRANCE Engineer ( Basel II Project - Credit Risk )


Pyccel is a new static compiler for Python that uses Fortran as backend language while enabling High-Performance Computing HPC capabilities.

Fortran is a computer language for scientific programming that is tailored for efficient run-time execution on a wide variety of processors. Even if the 2003 and 2008 standards added major improvements like OOP, Coarrays, Submodules, do concurrent, etc ... they are not covered by all available compilers. Moreover, the Fortran developer still suffers from the lack of meta-programming compared to C++ ones. Therefore, it is more and more difficult for applied mathematicians and computational physicists to write applications at the state of art (targeting CPUs, GPUs, MICs) while implementing complicated algorithms or numerical schemes.

Pyccel can be used in two cases:

  • accelerate Python code by converting it to Fortran and calling f2py,
  • generate portable HPC Fortran codes from a DSL using the Python syntax.

In order to achieve the second point, we developed an internal DSL for types and macros. The later is used to map sentences based on mpi4py, scipy.linalg.blas or lapack onto the appropriate calls in Fortran. Moreover, two parsers, for OpenMP and OpenACC, were added too, allowing for explicit parallelism through the use of pragmas.

Last but not least, Pyccel is an extension of Sympy. Actually, it converts a Python code to symbolic expressions/trees, from a Full Syntax Tree (RedBaron), then annotates the new AST using types or different settings provided by the user.

In this talk, after a brief description of Pyccel, I will show different applications including Finite Elements (1d, 2d, 3d), Semi-Lagrangian schemes (4d), Kronecker linear solvers, diagnostics for 5D kinetic simulations and Machine Learning for Partial Differential Equations.