Engineering PapersSearch

NASA NTRS · 20220010683

Generic Programming in Fortran 202Y

Abstract

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.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Thomas Clune. Generic Programming in Fortran 202Y. https://ntrs.nasa.gov/citations/20220010683

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related reports

Position Paper - pFLogger: The Parallel Fortran Logging framework for HPC Applications

In the context of high performance computing (HPC), software investments in support of text-based diagnostics, which monitor a running application, are typically limited compared to those for other types of IO. Examples of such diagnostics include reiteration of configuration parameters, progress indicators, simple metrics (e.g., mass conservation, convergence of solvers, etc.), and timers. To some degree, this difference in priority is justifiable as other forms of output are the primary products of a scientific model and, due to their large data volume, much more likely to be a significant performance concern. In contrast, text-based diagnostic content is generally not shared beyond the individual or group running an application and is most often used to troubleshoot when something goes wrong. We suggest that a more systematic approach enabled by a logging facility (or logger) similar to those routinely used by many communities would provide significant value to complex scientific applications. In the context of high-performance computing, an appropriate logger would provide specialized support for distributed and shared-memory parallelism and have low performance overhead. In this paper, we present our prototype implementation of pFlogger a parallel Fortran-based logging framework, and assess its suitability for use in a complex scientific application.

Fortran

Coarrars for Parallel Processing

The design of the Coarray feature of Fortran 2008 was guided by answering the question "What is the smallest change required to convert Fortran to a robust and efficient parallel language." Two fundamental issues that any parallel programming model must address are work distribution and data distribution. In order to coordinate work distribution and data distribution, methods for communication and synchronization must be provided. Although originally designed for Fortran, the Coarray paradigm has stimulated development in other languages. X10, Chapel, UPC, Titanium, and class libraries being developed for C++ have the same conceptual framework.

Fortran