Making legacy Fortran code type safe through automated program transformation

被引:4
|
作者
Vanderbauwhede, Wim [1 ]
机构
[1] Univ Glasgow, Sch Comp Sci, Glasgow, Lanark, Scotland
来源
JOURNAL OF SUPERCOMPUTING | 2022年 / 78卷 / 02期
基金
英国工程与自然科学研究理事会;
关键词
Fortran; Type safety; Type system; Program transformation; Acceleration; ABSTRACT-DATA-TYPES; FORMAL SPECIFICATION; IMPLEMENTATION;
D O I
10.1007/s11227-021-03839-9
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
Fortran is still widely used in scientific computing, and a very large corpus of legacy as well as new code is written in FORTRAN 77. In general this code is not type safe, so that incorrect programs can compile without errors. In this paper, we present a formal approach to ensure type safety of legacy Fortran code through automated program transformation. The objective of this work is to reduce programming errors by guaranteeing type safety. We present the first rigorous analysis of the type safety of FORTRAN 77 and the novel program transformation and type checking algorithms required to convert FORTRAN 77 subroutines and functions into pure, side-effect free subroutines and functions in Fortran 90. We have implemented these algorithms in a source-to-source compiler which type checks and automatically transforms the legacy code. We show that the resulting code is type safe and that the pure, side-effect free and referentially transparent subroutines can readily be offloaded to accelerators.
引用
收藏
页码:2988 / 3028
页数:41
相关论文
共 14 条
  • [1] Making legacy Fortran code type safe through automated program transformation
    Wim Vanderbauwhede
    The Journal of Supercomputing, 2022, 78 : 2988 - 3028
  • [2] CCured: Type-safe retrofitting of legacy code
    Necula, GC
    McPeak, S
    Weimer, W
    ACM SIGPLAN NOTICES, 2002, 37 (01) : 128 - 139
  • [3] CCured: Type-Safe Retrofitting of Legacy Code
    Necula, George C.
    McPeak, Scott
    Weimer, Westley
    ACM SIGPLAN NOTICES, 2012, 47 (04) : 74 - 85
  • [4] Towards automated code parallelization through program comprehension
    Martino, B.Di.
    Iannello, G.
    Program Comprehension, Workshop Proceedings, 1994, : 108 - 115
  • [5] Migrating Legacy Fortran to Python']Python While Retaining Fortran-Level Performance Through Transpilation and Type Hints
    Bysiek, Mateusz
    Drozd, Aleksandr
    Matsuoka, Satoshi
    PROCEEDINGS OF PYHPC2016: 6TH WORKSHOP ON PYTHON FOR HIGH-PERFORMANCE AND SCIENTIFIC COMPUTING, 2016, : 9 - 18
  • [6] DLFix: Context-based Code Transformation Automated Program Repair
    Li, Yi
    Wang, Shaohua
    Nguyen, Tien N.
    2020 ACM/IEEE 42ND INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2020), 2020, : 602 - 614
  • [7] Code understanding through program transformation for reusable component identification
    Yang, HJ
    Luker, P
    Chu, WC
    FIFTH INTERNATIONAL WORKSHOP ON PROGRAM COMPREHENSION - IWPC '97, PROCEEDINGS, 1997, : 148 - 157
  • [8] NEW EMPIRICAL AUTOMATED MMPI INTERPRETIVE PROGRAM - 1-2/2-1 CODE TYPE
    GYNTHER, MD
    ALTMAN, H
    WARBIN, RW
    SLETTEN, IW
    JOURNAL OF CLINICAL PSYCHOLOGY, 1973, 29 (01) : 54 - 57
  • [9] NEW EMPIRICAL AUTOMATED MMPI INTERPRETIVE PROGRAM - 6-8/8-6 CODE TYPE
    ALTMAN, H
    WARBIN, RW
    SLETTEN, IW
    GYNTHER, MD
    JOURNAL OF CLINICAL PSYCHOLOGY, 1972, 28 (04) : 495 - &
  • [10] NEW EMPIRICAL AUTOMATED MMPI INTERPRETIVE PROGRAM - 6-9/9-6 CODE TYPE
    GYNTHER, MD
    ALTMAN, H
    WARBIN, RW
    JOURNAL OF CLINICAL PSYCHOLOGY, 1973, 29 (01) : 60 - 61