Compiler Collectivity Analysis for UPC Barrier Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The runtime performance of Unified Parallel C (UPC) programs is impacted by the execution of barrier statements, as existing technologies require checking each barrier invocation to ensure consistency across threads, leading to unnecessary runtime overhead.
Innovation Solution
A compiler determines whether a named barrier is matched across all threads and replaces it with an unnamed barrier, leveraging collectivity analysis to prove that all threads execute the same number of barrier invocations, thereby eliminating the need for diagnostic checks and reducing processing resources.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If named barriers are used in UPC programs to ensure synchronous execution across threads, then execution correctness is maintained, but runtime overhead increases due to diagnostic checks
Solution Approach 1:
The compiler performs collectivity analysis during compilation to determine in advance whether all threads execute the same barrier invocations. This preliminary analysis allows the compiler to eliminate unnecessary diagnostic checks at runtime, resolving the contradiction by preparing optimization information before execution.
Solution Approach 2:
The invention replaces named barriers with unnamed barriers when collectivity is proven. The unnamed barrier is a simplified copy that eliminates the naming overhead and diagnostic message generation, while maintaining the same synchronization function, thus reducing runtime overhead without sacrificing correctness.
2Reliability
If diagnostic checks are performed on each barrier invocation to ensure consistency, then execution safety is maintained, but processing resources are consumed
Solution Approach 1:
The compiler performs collectivity analysis during the compilation phase to determine whether all threads execute identical barrier invocations. This preliminary determination allows the elimination of runtime diagnostic checks, transferring the verification work to compilation time when processing resources are more efficiently utilized.
Solution Approach 2:
The invention extracts the barrier optimization opportunity from runtime execution and moves it to compile time through collectivity analysis. By separating the verification function from the barrier execution, the diagnostic checks are eliminated at runtime while maintaining execution safety through compiler-generated optimizations.
3Reliability
If named barriers with diagnostic messages are used, then thread synchronization correctness is verified, but computing efficiency decreases
Solution Approach 1:
The compiler performs collectivity analysis during compilation to preliminarily determine whether all threads execute the same barrier invocations. This advance determination allows the replacement of named barriers with optimized unnamed barriers, eliminating diagnostic message overhead and improving computing efficiency while preserving synchronization correctness.
Solution Approach 2:
The invention uses unnamed barriers as simplified copies of named barriers when collectivity is proven. These copied barriers maintain the essential synchronization function while eliminating the diagnostic message generation and naming overhead, thus improving computing efficiency without compromising synchronization correctness.
Data Source
AI summary
An embodiment is directed to determining, by a compiler, that a call to a named barrier is matched across all of a plurality of threads, and based at least in part on determining that the call to the named barrier is matched across all of the plurality of threads, replacing, by the compiler, the named barrier with an unnamed barrier.


