LFortran compiles POT3D
Posted on March 18, 2025
| 7 minutes
| 1395 words
| Gaurav Dhingra, Aditya Trivedi, Jinang Shah, Pranav Goswami, Saurabh Kumar, Ansh Mehta, Assem Medhat, Harshita Kalani, Parth Mistry, Gagandeep Singh, Ubaid Shaikh, Thirumalai Shaktivel, Vipul Cariappa, Shivi Mathur, Kerim Birgi, Serge Sans Paille, Advik Kabra, Brian Beckman, Dylon Edwards, Naman Gera, Rohit Goswami, Dominic Poerio, Akshānsh Bhatt, Virendra Kabra, Anutosh Bhat, Luthfan Lubis, Zihua Wu, Khushi Agrawal, Christoph Junghans, Tanay Manerikar, Wolf Vollprecht, Smit Lunagariya, Paul Henning, Ondřej Čertík, Jaysukh Makvana, Harshil Shah, Gauravsingh Sisodia, Karna Pardheev Sai, Shoaib Samim
We are thrilled to announce that LFortran can now successfully compile and run predsci/POT3D, marking a significant milestone in our journey to beta. POT3D is the ninth production-grade, third-party code that LFortran can compile, bringing us closer to our goal of compiling 10 such codes—a critical step toward a beta-quality compiler.
About POT3D
POT3D: High Performance Potential Field Solver is a package developed by Predictive Science Inc., written in Fortran that computes potential field solutions to approximate the solar coronal magnetic field using observed photospheric magnetic fields as a boundary condition. It can be used to generate potential field source surface (PFSS), potential field current sheet (PFCS), and open field (OF) models. It has been (and continues to be) used for numerous studies of coronal structure and dynamics. The code is highly parallelized using MPI and is GPU-accelerated using Fortran standard parallelism (do concurrent) and OpenMP Target for data movement and device selection, along with an option to use the NVIDIA cuSparse library. The HDF5 file format is used for input/output.
[Read More]
LFortran compiles PRIMA
Posted on March 4, 2025
| 6 minutes
| 1138 words
| Jinang Shah, Ansh Mehta, Assem Medhat, Pranav Goswami, Harshita Kalani, Parth Mistry, Gaurav Dhingra, Saurabh Kumar, Aditya Trivedi, Gagandeep Singh, Ubaid Shaikh, Thirumalai Shaktivel, Vipul Cariappa, Shivi Mathur, Kerim Birgi, Serge Sans Paille, Advik Kabra, Brian Beckman, Dylon Edwards, Naman Gera, Rohit Goswami, Dominic Poerio, Akshānsh Bhatt, Virendra Kabra, Anutosh Bhat, Luthfan Lubis, Zihua Wu, Khushi Agrawal, Christoph Junghans, Tanay Manerikar, Wolf Vollprecht, Smit Lunagariya, Paul Henning, Ondřej Čertík, Jaysukh Makvana, Harshil Shah, Gauravsingh Sisodia, Karna Pardheev Sai
We’re thrilled to share that LFortran can now successfully compile and execute libprima/PRIMA. PRIMA marks the eighth production-grade, third-party code that LFortran has compiled with bit-for-bit alignment to GFortran’s output. This milestone brings us closer to our goal of compiling 10 such codes—an essential step toward achieving a beta-quality compiler.
About PRIMA
PRIMA is a package developed by Zaikun Zhang for
solving general nonlinear optimization problems without using derivatives. It
provides the reference implementation for
Powell’s derivative-free optimization
methods, i.e., COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. PRIMA means
Reference Implementation for Powell’s methods with Modernization and
Amelioration, P for Powell. The package is written in Fortran and is widely
used in the scientific community for solving optimization problems.
[Read More]
LFortran supports all intrinsic functions
Posted on November 14, 2024
| 14 minutes
| 2770 words
| Harshita Kalani, Parth Mistry, Pranav Goswami, Gaurav Dhingra, Assem Medhat, Saurabh Kumar, Jinang Shah, Aditya Trivedi, Ansh Mehta, Gagandeep Singh, Ubaid Shaikh, Thirumalai Shaktivel, Vipul Cariappa, Shivi Mathur, Kerim Birgi, Serge Sans Paille, Advik Kabra, Brian Beckman, Dylon Edwards, Naman Gera, Rohit Goswami, Dominic Poerio, Akshānsh Bhatt, Virendra Kabra, Anutosh Bhat, Luthfan Lubis, Zihua Wu, Khushi Agrawal, Christoph Junghans, Tanay Manerikar, Wolf Vollprecht, Smit Lunagariya, Paul Henning, Ondřej Čertík
We are thrilled to announce that LFortran supports all intrinsic functions
listed in F2018 Interpretation Document (Table 16.1 Pg: 332) (also shown by this nice list online at GFortran’s documentation).
This comprehensive list of almost 200 intrinsics encompasses a broad array of
functions and subroutines essential to Fortran’s functionality, including
elemental, inquiry, transformational, array operations, and more. For each
function we support both compile-time and runtime evaluation.
The functions are implemented in an ASR (Abstract Semantic Representation)
pass, which means they get “instantiated” and specialized for the argument
types and then the compiler can optimize it, so using any intrinsic function is
at least as fast as implementing the same operation yourself, there is no
runtime overhead.
[Read More]
LFortran now compiles SNAP
Posted on August 27, 2024
| 7 minutes
| 1439 words
| Gaurav Dhingra, Assem Medhat, Saurabh Kumar, Pranav Goswami, Ondřej Čertík, Gagandeep Singh, Ubaid Shaikh, Thirumalai Shaktivel, Harshita Kalani, Parth Mistry, Vipul Cariappa, Shivi Mathur, Kerim Birgi, Serge Sans Paille, Advik Kabra, Christoph Junghans, Tanay Manerikar, Wolf Vollprecht
We are thrilled to announce that LFortran can now successfully compile and run lanl/SNAP, marking a significant milestone in our journey to beta. SNAP is the seventh production-grade, third-party code that LFortran can compile, bringing us closer to our goal of compiling 10 such codes—a critical step toward a beta-quality compiler.
About SNAP
SNAP (SN Discrete Ordinates Application Proxy) is a proxy application designed to emulate the performance of modern discrete ordinates neutral particle transport codes. It replicates the computational workload, memory requirements, and communication patterns of the Los Alamos National Laboratory code PARTISN, without including actual physics. By using domain decomposition and parallelization across spatial, angular, and energy domains, SNAP is ideal for performance testing on cutting-edge high-performance computing systems.
[Read More]
LFortran supports OpenMP pragmas and Do Concurrent
Posted on July 30, 2024
| 9 minutes
| 1880 words
| Pranav Goswami, Harshita Kalani, Parth Mistry, Ubaid Shaikh, Ondřej Čertík, Gaurav Dhingra, Thirumalai Shaktivel, Gagandeep Singh, Assem Medhat, Saurabh Kumar, Vipul Cariappa, Shivi Mathur, Kerim Birgi
In early June, we announced a significant achievement with LFortran: the Fastest Open-Source Compiler in Compile-Time Evaluation of an Array Benchmark. Continuing our commitment to performance enhancement, we are pleased to announce that LFortran now includes support for OpenMP pragmas and parallelizing do concurrent
. Particularly for parallel do
OpenMP construct, our implementation is fully operational and achieves performance comparable to GFortran.
Note that LFortran is still a alpha software, meaning that users must continue expecting that LFortran will fail compiling or running their codes. Please report all bugs that you find.
[Read More]
LFortran: the Fastest Open-Source Compiler in Compile-Time Evaluation of an Array Benchmark
Posted on June 4, 2024
| 5 minutes
| 1062 words
| Harshita Kalani, Pranav Goswami, Parth Mistry, Ubaid Shaikh, Ondřej Čertík, Gaurav Dhingra, Thirumalai Shaktivel, Gagandeep Singh, Assem Medhat, Saurabh Kumar, Vipul Cariappa
After successful compilation of stdlib
and Fortran On Web Using LFortran, we focused on improving the support for compile time computation and we are excited to announce that LFortran can now compile the example from the Computing at compile time Fortran Discourse topic.
This example can be used to benchmark the speed of compilation and compile-time array evaluation by increasing the size of the arrays. On this particular example LFortran outperforms other open-source Fortran compilers by an order of magnitude for large array sizes. For small array sizes each compiler has a different constant overhead, which becomes negligible for large arrays and this benchmark measures how quickly the compiler can internally apply the symbolic function on a large array numerically.
[Read More]
Fortran On Web Using LFortran
Posted on May 2, 2024
| 2 minutes
| 377 words
| Ondřej Čertík, Gagandeep Singh, Ubaid Shaikh, Thirumalai Shaktivel, Pranav Goswami, Harshita Kalani, Parth Mistry, Gaurav Dhingra, Smit Lunagariya, Luthfan Lubis, Naman Gera, Zihua Wu, Khushi Agrawal, Christoph Junghans, Brian Beckman, Dylon Edwards
Fortran On Web Using LFortran
Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser.
MNIST
We cloned the original authors code and just swapped-in two of our generated files mnist.js
and mnist.wasm
with the original files. We also fixed few minor bugs in the code that we came across (details in the commit history).
[Read More]
LFortran compiles Fortran stdlib
Posted on April 16, 2024
| 4 minutes
| 822 words
| Ondřej Čertík, Gagandeep Singh, Ubaid Shaikh, Thirumalai Shaktivel, Pranav Goswami, Harshita Kalani, Parth Mistry, Gaurav Dhingra, Smit Lunagariya, Luthfan Lubis, Naman Gera, Zihua Wu, Khushi Agrawal, Christoph Junghans, Brian Beckman, Dylon Edwards
LFortran compiles 85% Fortran stdlib
We are happy to announce that LFortran can compile all numerical modules in stdlib
. The stdlib
library has 32 modules, here are the details of the current status:
- all 32 modules compile to ASR
- 27 modules (85%) compile to LLVM; there are 4 hash modules (
hash_32bit
, hash_64bit
, hashmaps
, hashmap_wrappers
, stringlist_type
) and one stringlist_type
module that does not compile to LLVM yet
- 24 modules pass all their tests; 3 modules (
sorting
, bitsets
, stats
) do not pass all tests yet, but simple examples that use the modules work
This is sixth third-party production-grade code that LFortran can compile after SciPy. The progress bar towards beta has thus reached 6/10.
[Read More]
LFortran Compiles 60% of Scipy
Posted on January 10, 2024
| 5 minutes
| 891 words
| Ondřej Čertík, Pranav Goswami, Konrad Handrick, Harshita Kalani, Sarthak Gupta, Ubaid Shaikh, Gagandeep Singh, Thirumalai Shaktivel, Smit Lunagariya, Luthfan Lubis, Naman Gera, Zihua Wu, Khushi Agrawal, Christoph Junghans, Brian Beckman, Dylon Edwards, Rohit Goswami
LFortran Compiles 60% of SciPy
With successful compilation of dftatom in October 2023, embarking to the new year with a remarkable stride, we are delighted to announce that LFortran can now successfully compile 9 out of the 15 Fortran packages within the SciPy library without requiring any modifications.
This is the fifth third-party production-grade code that LFortran can compile. The progress bar towards beta has thus reached 5/10.
LFortran can now compile and pass tests written for scipy.special.specfun
, scipy.special.cdflib
, scipy.special.amos
, scipy.special.mach
, scipy.optimize.minpack
, scipy.optimize.minpack2
, scipy.interpolate.fitpack
, scipy.integrate.quadpack
, and scipy.integrate.mach
.
[Read More]
LFortran Compiles dftatom
Posted on October 31, 2023
| 8 minutes
| 1554 words
| Ondřej Čertík, Brian Beckman, Gagandeep Singh, Thirumalai Shaktivel, Ubaid Shaikh, Pranav Goswami, Luthfan Lubis, Harshita Kalani, Sarthak Gupta, Anutosh Bhat, Smit Lunagariya, Dylon Edwards, Virendra Kabra, Khushi Agrawal, Rohit Goswami
After compiling fastGPT in September 2023, today we are happy to announce that LFortran can compile and run dftatom without any modifications, and dftatom
’s continuous integration (CI) now tests every commit with LFortran, along side GFortran.
This is the fourth full third-party production-grade code that LFortran can compile. The progress bar towards beta has thus reached 4/10.
It can compile the main application in Debug mode twice faster than GFortran. In Release mode the runtime performance is within a factor of 2x slower than GFortran’s Release mode (all optimizations on).
[Read More]