Abstract

Abstract data types developed for computational science and engineering are frequently modeled after physical objects whose state variables must satisfy governing differential equations. Generalizing the associated algebraic and differential operators to operate on the abstract data types facilitates high-level program constructs that mimic standard mathematical notation. For non-trivial expressions, multiple object instantiations must occur to hold intermediate results during the expression's evaluation. When the dimension of each object's state space is not specified at compile-time, the programmer becomes responsible for dynamically allocating and de-allocating memory for each instantiation. With the advent of allocatable components in Fortran 2003 derived types, the potential exists for these intermediate results to occupy a substantial fraction of a program's footprint in memory. This issue becomes particularly acute at the highest levels of abstraction where coarse-grained data structures predominate. This paper proposes a set of rules for de-allocating memory that has been dynamically allocated for intermediate results in derived type calculus, while distinguishing that memory from more persistent objects. The new rules are applied to the design of a polymorphic time integrator for integrating evolution equations governing dynamical systems. Associated issues of efficiency and design robustness are discussed.

Highlights

  • A central activity in object-oriented software design involves constructing abstract data types (ADTs) appropriate for a given application domain

  • Since the addition of dynamic memory management to Fortran lagged that of many other popular languages, there has been less time for such algorithms and idioms to be promulgated

  • Given the havoc pointers potentially wreak on optimizing compilers and the resulting performance penalty, this mechanism offered limited utility for the class of computational science and engineering (CS&E) programs in which long loops over fine-grained data objects form the dominant activity

Read more

Summary

Introduction

A central activity in object-oriented software design involves constructing abstract data types (ADTs) appropriate for a given application domain. Given the havoc pointers potentially wreak on optimizing compilers and the resulting performance penalty, this mechanism offered limited utility for the class of CS&E programs in which long loops over fine-grained data objects form the dominant activity (cf [15]) This deficiency was recognized soon after the publication of the Fortran 95 standard, and the standards committee promised in a 1998 technical report to include allocatable components in derived types in its standard [10]. Due to its importance for CS&E applications, compiler vendors began providing this feature in advance of the publication of the Fortran 2003 standard (cf [17]), albeit without adding what Metcalfe, Reid and Cohen [13] indicate was one of the primary motivations for its inclusion: facilitating automatic de-allocation of memory allocated to hold intermediate results in derived type arithmetic.

Physics
Numerical algorithms
Software architecture
Derived type calculus
Memory de-allocation rules
Efficiency and robustness
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call