Search NASA⌕ Search

SEARCH · Search NASA

Results for “C CODES”

Search indexed NASA NTRS and DOE OSTI research on propulsion, heat transfer, battery materials and energy systems. Follow report and document links to the original sources.

Quote a phrase for an exact phrase match. Source license links do not imply unrestricted reuse.

At least 19 records

Automatic Differentiation of C++ Codes on Emerging Manycore Architectures with Sacado

Automatic differentiation (AD) is a well-known technique for evaluating analytic derivatives of calculations implemented on a computer, with numerous software tools available for incorporating AD technology into complex applications. However, a growing challenge for AD is the efficient differentiation of parallel computations implemented on emerging manycore computing architectures such as multicore CPUs, GPUs, and accelerators as these devices become more pervasive. In this work, we explore forward mode, operator overloading-based differentiation of C++ codes on these architectures using the widely available Sacado AD software package. In particular, we leverage Kokkos, a C++ tool providing APIs for implementing parallel computations that is portable to a wide variety of emerging architectures. Here we describe the challenges that arise when differentiating code for these architectures using Kokkos, and two approaches for overcoming them that ensure optimal memory access patterns as well as expose additional dimensions of fine-grained parallelism in the derivative calculation. We describe the results of several computational experiments that demonstrate the performance of the approach on a few contemporary CPU and GPU architectures. We then conclude with applications of these techniques to the simulation of discretized systems of partial differential equations.

97 MATHEMATICS AND COMPUTING↗

Portable C++ Code that can Look and Feel Like Fortran Code with Yet Another Kernel Launcher (YAKL)

This paper introduces the Yet Another Kernel Launcher (YAKL) C++ portability library, which strives to enable user-level code with the look and feel of Fortran code. The intended audience includes both C++ developers and Fortran developers unfamiliar with C++. The C++ portability approach is briefly explained, YAKL’s main features are described, and code examples are given that demonstrate YAKL’s usage. YAKL fills a niche capability important particularly to scientific applications seeking to port Fortran code quickly to a portable C++ library. YAKL places heavy emphasis on simplicity, readability, and productivity with performance mainly emphasizing Graphics Processing Units (GPUs). Central to YAKL’s ability to allow Fortran-like user-level code are three features: (1) a multi-dimensional Array class that allows Fortran behavior; (2) a limited library of Fortran intrinsic functions; and (3) an efficient pool allocator that transparently enables cheap frequent allocations and deallocations of YAKL Arrays. While YAKL allows Fortran-style code, it also allows Arrays that exhibit C-like behavior as well, including row-major index ordering and lower bounds of “0”. YAKL currently supports CPUs, CPU threading, and Nvidia, AMD, and Intel GPUs.

97 MATHEMATICS AND COMPUTING↗

Correct Compilation of Concurrent C Code

The CompCert compiler represents a landmark effort in program verification as both a piece of verified software and as a compiler for verified C programs. A key shortcoming of CompCert however is that it does not support multithreaded programs. Prior work to add threads to CompCert has either required major rewrites of parts of the proof or only works for well synchronized programs. The problem is that CompCert’s backward simulation derives from a forward simulation via the determinism of the semantics of intermediate representation languages. This makes the proofs in CompCert easier but also makes them incompatible with standard models of multithreading which are non-deterministic. Here we propose an alternate formulation of CompCert’s proof structure that parameterizes the existing single threaded semantics with nondeterministic behavior generated at the multithreading level. While this is an old trick where program equivalence is concerned, performing it in the context of CompCert is quite subtle. Our approach allows for expressive concurrent semantics and does not require major proof rewrites but still results in a global backward simulation for multithreaded programs.

97 MATHEMATICS AND COMPUTING↗

Manuscript model outputs, model source code, and figure scripts: The role of geomorphology in mediating biomass allocation impacts on salt-marsh resilience and carbon accumulation

This data package provides model source code (C++), model outputs, and figure generation scripts (R) needed to reproduce the following manuscript: Bruns, Nicholas E., Genevieve L. Noyce, and Matthew L. Kirwan. "The Role of Geomorphology in Mediating Biomass Allocation Impacts on Salt-Marsh Resilience and Carbon Accumulation." Estuarine, Coastal and Shelf Science 327 (December 2025): 109549. https://doi.org/10.1016/j.ecss.2025.109549. This manuscript investigates how geomorphology mediates the impact of biomass allocation shifts on salt marsh persistence and carbon (C) sequestration under sea level rise. We use a 1-D soil-column model (Kirwan and Mudd 2012) to perform experiments across a range of static root:shoot ratios (RSR = 1-4) spanning observed values. The model explicitly simulates interactions between tidal inundation, productivity, inorganic sediment deposition, and organic matter accumulation. Experiments determine whether geomorphic feedbacks amplify, dampen, or leave unchanged the ecosystem response to biomass allocation shifts. A first experiment uses constant sea level rise (2.5 mm/yr) to examine equilibrium dynamics and their influence on carbon accumulation rates across different suspended sediment concentrations (SSC). A second set of experiments calculates threshold sea level rise rates for marsh drowning across RSR and SSC combinations. Final experiments apply accelerating sea level rise scenarios (2000-2200) derived from NOAA projections (Sweet et al. 2022) to generate an envelope of expected responses, quantifying the importance of biomass allocation shifts on marsh carbon accumulation and persistence. All experiments are repeated across SSC ranging from 5-50 mg/L to investigate how these interactions vary in micro-tidal marshes with different sediment supplies. Package contents: * README.txt with detailed description of package contents and instructions for reproducing manuscript figures and model outputs * R scripts for generating all manuscript figures * C++ baseline model code from Kirwan and Mudd (2012) * C++ source code for 4 experimental model variants used in the manuscript, extending above baseline code * Model input files (.csv, .txt) including sea level rise scenarios * Model output files (.txt) used in manuscript analyses Temporal coverage: Model simulations span years 1900-2200, with accelerating sea level rise scenarios for 2000-2200. Key variables: Root:shoot ratio, suspended sediment concentration, carbon accumulation rate, vertical accretion rate, marsh elevation, inundation depth, threshold sea level rise rate.

54 ENVIRONMENTAL SCIENCES↗

CMakePPLang: An object-oriented extension to CMake

CMakePPLang is an object-oriented extension to the CMake language written entirely using the original CMake language, with the goal of making projects built on CMake easier to create and maintain. That said, CMakePPLang has different coding practices, paradigms, and standards than the original CMake language, much in the same way that C++ coding differs from C coding despite some level of interoperability. Currently, CMakePPLang is used within the CMakePP organization as the foundation for two in-progress projects: CMakeTest and CMaize. CMakeTest provides a solution for unit testing CMake and CMakePPLang code. CMaize is a CMake tool to simplify interoperability between projects and writing their build systems.

97 MATHEMATICS AND COMPUTING↗

ROSE Castor

ROSE Castor is a tool enabling automated verification of C++, built off of the ROSE compiler framework and the Why3 framework. Castor defines a verification language for providing specifications of C++ code, letting users perform automated functional formal verification of their C++ code. Castor is designed to target C++17, and supports a subset of the language, including classes, functions, templates, integers and booleans, pointers and references, and single inheritance. Castor currently does not support multiple or virtual inheritance, virtual functions, floating-point, threading, lambda functions, or the C++ STL, though some of these are planned in future updates. Castor ships with an in-house parser for parsing verification conditions.

Lane, PhillipA [Lawrence Livermore National Labora↗

A limit on the total lepton number in the Universe from BBN and the CMB

At temperatures below the QCD phase transition, any substantial lepton number in the Universe can only be present within the neutrino sector. In this work, we systematically explore the impact of a non-vanishing lepton number on Big Bang Nucleosynthesis (BBN) and the Cosmic Microwave Background (CMB). Relying on our recently developed framework based on momentum averaged quantum kinetic equations for the neutrino density matrix, we solve the full BBN reaction network to obtain the abundances of primordial elements. We find that the maximal primordial total lepton number L allowed by BBN and the CMB is -0.12 (-0.10) ≤ L ≤ 0.13 (0.12) for NH (IH), while specific flavor directions can be even more constrained. This bound is complementary to the limits obtained from avoiding baryon overproduction through sphaleron processes at the electroweak phase transition since, although numerically weaker, it applies at lower temperatures and is obtained completely independently. We publicly release the C++ code COFLASY-C on GitHub (https://github.com/mariofnavarro/COFLASY/tree/COFLASY-C) which solves for the evolution of the neutrino quantum kinetic equations numerically.

72 PHYSICS OF ELEMENTARY PARTICLES AND FIELDS↗

Fierro Version 2.x

FIERRO is a parallel C++ code designed to simulate fluid mechanics, heat transfer, and solid mechanics in two- and three-dimensional space. FIERRO is written to run on homogeneous (CPU) and heterogeneous (CPU+GPU) high performance computing machines. Fierro can aid a) modeling and design efforts that have historically relied on commercial implicit and explicit finite element codes, b) numerical methods research, c) manufacturing research, and d) computer science research. The code contains diverse numerical methods to solve the governing physics equations for both quasi-static and dynamic problems. Mathematical optimization solvers are coupled to the numerical methods to research topology and shape optimization that has application to additive manufacturing, and to create novel numerical approaches. Phase-field methods with micromechanical solvers are provided to simulate microstructure formation and evolution in manufacturing processes. The micromechanical solvers can also help research efforts create continuum-scale constitutive models for solids, as a function of the microstructure, in situ in a calculation or in a stand-alone manner. No physical data exists within the code.

Morgan, Nathaniel↗

Fierro

FIERRO is a parallel C++ code designed to simulate fluid mechanics, heat transfer, and solid mechanics in two- and three dimensional space. FIERRO is written to run on homogeneous (CPU) and heterogeneous (CPU+GPU) high performance computing machines. Fierro can aid a) modeling and design efforts that have historically relied on commercial implicit and explicit finite element codes, b) numerical methods research, c) manufacturing research, and d) computer science research. The code contains diverse numerical methods to solve the governing physics equations for both quasi-static and dynamic problems. Mathematical optimization solvers are coupled to the numerical methods to research topology and shape optimization that has application to additive manufacturing, and to create novel numerical approaches. Phase-field methods with micromechanical solvers are provided to simulate microstructure formation and evolution in manufacturing processes. The micromechanical solvers can also help research efforts create continuum-scale constitutive models for solids, as a function of the microstructure, in situ in a calculation or in a stand-alone manner. No physical data exists within the code.

Morgan, Nathaniel↗

Fault-tolerant operation and materials science with neutral atom logical qubits

We report on the fault-tolerant operation of logical qubits on a neutral atom quantum computer, with logical performance surpassing physical performance for multiple circuits including Bell state preparation (12x error reduction), random circuits (15x), and a prototype Anderson Impurity Model ground state solver for materials science applications (up to 6x, non-fault-tolerantly). The logical qubits are implemented via the [[4, 2, 2]] code (C 4 ). Our work constitutes the first complete realization of the benchmarking protocol proposed by Gottesman 2016 demonstrating results consistent with fault tolerance. In light of recent advances on applying concatenated C 4 /C 6 detection codes to achieve error correction with high code rates and thresholds, our work can be regarded as a building block towards a practical scheme for fault tolerant quantum computation. Our demonstration of a materials science application with logical qubits particularly demonstrates the immediate value of these techniques on current experiments.

36 MATERIALS SCIENCE↗

SCEPTRE 2.3 Quick Start Guide

This report provides a summary of notes for building and running the Sandia Computational Engine for Particle Transport for Radiation Effects (SCEPTRE) code. SCEPTRE is a general- purpose C++ code for solving the linear Boltzmann transport equation in serial or parallel using unstructured spatial finite elements, multigroup energy treatment, and a variety of angular treatments including discrete ordinates (Sn) and spherical harmonics (Pn). Either the first-order form of the Boltzmann equation or one of the second-order forms may be solved. SCEPTRE requires a small number of open-source Third Party Libraries (TPL) to be available, and example scripts for building these TPL are provided. The TPL needed by SCEPTRE are Trilinos, Boost, and Netcdf. SCEPTRE uses an autotools build system, and a sample configure script is provided. Running the SCEPTRE code requires that the user provide a spatial finite-elements mesh in Exodus format and a cross section library in a format that will be described. SCEPTRE uses an xml-based input, and several examples will be provided.

73 NUCLEAR PHYSICS AND RADIATION PHYSICS↗

FIERRO V.X

FIERRO is a modern C++ code intended to simulate quasi-static solid mechanics problems and transient, compressible material dynamic problems with Lagrangian methods, which have meshes with constant mass elements that move with the material. FIERRO is designed to aid a) material model research that has historically been done using commercial implicit and explicit finite element codes, b) numerical methods research, and c) computer science research. FIERRO supports user developed material models that adhere to several industry standard formats by using a C++ to Fortran interface to couple the model to the numerical solvers. FIERRO is built on the ELEMENTS library that supports a diverse suite of element types, including high-order elements, and quadrature rules. The mesh class within the ELEMENTS library is designed for efficient calculations on unstructured meshes and to minimize memory usage. FIERRO is designed to readily accommodate a range of numerical methods including continuous finite element, finite volume, and discontinuous Galerkin methods. FIERRO is designed to support explicit and implicit time integration methods. FIERRO only supports a single material in an element. No physical data exists within the code.

Morgan, Nathaniel↗

KLOKKOS: Automated test generation for performance-portable programs

SAND2024-13830O The KLOKKOS project provides a suite of test generation and validation tools to increase maintainability and portability of Kokkos programs. KLOKKOS, a portmanteau of Klee and Kokkos, is developing an automated test generation for performance-portable programs using Clang/low-level virtual machine (LLVM) and formal methods. KLOKKOS is based on several topics in computer science: the development of symbolic and concolic analysis of LLVM and C++ codes, formal semantics and type theory, C++ templates and language features, LLVM compiler infrastructure, and data parallel primitives. Sandia National Laboratories is a multimission laboratory managed and operated by National Technology & Engineering Solutions of Sandia, LLC, a wholly owned subsidiary of Honeywell International Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA0003525

SciDAC↗

Validation of Modern Nuclear Data Processing in SCALE

The nuclear data (ND) community is continuously developing more accurate, diversified, and comprehensive data for radiation transport modeling to support the nuclear science community. As these community efforts progress, it is crucial that ND processing tools like AMPX (used for SCALE [1] ND) also be developed in parallel to incorporate these new data into transport codes and actually deliver those data to end users. AMPX is a mature, well-tested code that was developed by many people at Oak Ridge National Laboratory (ORNL) over the course of the past few decades. A large portion of the AMPX codebase, however, was outdated, difficult to maintain, and incompatible with modern code development tools. Some of the most important parts of the AMPX code have now been replaced with modern C++ code that can be maintained more cost-effectively and can be tested more rigorously.

AMPX↗

Simulating Muon Capture with MARLEY

Core-collapse supernovae are intense sources of tens-of-MeV neutrinos. Each explosion releases about 1058 neutrinos in a burst lasting tens of seconds. As neutrinos are weakly interacting, they escape more easily compared to photons, allowing them to be observed before the light signal. Understanding low-energy neutrino interactions with argon will be critical for future supernova measurements with the Deep Underground Neutrino Experiment (DUNE). Interpreting future DUNE supernova neutrino data will require a high-quality model of O(10 MeV) neutrino interactions, but the dominant charged-current cross section has never been measured at these low energies for an argon target. We exploit the theoretical similarities between muon capture, which has been measured, and antineutrino scattering to test MARLEY (Model of Argon Reaction Low Energy Yields), the simulation code used by DUNE to model supernova neutrino reactions. I implemented C++ code to add a muon capture mode to MARLEY and compared the predictions of the new simulation to measured isotope branching ratios of the residual nuclei. The preliminary branching ratios predicted by MARLEY running in muon capture mode demonstrate promising baseline performance when compared to experimental data and are expected to improve with further model adjustments.

Wong, Baker Louie↗

Strategic Petroleum Reserve Cavern Leaching Monitoring CY24

This report provides an analysis of the effects of raw water leaching at the U.S. SPR using the Sandia Solution Mining Code (SANSMIC). A new version of the code has been established in the past year (implemented in Python and C++ code) and was used for this annual report. Additionally, the setup, running, and post-processing of leaching modeling has now been streamlined into a single Python notebook environment for each cavern run.

58 GEOSCIENCES↗

QSpace - An open-source tensor library for Abelian and non-Abelian symmetries

This is the documentation for the tensor library QSpace (v4.0), a toolbox to exploit ‘quan tum symmetry spaces’ in tensor network states in the quantum many-body context. QSpace permits arbitrary combinations of symmetries including the abelian symmetries $\mathbb{Z}_n$ and U(1), as well as all non-abelian symmetries based on the semisimple classical Lie algebras: A n , B n , C n , and D n , or respectively, the special unitary group SU(n), the odd orthogonal group SO(2n+1), the symplectic group Sp(2n), and the even orthogonal group SO(2n). The code (C++ embedded via the MEX interface into Matlab) is available open source as of QSpace v4.0 on bitbucket under the Apache 2.0 license. QSpace is designed as a bottom-up approach for non-abelian symmetries. It starts from the defining representation and the respective Lie algebra. By explicitly comput ing and tabulating generalized Clebsch-Gordan coefficient tensors, QSpace is versatile in the type of operations that it can perform across all symmetries. At the level of an ap plication, much of the symmetry-related details are hidden within the QSpace C++ core libraries. Hence when developing tensor network algorithms with QSpace, these can be coded (nearly) as if there are no symmetries at all, despite being able to fully exploit general non-abelian symmetries.

75 CONDENSED MATTER PHYSICS, SUPERCONDUCTIVITY AND↗