[ HPF Home | Versions | Compilers | Projects | Publications | Applications | Benchmarks | Events | Contact ] |
In HPF_CRAFT, the ATOMIC UPDATE directive tells the compiler that a particular data item or the elements of a particular array for a specified operation must be updated atomically. This can be used within loops or in array syntax and applies to both the elements of an array with an assignment of a permutation and the elements of an array within a loop.
In the following example, all references to R(IX(I)) occur atomically, thus eliminating the possibility that different iterations might try to modify the same element concurently.
REAL R(200), S(1000)
INTEGER IX(1000)
!HPF$ DISTRIBUTE R(BLOCK), S(BLOCK), IX(BLOCK)
!HPF$ INDEPENDENT (I) ON S(I)
DO I = 1, 1000
!HPF$ ATOMIC UPDATE
R(IX(I)) = R(IX(I)) + S(I)
END DO
©2000-2006 Rice University | [ Contact Us | HiPerSoft | Computer Science ] |