Data Dependence Detection Using Signature Slots
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Dynamic data-dependence profiling in programs faces significant memory and time overhead, with existing methods either increasing time overhead or compromising accuracy and detailed information.
Innovation Solution
The method employs read and write signatures, represented as arrays with hash functions, to map memory addresses and record data dependences, distinguishing between local and global variables, and using control regions to reduce memory usage without increasing time overhead or losing accuracy.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If traditional dynamic data-dependence profiling is used to resolve memory addresses and data dependences at runtime, then accuracy of dependence detection is improved, but memory overhead increases significantly
Solution Approach 1:
The patent segments the shadow memory into fixed-size slots that are reused across different variables and time periods. Instead of maintaining separate status for every memory location throughout execution, the system divides the monitoring space into discrete, reusable slots that are allocated and released as variables enter and exit their scope, significantly reducing peak memory requirements while maintaining detection accuracy.
Solution Approach 2:
The patent implements dynamic slot allocation and release based on variable lifetime. Slots are allocated when a variable is first accessed and released when the variable goes out of scope or is no longer needed. This dynamic management allows the same slots to be reused for different variables at different times, reducing the total number of slots needed compared to static allocation schemes.
2Productivity
If sampling is used to record only some memory accesses, then time overhead is reduced, but accuracy of dependence detection deteriorates
Solution Approach 1:
The patent maintains continuous monitoring of all memory accesses through the signature-based shadow memory system, ensuring no dependence information is lost. The continuous update of read and write signatures for each accessed variable ensures complete coverage of data flows, eliminating the accuracy loss inherent in sampling approaches while managing time overhead through efficient slot reuse.
Solution Approach 2:
The patent changes the parameter of memory representation from full address tracking to signature-based slot indexing. By transforming memory addresses into hash-based slot indices and using compact signature fields to represent variable states, the system reduces the computational overhead of tracking and comparing memory accesses while maintaining complete dependence information.
3Productivity
If critical path recording is used instead of detailed pair-wise data dependences, then time overhead is reduced, but detailed dependence information is lost
Solution Approach 1:
The patent creates a simplified copy of the memory state through signature slots that capture essential dependence information without replicating the full complexity of pair-wise dependence tracking. The signature slots contain condensed representations of read and write operations that preserve sufficient information for parallelization analysis while requiring less processing time than complete pair-wise tracking.
4Productivity
If static data-dependence analysis is performed at compile time, then time overhead during runtime is reduced, but accuracy deteriorates due to inability to handle pointers and dynamic allocation
Solution Approach 1:
The patent performs preliminary setup of the shadow memory structure and slot allocation at compile time or program initialization, similar to static analysis. However, it combines this with runtime execution of the dependence tracking logic, allowing the system to benefit from both compile-time preparation and runtime accuracy for handling pointers and dynamic allocation.
Data Source
Figure 1
Figure 2
Figure 3~4
AI summary
A method of determining at least one data dependence within a program is presented. The method comprises the steps of: - determining at least one control region within the program; - executing the program; - determine a type of data dependence by means of the steps of o detecting a first variable within a first control region; o assigning a first slot of a read signature (120) and a corresponding first slot of a write signature (110) to the first variable; o determining a first line number of a first program line of a first memory access (132, 134, 136, 138, 201, 202, 203) of the program, wherein the first memory access (132, 134, 136, 138, 201, 202, 203) being related to the first variable; o checking whether the first memory access (132, 134, 136, 138, 201, 202, 203) is a read operation or a write operation; o determining the type of data dependence based on records being recorded in the first slot of the read signature (120) or the first slot of the write signature (110) and the result of the check of the first memory access (132, 134, 136, 138, 201, 202, 203); - recording in a memory device (830) whether the type of data dependence is a read-after-write dependence, write-after-read dependence or write-after-write dependence; - updating the read signature (120) or the write signature (110) in accordance with the result of the check of the first memory access (132, 134, 136, 138, 201, 202, 203); - determining whether the first variable is a first local variable being assigned to the first control region; - releasing the first slot of the read signature (120) and the corresponding first slot of the write signature (110) assigned to the first variable if the first variable is the first local variable if an end of the first control region is passed during execution of the program. Furthermore a corresponding data-dependence detection device (800) and computer program product are presented.