Table of Contents
Advances in Software Engineering
Volume 2014, Article ID 917327, 23 pages
http://dx.doi.org/10.1155/2014/917327
Research Article

SPOT: A DSL for Extending Fortran Programs with Metaprogramming

Department of Computer Science, University of Alabama, Tuscaloosa, AL 35401, USA

Received 8 July 2014; Revised 27 October 2014; Accepted 12 November 2014; Published 17 December 2014

Academic Editor: Robert J. Walker

Copyright © 2014 Songqing Yue and Jeff Gray. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Abstract

Metaprogramming has shown much promise for improving the quality of software by offering programming language techniques to address issues of modularity, reusability, maintainability, and extensibility. Thus far, the power of metaprogramming has not been explored deeply in the area of high performance computing (HPC). There is a vast body of legacy code written in Fortran running throughout the HPC community. In order to facilitate software maintenance and evolution in HPC systems, we introduce a DSL that can be used to perform source-to-source translation of Fortran programs by providing a higher level of abstraction for specifying program transformations. The underlying transformations are actually carried out through a metaobject protocol (MOP) and a code generator is responsible for translating a SPOT program to the corresponding MOP code. The design focus of the framework is to automate program transformations through techniques of code generation, so that developers only need to specify desired transformations while being oblivious to the details about how the transformations are performed. The paper provides a general motivation for the approach and explains its design and implementation. In addition, this paper presents case studies that illustrate the potential of our approach to improve code modularity, maintainability, and productivity.