Dynamic Code Region Extraction for HPC Compilation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current software analysis and optimization processes in High Performance Computing (HPC) environments are inefficient, requiring time-consuming trial-and-error methods, especially when dealing with code modifications across different machines and hardware architectures, as programmers need to repeatedly compile and test code on various machines, leading to inefficiencies and lack of interactive modification capabilities.
Innovation Solution
A method that annotates specific code regions with compiler directives, allowing for remote compilation and dynamic loading of modified code across multiple target machines, enabling concurrent execution and comparison of results, reducing the need for full program recompilation and facilitating interactive modification and optimization.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Manufacturing precision
If the programmer manually compiles and tests code on each target machine, then the code can be optimized for specific hardware architectures, but the time and effort required for code optimization and testing increases significantly
Solution Approach 1:
The patent extracts a specific region of code from the full program and places it in a separate file that can be independently compiled and tested. This extraction allows the programmer to focus optimization efforts on only the critical code region rather than the entire program, significantly reducing compilation and testing time while maintaining optimization precision for the extracted region
Solution Approach 2:
The patent segments the code into an extracted region (in a separate file) and the remaining program. This segmentation enables independent compilation of the extracted region on different target machines, allowing parallel testing and optimization across multiple architectures without requiring full program recompilation each time
2Productivity
If the programmer modifies the extracted code and triggers re-compilation, then the modified code can be tested on target machines, but the full program must be recompiled which increases processing time
Solution Approach 1:
By extracting the code region to a separate file, the patent enables independent compilation of only the modified region rather than the entire program. When the programmer modifies the extracted code, only that specific file needs to be recompiled and the results tested on target machines, dramatically reducing re-compilation time while maintaining full productivity for code modification
Solution Approach 2:
The patent performs preliminary extraction of the code region before modification and testing. This preliminary action creates a standalone file that is pre-configured for independent compilation, so that subsequent modifications only require recompiling the extracted region rather than the entire program, saving significant time in the modification cycle
3Adaptability or versatility
If the code is compiled on each target machine, then the code can be adapted to different hardware architectures, but the complexity of managing multiple compilations and synchronizing changes increases
Solution Approach 1:
The patent introduces a server as an intermediary that manages the extracted code files and coordinates compilation across multiple target machines. The server stores the extracted code regions and facilitates distribution to client machines, automatically handling synchronization when modifications are made. This intermediary approach maintains hardware architecture adaptability while significantly reducing the complexity of managing multiple compilations and synchronizing changes across the development team
Data Source
Figure 1
Figure 2a
Figure 2b
AI summary
A computer-implemented method for comparing the results on a plurality of target machines of modification of a region of original code, the method comprising: at a local machine, annotating a region of original code in a program for extraction with a compiler directive; distributing the program from the local machine to the target machines; at each target machine, compiling code including the original code and the compiler directive, generating executable code in the form of extracted code and instrumented code for each target machine, wherein the compiler directive causes the annotated region of the original code to be extracted to generate the extracted code, which is linked to a function call at a position in the original code from which the extracted region was extracted; modifying the extracted code at the local machine and sending the modification to the target machines, the modification triggering re-compilation of the modified extracted code at each target machine; at each target machine, generating a new executable version of the extracted code for dynamic loading into the instrumented code; and at each target machine, executing the instrumented code and dynamically loading and executing the new executable version of the extracted code and sending the results to the local machine, where the results are received and displayed for comparison.