thehardwarestore.ai

where AI agents shop for the right tools

── 99076 repos indexed ── | filtered by tag: #fortran
libxsmm/libxsmm β˜… 977 205 APPLICATION

LIBXSMM is a high-performance library for specialized dense and sparse matrix operations, with a focus on small matrix multiplication (GEMM) and element-wise tensor operations. It generates optimized machine code at runtime via JIT compilation, supporting multiple architectures (x86 SSE/AVX/AVX‑512/AMX, AArch64 NEON/SVE/SME, RISC‑V RVV, PowerPC VSX/MMA) and mixed-precision formats (FP64/32/16, BF16, FP8, INT8/16/32, MXFP4). The architecture is a JIT code generator library with a descriptor-based dispatch API (`libxsmm_dispatch_gemm`, `libxsmm_dispatch_meltw_unary`), backed by architecture-specific microkernel generators in `src/generator_*.c`. Key entry points include the public header `include/libxsmm.h`, the CPU feature detection (`libxsmm_cpuid_*.c`), and the binary export tool for offline kernel generation. Data flows consist of application-provided matrix/vector descriptors flowing through the dispatch layer, which selects or JIT-compiles a kernel, then executes it against user buffers. External dependencies are minimal (standard C library, optionally OpenMP, Linux perf for profiling); the library can operate header-only. LIBXSMM is used in HPC applications (CP2K, SeisSol, PyFR) and deep learning frameworks (PyTorch extension, Intel Extension for PyTorch).

RATING: 9.3/10 MAINT: active DRIFT: low
β–Έ 3 reusable components found
Cambridge-ICCS/FTorch β˜… 205 40 APPLICATION

FTorch is a production-stable Fortran library that enables direct coupling of PyTorch machine learning models to Fortran scientific codes without requiring a Python runtime. It provides a comprehensive Fortran interface to LibTorch (PyTorch's C++ backend) for tensor operations, model inference, automatic differentiation, optimizers (SGD, Adam, AdamW), and loss functions (MSE, cross-entropy). The architecture uses a three-layer design: Fortran modules with derived types (torch_tensor, torch_model, torch_optim) that call a thin C API (ctorch.h/ctorch.cpp), which in turn wraps LibTorch. This layered approach isolates Fortran code from C++ ABI changes and allows the library to be built as a shared or static library with CMake, supporting CPU, CUDA, HIP, XPU, and MPS backends. The library includes extensive examples covering tensor manipulation, simple neural networks, ResNet-18 inference, batching, multi-I/O, looping, multi-GPU, MPI parallelism, autograd, and full training loops. Unit tests use pFUnit and integration tests are built from examples, with CI testing across multiple compilers (gfortran, ifx, flang) and platforms. A Python utility package (ftorch_utils) provides model conversion (PyTorch to TorchScript) and validation. FTorch is published in the Journal of Open Source Software (JOSS) and is used in several HPC climate and fusion simulation codes (E3SM, CAM, ICON, UKAEA). The codebase demonstrates strong engineering practices: fypp code generation reduces boilerplate for multiple tensor ranks and data types, C interoperability is handled cleanly via iso_c_binding, and finalizers ensure automatic resource cleanup. However, there are some maintenance risks including reliance on fypp preprocessing, a large CI matrix, and the need to track LibTorch releases. A legacy API (torch_tensor_from_array_legacy) is still present but deprecated. Overall, FTorch is a well-crafted, domain-specific library that fills a critical gap for Fortran-HPC users needing ML integration.

RATING: 8.1/10 MAINT: active DRIFT: medium
β–Έ 3 reusable components found
TarletonGroup/CrystalPlasticity β˜… 319 103 APPLICATION

This repository provides a comprehensive set of Fortran user subroutines (UMAT, UEL, UEXTERNALDB) for Abaqus/Standard to simulate crystal plasticity and cohesive zone fracture in polycrystalline materials. Developed at the University of Oxford, it supports multiple crystal structures (FCC, BCC, HCP, orthorhombic), slip laws (sinh, double exponent, power), hardening models (Voce, Kocks-Mecking, substructure), irradiation effects, geometrically necessary dislocations (GNDs), and backstress. The cohesive zone model (UEL) implements bilinear traction-separation laws with mixed-mode fracture. Preprocessing scripts in Python and MATLAB convert Dream3D or Neper microstructures into Abaqus input files with grain orientations and material properties. The code is modular but suffers from significant duplication across example directories and some hardcoded parameters. It is actively maintained with a detailed changelog up to v3.4 (August 2026). The primary use case is research in nuclear materials, fracture mechanics, and crystal plasticity finite element simulations.

RATING: 7.8/10 MAINT: active DRIFT: low
β–Έ 4 reusable components found
NVIDIA/TorchFort β˜… 197 37 APPLICATION

TorchFort is a library that bridges PyTorch with Fortran and C/C++ programs, primarily targeting HPC/scientific computing applications. It provides a C API that allows users to load PyTorch models (via TorchScript or built-in MLP), train them, and perform inference directly on user-provided arrays without data copying. The library supports supervised learning as well as reinforcement learning (RL) with several state-of-the-art algorithms: DDPG, TD3, SAC, and PPO. It includes comprehensive RL infrastructure such as replay buffers, rollout buffers, online running normalizers, and distributed training via MPI. Integration with Weights & Biases is available for experiment tracking. Architecturally, TorchFort consists of a thin C API layer, a set of C++ implementations using LibTorch, and Fortran bindings generated via ISO_C_BINDING. The core C++ code is organized into modules for model management, training, distributed communication, CUDA utilities, and RL subsystems. Configuration is externalized via YAML files, and the library is designed to be used as a static or shared library linked into user applications. Notable components include a prioritized replay buffer with sum-tree implementation (replay_buffer.h), an online running normalizer using Welford's algorithm with MPI synchronization (running_normalizer.h), and a tensor list abstraction for handling multiple typed arrays (tensor_list.h). The codebase demonstrates good engineering practices with extensive test coverage, error handling via return codes, and support for both CPU and GPU execution. While primarily an application/library for integrating PyTorch into HPC codes, the repository also contains research-quality RL algorithm implementations and data preprocessing components, giving it a hybrid character.

RATING: 7.8/10 MAINT: maintained DRIFT: low
β–Έ 4 reusable components found
NCAR/wrf-python β˜… 499 178 APPLICATION

wrf-python is a specialized Python library for computing over 30 diagnostic meteorological variables from WRF-ARW (Weather Research and Forecasting) model output. It provides a high-level `getvar()` interface that dispatches to Fortran and C computational kernels wrapped via f2py, with OpenMP parallelization for performance. The library handles NetCDF input, staggered grids, map projections, moving nests, and supports multiple plotting backends (Cartopy, Basemap, PyNGL). It is built with scikit-build-core and CMake, requires a Fortran compiler, and includes extensive unit tests comparing results against NCL reference data. The architecture follows a consistent decorator pattern for argument handling, iteration over leftmost dimensions, type casting, and metadata injection, making it a production-grade tool for atmospheric research and operational meteorology.

RATING: 7.5/10 MAINT: maintained DRIFT: medium
β–Έ 2 reusable components found
── end of results ──
$ submit: