my_digital_garden/4a1s/CP/PL - Aula 3.md

22 lines
554 B
Markdown
Raw Normal View History

2023-09-27 11:11:52 +01:00
## Ex. 1
### a)
2023-09-27 11:31:52 +01:00
Spacial locality -(constant) proximity of memory spaces relative to a reference memory space
2023-09-27 11:11:52 +01:00
2023-09-27 11:31:52 +01:00
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.
2023-09-27 11:11:52 +01:00
### b)
2023-09-27 11:21:52 +01:00
cache size = 25600 KB
2023-09-27 11:31:52 +01:00
cache line/alignment= 64 B
2023-09-27 11:41:52 +01:00
double -> 8
2023-09-27 11:31:52 +01:00
2023-09-27 11:41:52 +01:00
(64/8) = 8 elements
2023-09-27 11:31:52 +01:00
2023-09-27 11:41:52 +01:00
**Estimation of misses:**
- matrix C: n² / 8
- matrix A: n²
>[!info]- Commands ran
>nano /proc/cpuinfo
>srun --partition=cpar perf cat /proc/cpuinfo
2023-09-27 11:21:52 +01:00
### c)