12.07.2015 Views

Cache Usage Tutorial - MGNet

Cache Usage Tutorial - MGNet

Cache Usage Tutorial - MGNet

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Aliasing (cont’d)Example:subroutine sub(n, a, b, c, sum)double precision sum, a(n), b(n), c(n)sum= 0d0do i= 1,na(i)= b(i) + 2.0d0*c(i)enddoreturnendFORTRAN rule: two variables cannot be aliased, when one or bothof them are modified in the subroutineCorrect call: call sub(n,a,b,c,sum)Incorrect call: call sub(n,a,a,c,sum)Prof. Craig C. DouglasUniversity of Kentucky andYale UniversityHiPC2003, 12/17/2003 vHPC <strong>Cache</strong> Aware Methods 73

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!