Skip main navigation

Hands-on: utilizing Fortran code

In this exercise you can practice using f2py.
© CC-BY-NC-SA 4.0 by CSC - IT Center for Science

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

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now