# vtune toturial
- [vtune_introduce](/rIpekqpKQ0alzhl1-4msXg)
### Vtune Download
- [Vtune_下載](/dur5YZkDQgSy-fLL673aAw)
- [Vtune_GUI](/lBIwH6SrTXGX1UoMu71sAQ)
- [Vtune_helpful](/CFvaFJFdQrSWtkgMznpYvg)
### optimize simulation
- [simulation (sequential/multi-threaed): matrix_multiplication](/86TAg1FpQQqImutlfGCyhw)
<!--
note: 需要把 compiler load 才能運行。
### result_interpretation
- [vtune_結果閱讀_performance-snapshot](/4Y3bBXeeRfy6aAIWp_yX1g)
-
- [vtune_結果閱讀_hotspots](/4HY1_51eRzWqQlRLwGhT-g)
- [vtune_結果閱讀_memory-consumption](/PyU6YXMwQ-qme9MvqxaX6g)
- [vtune_結果閱讀_uarch-exploration](/bBDZFkh4SvOhElGR-0MnYw)
- [vtune_結果閱讀_memory-access](/SDZ4VRWjSeepjvlCkh-4Xw)
- [vtune_結果閱讀_threading](/QUVKyv6yRSi0_u_d1-dXEw)
- [vtune_結果閱讀_hpc-performance](/iCTOk40jSxiMjR-iF8PmLg)
- [vtune_結果閱讀_io](/BpbbibQZRT25AmHZ7bxNew)
- [vtune_結果閱讀_system-overview](/mTlYaCyzSqWXLwbgQ9gYQg)
### chatGPT_slice
- [chatGPT_microarchitecture](/ERaGVqphQUeDr4qOWKGq4Q)
- [chatGPT_E-core_vs_P-core](/5lBKLyRjRU-UiavzGhZrfA)
- [chatGPT_cpu_front_end_vs_back_end](/6emf3aYVRjWzBcBHM_l-Cw)
- [chatGPT_openMP](/wwSY3O1bQ3miwXkfrqtCEA)
### matrix_multiplication_code
- [v1_cachemiss.c](/evO9w4ciRSCuuEG_cJcpsw)
- [v2_loop.c](/MQRFw7hDRoudlZ6SQyDvpA)
- [v3_omp.c](/gddJQ4tBSrWCoLu-4EVs_g)
- [v4_tiled.c](/0zRqe6pmS7-wYee-kO-giQ)
- [v5_cuda.c](/0QRo8H_3TeyYAB6DWP19EA)
- [compile_run.sh](/5ZlFTyHMRGO4RwqWou2gBA)
- [run_result_ref](/hulocnlERgOpRXDJYdoMyw)
- [vtune_run.sh](/Mtlc7MVWQayJz2XKnqDvGg)
- [gen_mf.sh](/4vfhOcdmStG-8_rFgKE4XQ)
-->
asd
<!--
## 以 openmx 為例 - 使用 Vtune 和 aps
openmx 是一數學建模套件。
:::warning
此篇教學並不包含 openmx 的編譯教學,但應該適用於其他的 mpi 程式。
:::
### vtune
比較在單機器上,使用 shm (shared memory) 和 tcp 網路模型的差別。
```
vtune -collect hotspots -r vtune_result/methane_tcp \
-- mpirun -np 4 -ppn 1 -genv FI_PROVIDER tcp ./openmx Methane.dat
vtune -collect hotspots -r vtune_result/methane_shm \
-- mpirun -np 4 -genv FI_PROVIDER shm ./openmx Methane.dat
```
### 結果 : 十分接近

### aps
aps 全稱為 Intel Application Performance Snapshot,用於 MPI 以及 openMP 程序性能快照。
```
mpirun -np 4 aps ./openmx Methane.dat
```
在輸出的末尾會提供一串類似於以下的指令來查看結果。
```
aps --report /media/hlajungo/D/linux/opt/installScript/openmx-3.9.9/openmx3.9/work/aps_result_20250121_d0c00100-0142-2c5b-392c-0600ec2cb311
```

## 以 openmx 為例 - 能夠收集的資料 fast overview
### 查看可收集的目標
```
vtune -help collect
```
```
performance-snapshot
hotspots
memory-consumption
uarch-exploration
memory-access
threading
hpc-performance
io
system-overview
```
### 結果 - 每個收集目標
```
vtune -collect performance-snapshot -r vtune_result/methane_performance-snapshot \
-- mpirun -np 4 -ppn 1 ./openmx Methane.dat
```
快速的檢測,提供下一步檢測的目標。

```
vtune -collect hotspots -r vtune_result/methane_hotspots \
-- mpirun -np 4 -ppn 1 ./openmx Methane.dat
```
總體使用時間,代碼層面以及函數層面的使用時間,邏輯cpu平行化等級。

```
vtune -collect memory-consumption -r vtune_result/methane_memory-consumption \
-- mpirun -np 4 -ppn 1 ./openmx Methane.dat
```
函數層級的記憶體使用量

```
vtune -collect uarch-exploration -r vtune_result/methane_uarch-exploration \
-- mpirun -np 4 -ppn 1 ./openmx Methane.dat
```
函數層級的精細的 cpu 使用狀況

```
vtune -collect memory-access -r vtune_result/methane_memory-access \
-- mpirun -np 4 -ppn 1 ./openmx Methane.dat
```
記憶體存取, cache miss, numa 系統

```
vtune -collect threading -r vtune_result/methane_threading \
-- mpirun -np 4 -ppn 1 ./openmx Methane.dat
```
這個似乎有點問題,先行跳過。
```
vtune -collect hpc-performance -r vtune_result/methane_hpc-performance \
-- mpirun -np 4 -ppn 1 ./openmx Methane.dat
```
高性能運算檢測

```
vtune -collect io -r vtune_result/methane_io \
-- mpirun -np 4 -ppn 1 ./openmx Methane.dat
```
帶寬使用

```
vtune -collect system-overview -r vtune_result/methane_system-overview \
-- mpirun -np 4 -ppn 1 ./openmx Methane.dat
```
檢測cpu使用量, 帶寬

-->
{"title":"vtune toturial","description":"#Intel C++ Compiler (icx)#Intel Fortran Compiler (ifx)#Data Parallel C++ Compiler (dpc++)#Intel Math Kernel Library (MKL)#Intel Integrated Performance Primitives (IPP)#Intel Threading Building Blocks (TBB)#VTune Profiler#Advisor#Debugger#Python Distribution(優化過的 Intel Python)","contributors":"[{\"id\":\"ef76cbf4-dcda-4e4e-a6de-7d30ded912a1\",\"add\":26340,\"del\":20784}]"}