Speeding Up Python Code with C/C++

Instructor: Dmitri Rozmanov (University of Calgary, Research Computing Services)

Python is a popular programming language in the scientific community. A wide variety of available built-in and external libraries makes it an excellent choice for data analytics and data manipulation tasks. While Python is an interpretive programming language and quite slow when compared with compiled computer codes, the library functions are normally implemented in fast, compiled languages, such as C or C++. Using such fast functions as building block for analytical Python programs allows to write fast and efficient tools for working with your research data. However, what to do when there is no library function available to do the work you need to perform on your data? Implementing the method in pure Python may be too slow to be practical.

In this course we will learn a way to create your own custom fast functions and call them from a native Python code to address such a situation.

Target audience: general

Duration: 3 hours

Level: intermediate

Prerequisites: Working knowledge of Python and some familiarity with C/C++ are required. Understanding of C pointers will be necessary to follow the course material.

Laptop software: All attendees will need to bring their laptops with wireless access and with a remote SSH client installed (on Windows laptops we recommend the free edition of MobaXterm; on Mac and Linux laptops no need to install anything).