12.07.2015 Views

The Hierarchically Tiled Arrays Programming Approach

The Hierarchically Tiled Arrays Programming Approach

The Hierarchically Tiled Arrays Programming Approach

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table 1: Lines of code in 4 different implementations of each benchmarkBenchmark smv cannon jacobi summa lu ep mg ft cgMATLAB 6 1 31 1 1 136 1202 114 192HTA 9 18 41 24 24 168 1500 157 203C/FORTRAN 100 14 48 14 33 205 1542 261 263MPI 176 189 364 261 342 242 2443 491 612for i= 1, nprowblocksize = n/nprowFORALL (j=1:nprow, k=1:npcol)j_b = (j-1)*blocksize + 1j_e = j_b + blocksize - 1k_b = (k-1)*blocksize + 1k_e = k_b + blocksize - 1c( j_b:j_e, k_b:k_e) = c( j_b:j_e, k_b:k_e) + &matmul(a(j_b:j_e, k_b:k_e), b(j_b:j_e, k_b:k_e))ENDFORALLa = cshift( a, blocksize, 2 )b = cshift( b, blocksize, 1 )enddoFigure 17: HPF - Main loop in Cannon’s algorithm.region R = [1..n, 1..n];direction north = [-1, 0]; south = [ 1, 0];east = [ 0, 1]; west = [ 0,-1];[R] repeatTemp := (A@north+A@east+A@west+A@south) / 4.0;err := max

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

Saved successfully!

Ooh no, something went wrong!