23 lines
676 B
Markdown
23 lines
676 B
Markdown
## Ex. 1
|
|
### a)
|
|
Spacial locality -(constant) proximity of memory spaces relative to a reference memory space
|
|
|
|
Logically following the multiplication process of matrices, C and A have spacial locality (while B does not, due to advancing in columns and not rows). Matrix C also has temporal locality.
|
|
### b)
|
|
cache size = 25600 KB
|
|
cache line/alignment= 64 B
|
|
double -> 8
|
|
|
|
(64/8) = 8 elements
|
|
|
|
**Estimation of misses:**
|
|
- matrix C: n² / 8
|
|
- matrix B: n³
|
|
- matrix A: n³ / 8
|
|
|
|
>[!info] The difference in being divided by 8 or not comes from the spacial locality of the matrix.
|
|
|
|
>[!info]- Commands ran
|
|
>nano /proc/cpuinfo
|
|
>srun --partition=cpar perf cat /proc/cpuinfo
|
|
### c)
|