-
14
pages
-
English
-
Documents
Description
Performance Optimization TutorialLabsEx ercise 1These exercises are intended to provide you with a general feeling about some of the issues involved in writing high performance code, both on a single processor and on a parallel machine.To start, login in to the Origin 20 0 0 , pagh.wes.hpc.milCopy the exercises over to your area.% cp -rf ~london/hpcug_lab .% cd hpcug_lab/matmul1 -fThe first exercise will use a simple matrix-matrix inner product multiplication to demonstrate various optimization techniques.Matrix-Matrix Multiplication - Simple Optimization by Cache ReusePurpose: This exercise is intended to show how the reuse of data that has been loaded into cache by some previous instruction can save time and thus increase the performance of your code.Information: Perform the matrix multiplication A = A + B * C using the code segment below as a template and ordering the ijk loops in to the following orders (ijk, jki, kij, and kji ). In the file matmul.f, one ordering has been provided for you (ijk), as well as a high performance BLA S routine dgemm which does double precision general matrix multiplication. dgemm and other routines can be obtained from Netlib.The variables in the matmul routine ( reproduced on the next page) are chosen for compatibility with the BLA S routines and have the following meanings: the variables ii, jj, kk, reflect the sizes of the matrix A (ii by jj), B(ii by kk) and C(kk by jj); the variables lda, ldb and ldc ...
-
Publié par
-
Langue
English