Open main menu

CDOT Wiki β

Changes

GPU621/False Sharing

786 bytes added, 23:32, 26 November 2021
Analyzing False Sharing
=== Drawbacks ===
While our idea works, there are were several issues that prevent prevented it from being an ideal solution: [[File:padded_implementation.png|600px|thumb|]]
The cache size can vary between machines making the code not very portable.
<br><br><br><br><br><br>
=== Synchronization and Thread Local Variables ===
=== Synchronization ===Thus, we searched for a more elegant solution that avoids race conditions and cache line sharing without resorting to padding. To solve the concurrency issue, we utilized OpenMP's critical construct allowing more direct control over thread execution. To solve cache line sharing, we turned to thread local variables.
We want Originally, we faced an issue where depending on the order of thread execution the program would yield different results. Now by marking a more elegant solution region as a critical section, we can ensure that only one thread can access whatever is inside this region. Other threads must wait until the region becomes unoccupied before it is their turn to execute it. Although the rest of the parallel region can be done in any order, we can guarantee that avoids have race conditions and cache line sharing without resorting pi variable will always be the most up to paddingdate version when a thread enters the critical region.
<pre>
83
edits