Lessons learned from using the C Foreign Function Interface
summary
Build compiles Python ML into a dynamic library and links it into Fortran via cffi, uses buffer sharing for arrays, and replaces one Fortran routine with a Python version that functions correctly. Measured runtimes show about a 10× slowdown at 32 processes and a catastrophic jump to roughly 100× at 2048 processes. Flexible and easy to develop, but practical performance breaks when scaling across many MPI ranks and the root cause remains unresolved.
AI-written summary · about
related talks
25m"Boosting Python Numeric Computations with Dynamic C++ Integration"
32mFrom Fortran to Python: A Conversation Across Generations of Scientific Computing
36mPython, C, C++, and Fortran Relationship Status: It’s Not That Complicated
01h 21mAccelerating Python With C++
59mMyths and fairy tales around Python performance
16mIntrepydd: Performance, Productivity, and Portability for Data Science Application Kernels
31mCFFI, Ctypes, Cython The Good, The Bad and The Ugly
31m"Optimizing Scientific Python with C++, CUDA, and Serverless Compute"
