|
|
|
---
|
|
|
|
title: Profilage de Code
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Code profilers
|
|
|
|
|
|
|
|
In this Wiki, we will provide a methodology to install and run some code profilers. This has been tested on a specific Conda environment.
|
| ... | ... | @@ -99,12 +95,11 @@ make install |
|
|
|
In the TAU folder, activate the `profilers` environment and type
|
|
|
|
|
|
|
|
```
|
|
|
|
./configure -prefix=$PROFILER_PATH/ -pdt=$PROFILER_PATH/ -scorep=$PROFILER_PATH -mpi -c++=g++ -cc=gcc -fortran=gfortran -bfd=$PROFILER_PATH/vendor/libbfd -unwind=$PROFILER_PATH/vendor/libunwind
|
|
|
|
./configure -prefix=$PROFILER_PATH/ -pdt=$PROFILER_PATH/ -scorep=$PROFILER_PATH -mpi -c++=g++ -cc=gcc -fortran=gfortran -bfd=$PROFILER_PATH/vendor/libbfd -unwind=$PROFILER_PATH/vendor/libunwind -useropt="-O2 -I ${BOOST_ROOT}"
|
|
|
|
make install
|
|
|
|
```
|
|
|
|
|
|
|
|
> **CAUTION**
|
|
|
|
> In TAU, each set of compile options generate a specific Makefile that will be used for the profiling. In the above, the generated Makefile will include PDT, Score-P and MPI. To compile a non-MPI program, re-compile TAU without the `-mpi` option
|
|
|
|
> **CAUTION** In TAU, each set of compile options generate a specific Makefile that will be used for the profiling. In the above, the generated Makefile will include PDT, Score-P and MPI. To compile a non-MPI program, re-compile TAU without the `-mpi` option
|
|
|
|
|
|
|
|
### Compilation Scalasca
|
|
|
|
|
| ... | ... | @@ -181,10 +176,10 @@ Here, we specify that loops will be instrumented in all the functions of the pro |
|
|
|
|
|
|
|
Now, to compile the program, replace the standard compile commands as follows:
|
|
|
|
|
|
|
|
- `gcc` -> `tau_cc.sh`
|
|
|
|
- `g++` -> `tau_cxx.sh`
|
|
|
|
- `gfortran` -> `tau_f90.sh`
|
|
|
|
- `f77` -> `tau_f70.sh`
|
|
|
|
- `gcc` -\> `tau_cc.sh`
|
|
|
|
- `g++` -\> `tau_cxx.sh`
|
|
|
|
- `gfortran` -\> `tau_f90.sh`
|
|
|
|
- `f77` -\> `tau_f70.sh`
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
| ... | ... | @@ -204,22 +199,19 @@ A `scorep-` folder will appear containing all the profiling informations. It can |
|
|
|
paraprof scorep-20250310_1624_81500554863145/profile.cubex &
|
|
|
|
```
|
|
|
|
|
|
|
|
> **Note**:
|
|
|
|
> `.cubex` files can also be analysed using the Cube software, available as an App Image [here](https://apps.fz-juelich.de/scalasca/releases/cube/4.8/dist/CubeGUI-4.8.2.AppImage):
|
|
|
|
> `CubeGUI-4.8.2.AppImage scorep-20250310_1624_81500554863145/profile.cubex &`
|
|
|
|
|
|
|
|
> **Note**: `.cubex` files can also be analysed using the Cube software, available as an App Image [here](https://apps.fz-juelich.de/scalasca/releases/cube/4.8/dist/CubeGUI-4.8.2.AppImage): `CubeGUI-4.8.2.AppImage scorep-20250310_1624_81500554863145/profile.cubex &`
|
|
|
|
|
|
|
|
### Profile with Score-P
|
|
|
|
|
|
|
|
To allow profiling with Score-P, replace the standard compile commands as follows:
|
|
|
|
|
|
|
|
- `g++` -> `scorep g++`
|
|
|
|
- `gfortran` -> `scorep gfortran`
|
|
|
|
- `mpicxx` -> `scorep mpicxx`
|
|
|
|
- `mpif90` -> `scorep mpif90`
|
|
|
|
- `gcc` -> `scorep gcc`
|
|
|
|
- `mpicc` -> `scorep mpicc`
|
|
|
|
- `mpif77` -> `scorep mpif77`
|
|
|
|
- `g++` -\> `scorep g++`
|
|
|
|
- `gfortran` -\> `scorep gfortran`
|
|
|
|
- `mpicxx` -\> `scorep mpicxx`
|
|
|
|
- `mpif90` -\> `scorep mpif90`
|
|
|
|
- `gcc` -\> `scorep gcc`
|
|
|
|
- `mpicc` -\> `scorep mpicc`
|
|
|
|
- `mpif77` -\> `scorep mpif77`
|
|
|
|
|
|
|
|
For example
|
|
|
|
|
| ... | ... | @@ -263,21 +255,19 @@ A `scorep-` folder will appear containing all the profiling informations. It can |
|
|
|
paraprof scorep-20250310_1624_81500554863145/profile.cubex &
|
|
|
|
```
|
|
|
|
|
|
|
|
> **Note**:
|
|
|
|
> `.cubex` files can also be analysed using the Cube software, available as an App Image [here](https://apps.fz-juelich.de/scalasca/releases/cube/4.8/dist/CubeGUI-4.8.2.AppImage):
|
|
|
|
> `CubeGUI-4.8.2.AppImage scorep-20250310_1624_81500554863145/profile.cubex &`
|
|
|
|
> **Note**: `.cubex` files can also be analysed using the Cube software, available as an App Image [here](https://apps.fz-juelich.de/scalasca/releases/cube/4.8/dist/CubeGUI-4.8.2.AppImage): `CubeGUI-4.8.2.AppImage scorep-20250310_1624_81500554863145/profile.cubex &`
|
|
|
|
|
|
|
|
### Profile with Scalasca
|
|
|
|
|
|
|
|
To profile a code with Scalasca, you need to compile the code by replacing:
|
|
|
|
|
|
|
|
- `g++` -> `skin g++`
|
|
|
|
- `gfortran` -> `skin gfortran`
|
|
|
|
- `mpicxx` -> `skin mpicxx`
|
|
|
|
- `mpif90` -> `skin mpif90`
|
|
|
|
- `gcc` -> `skin gcc`
|
|
|
|
- `mpicc` -> `skin mpicc`
|
|
|
|
- `mpif77` -> `skin mpif77`
|
|
|
|
- `g++` -\> `skin g++`
|
|
|
|
- `gfortran` -\> `skin gfortran`
|
|
|
|
- `mpicxx` -\> `skin mpicxx`
|
|
|
|
- `mpif90` -\> `skin mpif90`
|
|
|
|
- `gcc` -\> `skin gcc`
|
|
|
|
- `mpicc` -\> `skin mpicc`
|
|
|
|
- `mpif77` -\> `skin mpif77`
|
|
|
|
|
|
|
|
Once your code has been compiled, you can execute it as follows:
|
|
|
|
|
| ... | ... | @@ -292,6 +282,7 @@ scan -t test.exe |
|
|
|
```
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
Resources:
|
|
|
|
|
|
|
|
- https://hpc.cea.fr/tgcc-public/en/html/toc/fulldoc/Profiling.html#
|
| ... | ... | |
| ... | ... | |