This shows you the differences between two versions of the page.
asc:laboratoare:10 [2024/05/14 17:33] emil.slusanschi |
asc:laboratoare:10 [2025/05/14 17:02] (current) alexandru.bala [1. Valgrind / KCachegrind] |
||
---|---|---|---|
Line 18: | Line 18: | ||
* **callgrind**. It is an extension to cachegrind and provides all the information that the latter offers, plus extra information regarding call graphs. In order to view the results, a visualization tool called KCachegrind [3] can be used; | * **callgrind**. It is an extension to cachegrind and provides all the information that the latter offers, plus extra information regarding call graphs. In order to view the results, a visualization tool called KCachegrind [3] can be used; | ||
* **massif**. It is a heap profiler and it performs detailed heap profiling by taking regular snapshots of a program's heap and produces a graph showing heap usage over time, including information about which parts of the program are responsible for the most memory allocations. Massif runs programs about 20x slower than normal; | * **massif**. It is a heap profiler and it performs detailed heap profiling by taking regular snapshots of a program's heap and produces a graph showing heap usage over time, including information about which parts of the program are responsible for the most memory allocations. Massif runs programs about 20x slower than normal; | ||
- | * **hellgrind** and drd. These tools are thread debuggers which find data races in multithreaded programs. They look for memory locations which are accessed by more than one (POSIX) pthread, but for which no consistently used (pthread_mutex_) lock can be found; | + | * **helgrind** and drd. These tools are thread debuggers which find data races in multithreaded programs. They look for memory locations which are accessed by more than one (POSIX) pthread, but for which no consistently used (pthread_mutex_) lock can be found; |
* other 3rd party tools can be found here [4]. | * other 3rd party tools can be found here [4]. | ||
Line 40: | Line 40: | ||
{{ :asc:lab6:image09.png?300 |}} | {{ :asc:lab6:image09.png?300 |}} | ||
- | Pentru a rula si observa functionalitatile acestei unelte urmariti urmatoarea secventa de pasi si indicatiile: | + | To run and observe the functionalities of this tool, follow the following sequence of steps and instructions: |
<code sh> | <code sh> | ||
wget -O tachyon_vtune_amp_xe.tgz http://ocw.cs.pub.ro/courses/_media/asc/lab6/tachyon_vtune_amp_xe.tgz | wget -O tachyon_vtune_amp_xe.tgz http://ocw.cs.pub.ro/courses/_media/asc/lab6/tachyon_vtune_amp_xe.tgz | ||
Line 102: | Line 102: | ||
- ''wget https://ocw.cs.pub.ro/courses/_media/asc/lab6/lab6_skl.tar.gz -O lab6_skl.tar.gz'' - Downloadati arhiva laboratorului | - ''wget https://ocw.cs.pub.ro/courses/_media/asc/lab6/lab6_skl.tar.gz -O lab6_skl.tar.gz'' - Downloadati arhiva laboratorului | ||
- ''tar -xzvf lab6_skl.tar.gz'' - dezarhivati arhiva downloadata mai sus | - ''tar -xzvf lab6_skl.tar.gz'' - dezarhivati arhiva downloadata mai sus | ||
- | - ''%%srun --x11 -p nehalem --pty /bin/bash%%'' - conectati-va pe coada Nehalem cu 14 servere | + | - ''%%srun --time 00:05:00 --x11 -p haswell --pty /bin/bash%%'' - conectati-va pe coada Haswell cu 14 servere |
- ''%%apptainer run docker://gitlab.cs.pub.ro:5050/asc/asc-public/c-labs:1.3.1 /bin/bash%%'' - accesati imaginea de docker in cadrul căreia avem permisiunile necesare realizării laboratorului | - ''%%apptainer run docker://gitlab.cs.pub.ro:5050/asc/asc-public/c-labs:1.3.1 /bin/bash%%'' - accesati imaginea de docker in cadrul căreia avem permisiunile necesare realizării laboratorului | ||
Line 109: | Line 109: | ||
* ''make openmp_task0'' pentru versiunea paralelizata | * ''make openmp_task0'' pentru versiunea paralelizata | ||
* <code sh> | * <code sh> | ||
- | [@fep ]$ srun --x11 -p nehalem --pty /bin/bash | + | [@fep ]$ srun --time 00:05:00 --x11 -p haswell --pty /bin/bash |
- | [@nehalem-wnxx ~]$ apptainer run docker://gitlab.cs.pub.ro:5050/asc/asc-public/c-labs:1.3.1 /bin/bash | + | [@haswell-wnxx ~]$ apptainer run docker://gitlab.cs.pub.ro:5050/asc/asc-public/c-labs:1.3.1 /bin/bash |
Apptainer> make task0 | Apptainer> make task0 | ||
Apptainer> valgrind --tool=callgrind -v --dump-every-bb=10000000 ./task0 | Apptainer> valgrind --tool=callgrind -v --dump-every-bb=10000000 ./task0 | ||
Line 126: | Line 126: | ||
* <code sh> | * <code sh> | ||
[@fep ~]$ ./task1.sh | [@fep ~]$ ./task1.sh | ||
- | [@fep ]$ srun --x11 -p nehalem --pty /bin/bash | + | [@fep ]$ srun --time 00:05:00 --x11 -p haswell --pty /bin/bash |
- | [@nehalem-wn01 ~]$ apptainer run docker://gitlab.cs.pub.ro:5050/asc/asc-public/c-labs:1.3.1 /bin/bash | + | [@haswell-wn01 ~]$ apptainer run docker://gitlab.cs.pub.ro:5050/asc/asc-public/c-labs:1.3.1 /bin/bash |
Apptainer> cd tachyon | Apptainer> cd tachyon | ||
Apptainer> valgrind --tool=callgrind --collect-jumps=yes --dump-instr=yes --collect-systime=yes -- ./tachyon_find_hotspots dat/balls.dat | Apptainer> valgrind --tool=callgrind --collect-jumps=yes --dump-instr=yes --collect-systime=yes -- ./tachyon_find_hotspots dat/balls.dat | ||
Line 139: | Line 139: | ||
* Notati observatiile voastre legate de numarul de I refs, D refs, D1 misses, branches si mispredicts. | * Notati observatiile voastre legate de numarul de I refs, D refs, D1 misses, branches si mispredicts. | ||
* <code sh> | * <code sh> | ||
- | [@fep ]$ srun --x11 -p nehalem --pty /bin/bash | + | [@fep ]$ srun --time 00:05:00 --x11 -p haswell --pty /bin/bash |
- | [@nehalem-wn01 ~]$ apptainer run docker://gitlab.cs.pub.ro:5050/asc/asc-public/c-labs:1.3.1 /bin/bash | + | [@haswell-wn01 ~]$ apptainer run docker://gitlab.cs.pub.ro:5050/asc/asc-public/c-labs:1.3.1 /bin/bash |
Apptainer> make task2 | Apptainer> make task2 | ||
Apptainer> valgrind --tool=cachegrind --branch-sim=yes ./task2 1 | Apptainer> valgrind --tool=cachegrind --branch-sim=yes ./task2 1 |