3 minutes
Written: 2021-09-24 01:37 +0000
Updated: 2024-08-06 00:53 +0000
Presentation Supplements for FortranCon'21
A meta-post on twin presentations on F2PY and LFortran at FortranCon'21
Background
I had the honor and pleasure to have two presentations at the second annual FortranCon in 2021. The fun part was both talks featured the language standard prominently, but were meant to form two sides of a coin.
f2py: Two Decades Later
- Co-Authors
- Dr. Ralf Gommers (Quansight Labs), Dr. Melissa Mendonca (Quansight Labs), Dr. Pearu Peterson (Quansight Labs)
- Duration
- 20 minutes (15 + 5)
Abstract
f2py is the gold standard for interfacing Fortran and Python. The most famous downstream consumer of the generated wrappers is undoubtedly the scipy ecosystem. Crucially, f2py is not a compiler, and generates a best effort set of wrappers, aided by special comment lines. One of the key inter-operable approaches to compilation of the subsequent wrappers relies on numpy.distutils. Given the planned obsolescence of this module; we discuss the methodology by which the build phase can be split into a two phase process and document better the pyf enhancements made to facilitate callbacks. A brief outline of test suites and documentation within the numpy ecosystem and proposed enhancement proposals will be discussed as well. We lay out the roadmap towards f2py remaining relevant beyond f77 by implementing derived types and newer features like parallelism with co-arrays. Playing to its strengths as a code-enhancer and leveraging the flexibility of not being constrained by the actual compilation process allows for the reimagining of f2py as a tool and library.
Other Content
Slides
- Best viewed here using a browser (in a new tab)
- A
pdf
copy of the slides are embedded below - The
orgmode
source is here on the site’s GH repo
Video
Implementing Fortran Standardese within LFortran
- Co-Author(s)
- Dr. Ondřej Čertík (Los Alamos National Laboratory)
- Duration
- 5 minutes
Abstract
The Fortran standard is a rather imposing document; though with F2018 at around 600 pages it is significantly lighter than its C++ counterpart. The standard itself is rarely cited as a beginner resource, with a cottage industry of books designed to shed light on the dry prose and foreboding technical rigor. However, with LFortran, particularly viewed through the lens of the Abstract Semantic Representation (ASR) of any Fortran code, the standard suddenly gains clarity and rigor. Being as it is a Fortran-first representation, unlike GCC’s internal representations (parse trees and lowered GIMPLE) or opaque (proprietary) middle-layers of NAG/Intel; the ASR is meant to concretely represent the syntax in a way to make the Standard seem eminently rational. Implementing the intrinsic functions and standard computing models become pleasant C++ puzzles instead of pidgin nightmares of progressively lower representations. In this presentation, I will discuss the process of implementing Standard intrinsic functions, the lifeline of any applied physical science researcher. LFortran allows for further flexibility at runtime, which will come up briefly, but most of the focus for this short talk will be on the compile time evaluation of intrinsic functions and future directions.
Other Content
The whole GSoC series.
Slides
- Best viewed here using a browser (in a new tab)
- A
pdf
copy of the slides are embedded below - The
orgmode
source is here on the site’s GH repo
Video
From around 10:43 in.
Thoughts
I could go on about these topics all day, thankfully for the most part, I do.