Skip main navigation

Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. T&Cs apply

Hands-on: utilizing Fortran code

In this exercise you can practice using f2py.
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.py .

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

© CC-BY-NC-SA 4.0 by CSC - IT Center for Science
This article is from the free online

Python in High Performance Computing

Created by
FutureLearn - Learning For Life