Two-Stage Cobol Compilation for Parallel Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current Cobol compilers lack support for parallelization techniques like OpenMP, limiting the performance improvement of Cobol programs, which are often run on single-thread processes, despite the potential benefits of using multiple processors or computing cores.
Innovation Solution
A two-step compilation approach is implemented, where a first compiler translates the Cobol program into an intermediate form suitable for parallelization, and a second compiler generates an executable that supports multiple threads using OpenMP directives, enabling parallel processing without requiring direct OpenMP support in the Cobol compiler.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If a single-threaded Cobol compiler is used, then the compiler structure remains simple and maintenance is easier, but the execution speed and processing performance are limited
Solution Approach 1:
The compilation process is divided into two distinct stages: a Cobol-to-intermediate language translation stage, and a separate compilation stage that generates parallel executable code. This segmentation allows each stage to be optimized independently, with the first stage focusing on translation and the second stage on generating efficient parallel code, thereby improving execution speed without overly complicating the overall system
Solution Approach 2:
An intermediate language is introduced as a mediator between Cobol source code and the final executable. This intermediate representation allows the incorporation of parallelization directives and OpenMP annotations without requiring direct modification of the Cobol compiler itself, enabling performance improvement while maintaining relative simplicity in the compilation architecture
2Productivity
If parallelization support is added to the Cobol compiler, then execution performance improves, but development and maintenance costs increase
Solution Approach 1:
The intermediate language serves as a buffer that allows parallelization features to be added without directly modifying the Cobol compiler. By translating Cobol to an intermediate form first, then compiling with parallelization support, the system gains performance benefits while avoiding the high costs of developing and maintaining a fully integrated parallel Cobol compiler
Solution Approach 2:
The intermediate language is designed to be multi-functional, serving both as a translation target for Cobol and as a source for generating parallel executables with OpenMP support. This universality allows a single intermediate representation to fulfill multiple purposes, reducing the need for separate specialized compilers and thereby lowering development and maintenance costs
3Speed
If multiple threads are utilized, then execution speed doubles or triples, but the complexity of managing thread synchronization and data sharing increases
Solution Approach 1:
The intermediate language acts as a structured intermediary that provides a clear framework for expressing parallelization intent through standardized OpenMP directives. This structured approach to thread management in the intermediate representation simplifies the complexity of multi-threaded programming by providing explicit syntax for synchronization, data sharing, and parallel region delimitation
Solution Approach 2:
The system transforms the single-threaded execution model into a multi-threaded model by introducing parallelization parameters and directives in the intermediate language. By changing the execution paradigm at the intermediate representation level rather than at the source code level, the system achieves speedup while managing thread complexity through standardized parameters and constructs
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A method and apparatus is disclosed for compilation of an original Cobol program and building an executable program with support for improved performance by increased parallelism during execution using multiple threads of processing. The approach includes a compilation (or translation) step utilizing a first compiler or translating program which is a parallel aware translating first compiler. The parallel aware first compiler is a specialized compiler / translator which takes as input a Cobol source program, and produces as output an intermediate program in a second computer programming language, the intermediate program including parallelization directives. The intermediate program is intended for further compilation utilizing an existing second compiler, the second compiler providing support for parallelism and programs in the second computer programming language. The approach optionally allows for the use of pragmas serving as parallelization directives to the compiler in the original Cobol program and/or in the intermediate program.