Search NASA⌕ Search

SEARCH · Search NASA

Results for “generic programming”

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

Generic Programming in Fortran 202Y

Back in 2018, the Fortran committee began planning new features for what is now expected to be Fortran 2023, "generic programming" was at the top of the list of requests from the user community. Here, generic programming refers to the ability to specify algorithms that are parameterized in terms of deferred _types_ (as opposed to values). Concrete algorithms are subsequently generated when the generic algorithms are "instantiated" with specific types. After significant consideration the language committee decided that the necessary changes to Fortran to support generic programming would be too large and complex to complete within a single release cycle of the standard. Instead, a new "generics" subgroup was formed with myself as the lead, and we were charged with developing generic programming features for the subsequent release _after_ the F2023, internally referred to as Fortran 202Y. I.e, the new subgroup was provided the luxury of developing the new capabilities across two full release cycles of the standard. This talk will describe the current approach to generics being pursued by the subgroup as well as the current status halfway through the development cycle. I will conclude with some motivating examples implemented with notional syntax.

Fortran↗

Type-Safe Generic Programming in Fortran

When the Fortran language committee first collected requests for new language features for what has now become the Fortran 2023 standard, support for generic programming emerged as a top priority. However, due to the anticipated complexity, a dedicated committee subgroup was formed, and implementation of generic programming was purposely spread across two language release cycles -- aiming for what is internally referred to as F202Y. In this talk, I will begin with a brief overview of existing Fortran features that support generic programming and then proceed to a detailed examination of the plans for F202Y. This discussion will include motivating use cases, type-safe design goals, (probable) syntax, and a few simple examples. I conclude with a discussion on the likely limitations of generic programming in F202Y and my expectations for extended capabilities in the subsequent release, F203X.

Tom Clune↗

NASA Aerospace Flight Battery Program: Generic Safety, Handling and Qualification Guidelines for Lithium-Ion (Li-Ion) Batteries; Availability of Source Materials for Lithium-Ion (Li-Ion) Batteries; Maintaining Technical Communications Related to Aerospace Batteries (NASA Aerospace Battery Workshop)

This NASA Aerospace Flight Battery Systems Working Group was chartered within the NASA Engineering and Safety Center (NESC). The Battery Working Group was tasked to complete tasks and to propose proactive work to address battery related, agency-wide issues on an annual basis. In its first year of operation, this proactive program addressed various aspects of the validation and verification of aerospace battery systems for NASA missions. Studies were performed, issues were discussed and in many cases, test programs were executed to generate recommendations and guidelines to reduce risk associated with various aspects of implementing battery technology in the aerospace industry. This document contains Part 1 - Volume I: Generic Safety, Handling and Qualification Guidelines for Lithium-Ion (Li-Ion) Batteries, Availability of Source Materials for Lithium-Ion (Li-Ion) Batteries, and Maintaining Technical Communications Related to Aerospace Batteries (NASA Aerospace Battery Workshop).

Manzo, Michelle A.↗

NASA Aerospace Flight Battery Program: Generic Safety, Handling and Qualification Guidelines for Lithium-Ion (Li-Ion) Batteries; Availability of Source Materials for Lithium-Ion (Li-Ion) Batteries; Maintaining Technical Communications Related to Aerospace Batteries (NASA Aerospace Battery Workshop)

This NASA Aerospace Flight Battery Systems Working Group was chartered within the NASA Engineering and Safety Center (NESC). The Battery Working Group was tasked to complete tasks and to propose proactive work to address battery related, agency-wide issues on an annual basis. In its first year of operation, this proactive program addressed various aspects of the validation and verification of aerospace battery systems for NASA missions. Studies were performed, issues were discussed and in many cases, test programs were executed to generate recommendations and guidelines to reduce risk associated with various aspects of implementing battery technology in the aerospace industry. This report contains the Appendices to the findings from the first year of the program's operations.

Manzo, Michelle A.↗

Aspect-Oriented Programming

Computer science has experienced an evolution in programming languages and systems from the crude assembly and machine codes of the earliest computers through concepts such as formula translation, procedural programming, structured programming, functional programming, logic programming, and programming with abstract data types. Each of these steps in programming technology has advanced our ability to achieve clear separation of concerns at the source code level. Currently, the dominant programming paradigm is object-oriented programming - the idea that one builds a software system by decomposing a problem into objects and then writing the code of those objects. Such objects abstract together behavior and data into a single conceptual and physical entity. Object-orientation is reflected in the entire spectrum of current software development methodologies and tools - we have OO methodologies, analysis and design tools, and OO programming languages. Writing complex applications such as graphical user interfaces, operating systems, and distributed applications while maintaining comprehensible source code has been made possible with OOP. Success at developing simpler systems leads to aspirations for greater complexity. Object orientation is a clever idea, but has certain limitations. We are now seeing that many requirements do not decompose neatly into behavior centered on a single locus. Object technology has difficulty localizing concerns invoking global constraints and pandemic behaviors, appropriately segregating concerns, and applying domain-specific knowledge. Post-object programming (POP) mechanisms that look to increase the expressiveness of the OO paradigm are a fertile arena for current research. Examples of POP technologies include domain-specific languages, generative programming, generic programming, constraint languages, reflection and metaprogramming, feature-oriented development, views/viewpoints, and asynchronous message brokering. (Czarneclu and Eisenecker s book includes a good survey of many of these technologies).

Elrad, Tzilla↗

Towards Generic Parallel Programming in Computer Science Education with Kokkos

Parallel patterns, views, and spaces are promising abstractions to capture the programmer's intent as well as the contextual information that can be used by an underlying runtime to efficiently map software to parallel hardware. These abstractions can be valuable in cases where an algorithm must accommodate requirements of code and performance portability across hardware architectures and vendor programming models. Kokkos is a parallel programming model for host- and accelerator architectures that relies on these abstractions and targets these requirements. It consists of a pure C++ interface, a specification, and a programming library. The programming library exposes patterns and types and maps them to an underlying abstract machine model. The abstract machine model offers a generic view of parallel hardware. While Kokkos is gaining popularity in large-scale HPC applications at some DOE laboratories, we believe that the implemented concepts are of interest to a broader audience including academia as they may contribute to a generic, vendor, and architecture-independent education of parallel programming. In this work, we give an insight into the design considerations of this programming model and list important abstractions. Further, we document best practices obtained from giving virtual classes on Kokkos and give pointers to resources that the reader may consider valuable for a lecture on generic parallel programming for students with preexisting knowledge on this matter.

Ciesko, Jan↗

Program Generators for Exascale and Beyond (Final Technical Report)

The major goals of this project were to devise programming models and supporting tools that simplify the construction of specialized high‐performance generators, leading to improvements over the state of the art along the various dimensions of portability, performance, and productivity. In particular, the project achieved these goals by focusing on domain‐specific languages (DSLs) as intermediate layers in a translation and optimization framework, on composability of program generators, on re‐targeting legacy code, and on fundamental methodologies such as stage polymorphism or "generic programming in time".

97 MATHEMATICS AND COMPUTING↗

C++ Programming Language

C++ Programming Language: The C++ seminar covers the fundamentals of C++ programming language. The C++ fundamentals are grouped into three parts where each part includes both concept and programming examples aimed at for hands-on practice. The first part covers the functional aspect of C++ programming language with emphasis on function parameters and efficient memory utilization. The second part covers the essential framework of C++ programming language, the object-oriented aspects. Information necessary to evaluate various features of object-oriented programming; including encapsulation, polymorphism and inheritance will be discussed. The last part of the seminar covers template and generic programming. Examples include both user defined and standard templates.

Shaykhian, Gholam Ali↗

FLIT: A Generic Fortran Library based on Interfaces and Templates

This Fortran code consists of multiple modules with a focus on simplifying array operations, image processing, and numerical computation especially for computational geophysics applications. We intend to use this code to demonstrate the application and usefulness of Fortran interface and templates for generic programming, especially for computational geophysics and seismology applications. The code has several notable features. Firstly, it is based on a modularized structure, where each module contains multiple functions but with a focus of functionality. Secondly, it heavily uses interfaces and templates for improving the genericness and convenience of the resulting code, where a same function interface can enclose a group of functions that perform the same functionality but with inputs/output variables of different data types. Thirdly, it includes a variety of generic functions with an emphasis on array operations, such as rotation, flipping, cropping, padding, fast Fourier transform, Gaussian blurring, interpolation, and so on. We name this package FLIP – a generic Fortran Library based on Interfaces and Templates.

Gao, Kai↗

NWGraph: A Library of Generic Graph Algorithms and Data Structures in C++20

The C++ Standard Library is a valuable collection of generic algorithms and data structures that improves the usability and reliability of C++ software. Graph algorithms and data structures are notably absent from the standard library, and previous attempts to fill this gap have not gained widespread adoption. In this paper we show that the richness of graph algorithms and data structures can in fact be captured by straightforward composition of existing C++ mechanisms. Generic programming is algorithm-oriented. Accordingly, we apply a systematic approach to analyzing a broad set of graph algorithms, “lift” unnecessary constraints from them, and organize the resulting set of minimal common type requirements, i.e., concepts, for defining their interfaces. By using the newly available ranges and concepts in C++20, the type requirements for generic graph algorithms can be succinctly expressed. The generic algorithms and data structures resulting from our analysis are realized in NWGraph, in a modern, composable, and extensible C++ library.

graphs and networks, programming language, C++20↗

An Ada Linear-Algebra Software Package Modeled After HAL/S

New avionics software written more easily. Software package extends Ada programming language to include linear-algebra capabilities similar to those of HAL/S programming language. Designed for such avionics applications as Space Station flight software. In addition to built-in functions of HAL/S, package incorporates quaternion functions used in Space Shuttle and Galileo projects and routines from LINPAK solving systems of equations involving general square matrices. Contains two generic programs: one for floating-point computations and one for integer computations. Written on IBM/AT personal computer running under PC DOS, v.3.1.

Klumpp, Allan R.↗

Reference Models for Structural Technology Assessment and Weight Estimation

Previously the Exploration Concepts Branch of NASA Langley Research Center has developed techniques for automating the preliminary design level of launch vehicle airframe structural analysis for purposes of enhancing historical regression based mass estimating relationships. This past work was useful and greatly reduced design time, however its application area was very narrow in terms of being able to handle a large variety in structural and vehicle general arrangement alternatives. Implementation of the analysis approach presented herein also incorporates some newly developed computer programs. Loft is a program developed to create analysis meshes and simultaneously define structural element design regions. A simple component defining ASCII file is read by Loft to begin the design process. HSLoad is a Visual Basic implementation of the HyperSizer Application Programming Interface, which automates the structural element design process. Details of these two programs and their use are explained in this paper. A feature which falls naturally out of the above analysis paradigm is the concept of "reference models". The flexibility of the FEA based JAVA processing procedures and associated process control classes coupled with the general utility of Loft and HSLoad make it possible to create generic program template files for analysis of components ranging from something as simple as a stiffened flat panel, to curved panels, fuselage and cryogenic tank components, flight control surfaces, wings, through full air and space vehicle general arrangements.

Cerro, Jeff↗

KokkACC: Enhancing Kokkos with OpenACC

Template metaprogramming is gaining popularity as a high-level solution for achieving performance portability on heterogeneous computing resources. Kokkos is a representative approach that offers programmers high-level abstractions for generic programming while most of the device-specific code generation and optimizations are delegated to the compiler through template specializations. For this, Kokkos provides a set of device-specific code specializations in multiple back ends, such as CUDA and HIP. Unlike CUDA or HIP, OpenACC is a high-level and directive-based programming model. This descriptive model allows developers to insert hints (pragmas) into their code that help the compiler to parallelize the code. The compiler is responsible for the transformation of the code, which is completely transparent to the programmer. This paper presents an OpenACC back end for Kokkos: KokkACC. As an alternative to Kokkos’s existing device-specific back ends, KokkACC is a multi-architecture back end providing a high-productivity programming environment enabled by OpenACC’s high-level and descriptive programming model. Moreover, we have observed competitive performance; in some cases, KokkACC is faster (up to 9×) than NVIDIA’s CUDA back end and much faster than OpenMP’s GPU offloading back end. This work also includes implementation details and a detailed performance study conducted with a set of mini-benchmarks (AXPY and DOT product) and three mini-apps (LULESH, miniFE and SNAP, a LAMMPS proxy mini-app).

Valero Lara, Pedro↗

Generic Discretization Library

The GenDiL library is a collection of C++ software abstractions designed to discretize and solve partial differential equations (PDEs) for high-performance computing (HPC) applications. Its primary focus is on modern C++ generic programming, which helps ensure portability across various hardware architectures. The central idea behind the library is to provide building blocks for numerical algorithms-such as discretization methods and iteration patterns-so that domain experts can focus on the math, rather than the low-level details of hardware or implementation. By defining abstractions for data types, iteration over computational grids, and scheduling of operations, the library isolates the high-level PDE algorithms from the platform-specific optimizations needed to achieve efficient performance.

Dudouit, Yohann [Lawrence Livermore National Labor↗

StructuredFuzzer: Fuzzing Structured Text-Based Control Logic Applications

Rigorous testing methods are essential for ensuring the security and reliability of industrial controller software. Fuzzing, a technique that automatically discovers software bugs, has also proven effective in finding software vulnerabilities. Unsurprisingly, fuzzing has been applied to a wide range of platforms, including programmable logic controllers (PLCs). However, current approaches, such as coverage-guided evolutionary fuzzing implemented in the popular fuzzer American Fuzzy Lop Plus Plus (AFL++), are often inadequate for finding logical errors and bugs in PLC control logic applications. They primarily target generic programming languages like C/C++, Java, and Python, and do not consider the unique characteristics and behaviors of PLCs, which are often programmed using specialized programming languages like Structured Text (ST). Furthermore, these fuzzers are ill suited to deal with complex input structures encapsulated in ST, as they are not specifically designed to generate appropriate input sequences. This renders the application of traditional fuzzing techniques less efficient on these platforms. To address this issue, this paper presents a fuzzing framework designed explicitly for PLC software to discover logic bugs in applications written in ST specified by the IEC 61131-3 standard. The proposed framework incorporates a custom-tailored PLC runtime and a fuzzer designed for the purpose. We demonstrate its effectiveness by fuzzing a collection of ST programs that were crafted for evaluation purposes. We compare the performance against a popular fuzzer, namely, AFL++. The proposed fuzzing framework demonstrated its capabilities in our experiments, successfully detecting logic bugs in the tested PLC control logic applications written in ST. On average, it was at least 83 times faster than AFL++, and in certain cases, for example, it was more than 23,000 times faster.

47 OTHER INSTRUMENTATION↗

Dynamic analysis of a system of hinge-connected rigid bodies with nonrigid appendages

Equations of motion are derived for use in simulating a spacecraft or other complex electromechanical system amenable to idealization as a set of hinge-connected rigid bodies of tree topology, with rigid axisymmetric rotors and nonrigid appendages attached to each rigid body in the set. In conjunction with a previously published report on finite-element appendage vibration equations, this report provides a complete minimum-dimension formulation suitable for generic programming for digital computer numerical integration.

Likins, P. W.↗