Hands-on: utilizing Fortran code

Using Fortran in heat equation solver

The code for this exercise is located under interface/fortran.

~/hpc-python$ cd interface/fortran

The file evolve.f90 contain a pure Fortran implementation of the single time step in heat equation. Use f2py for creating Python interface, and utilize the Fortran implementation in heat_simple.py .

Do you see any difference in performance between CFFI, Cython, and f2py versions of heat equation?

Share this article:

This article is from the free online course:

Python in High Performance Computing

Partnership for Advanced Computing in Europe (PRACE)