Example: Laplace Equation Solver
SOR code for solving Laplace’s equation in 2-d space
Vector version
- Tuned for T90
- All computations well vectorized
“Cache-friendly” version
- Tuned for microprocesors
- Designed for efficient re-use of cached data
- Scalar code
Test problem size: 2001 by 2001
- Data arrays don’t fit in cache
Notes:
- The next example is one that we will follow from single processor performance to MSP performance.
- -It solves Laplace’s equation by means of an over-relaxation method
- -Two versions of the code do exist, one tuned for vector architectures and one for cache based systems. Because the cached base version is designed for data resue, it yields scalar code which does not run well on either the T90 or SV1
- -Due to the large problem size, we would not expect a high cache read hit rate.