Parallel Code Generation via Self-Scheduling Task Regions
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing code generation tools fail to effectively convert sequential source code into parallel representations that can leverage multi-core computer architectures, limiting the potential for parallel execution and performance enhancement.
Innovation Solution
The development of tools and techniques that abstract and restructure existing source code into higher-level representations, identify parallel regions, and insert self-scheduling code to enable parallel execution, using methods such as control flow graphs and hierarchical task graphs to generate parallel object code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If existing code generation tools are used to translate sequential source code, then the code can be compiled and executed, but the code cannot effectively leverage parallel execution capabilities and multi-core architectures
Solution Approach 1:
The patent segments the source code into distinct regions that can be executed in parallel. The system identifies and separates independent code regions, assigning them to different threads or tasks that can run concurrently on multi-core processors, thereby transforming sequential code into parallel-executable code while maintaining the original functionality.
Solution Approach 2:
The patent introduces a temporal dimension to code execution by enabling parallel time periods for different code regions. Instead of executing code regions in a single sequential timeline, the system allows multiple code regions to execute simultaneously in overlapping or completely parallel time periods, effectively adding a time parallelism dimension to the execution model.
2Productivity
If parallel code is generated from sequential source code, then performance on multi-core systems is improved, but the complexity of code generation and transformation increases
Solution Approach 1:
The patent performs preliminary analysis of the source code to identify parallelizable regions before actual parallel code generation. The system pre-processes the sequential code to detect independent execution regions, data dependencies, and potential parallelization opportunities, creating a structured representation that guides subsequent parallel code generation and reduces overall transformation complexity.
Solution Approach 2:
The patent introduces an intermediate representation layer between the source code and the final parallel executable. This intermediate form captures the parallel execution structure, task dependencies, and scheduling information, serving as a mediator that simplifies the complex transformation from sequential source code to parallel machine code while maintaining clarity and manageability.
3Productivity
If self-scheduling code is inserted to enable parallel execution, then regions can run in parallel as tasks, but the modified code structure becomes more complex
Solution Approach 1:
The patent creates a universal self-scheduling code structure that can be applied to multiple different code regions and parallelization scenarios. The generated self-scheduling code serves multiple functions: it creates tasks, manages dependencies, handles synchronization, and coordinates parallel execution across different code regions, providing a multi-functional framework that reduces the need for separate handling mechanisms.
Data Source
AI summary
A generated grouped representation of existing source code can define regions of the existing source code. A set of the regions that can run in parallel can be identified based on the grouped representation. The grouped representation can be converted into a modified representation, such as modified source code or a modified intermediate compiler representation, which can be configured to be resolved or executed to self-schedule the set of regions to run in parallel as a set of tasks. Additionally, the source code can include one or more exception handling routines, and user input can be received to identify in one or more lambda expressions one or more regions of the source code to be run in parallel as one or more tasks.


