Performance Optimization (contd.)
Avoid indiscriminate use of BARRIER directive
- Note that parallel loops have implied barriers
- BARRIER synchronizes all threads in the region
Most SPMD synchronization fall under producer consumer relation
- One thread computes result, another thread reads result
- May need to synchronize only between two threads