| ... | @@ -43,9 +43,9 @@ mv libbfd.a libsframe.a save |
... | @@ -43,9 +43,9 @@ mv libbfd.a libsframe.a save |
|
|
|
|
|
|
|
**This trick allows to avoid the use of the Conda `BFD` library and will force the use of the Score-P and Tau BFD downloaded libraries**
|
|
**This trick allows to avoid the use of the Conda `BFD` library and will force the use of the Score-P and Tau BFD downloaded libraries**
|
|
|
|
|
|
|
|
## Compilation
|
|
## Install
|
|
|
|
|
|
|
|
### Compilation Score-P
|
|
### Install Score-P
|
|
|
|
|
|
|
|
Compilation of Score-P only works with GNU compilers.
|
|
Compilation of Score-P only works with GNU compilers.
|
|
|
|
|
|
| ... | @@ -85,7 +85,7 @@ make |
... | @@ -85,7 +85,7 @@ make |
|
|
make install
|
|
make install
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### Compilation Tau/Salt
|
|
### Install PDT/Salt/Tau
|
|
|
|
|
|
|
|
To allow for source instrumentation using Tau, we need to use the clang compilers. Therefore, we will need do define some variables:
|
|
To allow for source instrumentation using Tau, we need to use the clang compilers. Therefore, we will need do define some variables:
|
|
|
|
|
|
| ... | @@ -115,7 +115,7 @@ export PATH=$PROFILER_PATH_TAU/bin:$PATH |
... | @@ -115,7 +115,7 @@ export PATH=$PROFILER_PATH_TAU/bin:$PATH |
|
|
export PATH=$PROFILER_PATH_TAU/x86_64/bin/:$PATH
|
|
export PATH=$PROFILER_PATH_TAU/x86_64/bin/:$PATH
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
#### Compilation PDT
|
|
#### Install PDT
|
|
|
|
|
|
|
|
In order to install the PDT source instrumentation tool, go to the PDT folder and type the following:
|
|
In order to install the PDT source instrumentation tool, go to the PDT folder and type the following:
|
|
|
|
|
|
| ... | @@ -125,7 +125,7 @@ make |
... | @@ -125,7 +125,7 @@ make |
|
|
make install
|
|
make install
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
#### Compilation Salt
|
|
#### Install Salt
|
|
|
|
|
|
|
|
In order to install the Salt source instrumentation tool, go to the Salt folder and type the following:
|
|
In order to install the Salt source instrumentation tool, go to the Salt folder and type the following:
|
|
|
|
|
|
| ... | @@ -135,7 +135,7 @@ cmake -Wdev -Wdeprecated -S . -B $PROFILER_PATH_TAU -D CMAKE_C_COMPILER=clang -D |
... | @@ -135,7 +135,7 @@ cmake -Wdev -Wdeprecated -S . -B $PROFILER_PATH_TAU -D CMAKE_C_COMPILER=clang -D |
|
|
cmake --build $PROFILER_PATH_TAU --parallel # Add --verbose to debug something going wrong
|
|
cmake --build $PROFILER_PATH_TAU --parallel # Add --verbose to debug something going wrong
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
#### Compilation Tau
|
|
#### Install Tau
|
|
|
|
|
|
|
|
When the variables are defined, go to the Tau folder and type:
|
|
When the variables are defined, go to the Tau folder and type:
|
|
|
|
|
|
| ... | @@ -160,7 +160,7 @@ make install |
... | @@ -160,7 +160,7 @@ 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
|
|
### Install Scalasca
|
|
|
|
|
|
|
|
Go to your Scalasca folder and type:
|
|
Go to your Scalasca folder and type:
|
|
|
|
|
|
| ... | @@ -193,13 +193,13 @@ export PATH=$PROFILER_PATH_SCOREP/x86_64/bin/:$PATH |
... | @@ -193,13 +193,13 @@ export PATH=$PROFILER_PATH_SCOREP/x86_64/bin/:$PATH |
|
|
|
|
|
|
|
To allow profiling with Score-P, replace the standard compile commands as follows:
|
|
To allow profiling with Score-P, replace the standard compile commands as follows:
|
|
|
|
|
|
|
|
- `g++` -\> `scorep g++`
|
|
- `g++` -\> `scorep-g++`
|
|
|
- `gfortran` -\> `scorep gfortran`
|
|
- `gfortran` -\> `scorep gfortran`
|
|
|
- `mpicxx` -\> `scorep mpicxx`
|
|
- `mpicxx` -\> `scorep-mpicxx`
|
|
|
- `mpif90` -\> `scorep mpif90`
|
|
- `mpif90` -\> `scorep-mpif90`
|
|
|
- `gcc` -\> `scorep gcc`
|
|
- `gcc` -\> `scorep-gcc`
|
|
|
- `mpicc` -\> `scorep mpicc`
|
|
- `mpicc` -\> `scorep-mpicc`
|
|
|
- `mpif77` -\> `scorep mpif77`
|
|
- `mpif77` -\> `scorep-mpif77`
|
|
|
|
|
|
|
|
For example
|
|
For example
|
|
|
|
|
|
| ... | @@ -211,8 +211,8 @@ As with TAU, the user can also control which part of the code will be profiled. |
... | @@ -211,8 +211,8 @@ As with TAU, the user can also control which part of the code will be profiled. |
|
|
|
|
|
|
|
```
|
|
```
|
|
|
SCOREP_FILE_NAMES_BEGIN # This is a comment
|
|
SCOREP_FILE_NAMES_BEGIN # This is a comment
|
|
|
EXCLUDE */filtering/filter*
|
|
|
|
|
INCLUDE */filter_test.c
|
|
INCLUDE */filter_test.c
|
|
|
|
EXCLUDE */filtering/filter*
|
|
|
SCOREP_FILE_NAMES_END
|
|
SCOREP_FILE_NAMES_END
|
|
|
|
|
|
|
|
SCOREP_REGION_NAMES_BEGIN
|
|
SCOREP_REGION_NAMES_BEGIN
|
| ... | @@ -223,7 +223,7 @@ SCOREP_REGION_NAMES_BEGIN |
... | @@ -223,7 +223,7 @@ SCOREP_REGION_NAMES_BEGIN |
|
|
SCOREP_REGION_NAMES_END
|
|
SCOREP_REGION_NAMES_END
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
The next step is to export the `SCOREP_FILTERING_FILE` environment variable and point to the `scorep.filt` file:
|
|
The next step is to export the `SCOREP_FILTERING_FILE` (for runtime filtering) or `SCOREP_WRAPPER_INSTRUMENTER_FLAGS` (for compile-time filtering) environment variable and point to the `scorep.filt` file:
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
# For runtime filtering
|
|
# For runtime filtering
|
| ... | @@ -233,12 +233,13 @@ export SCOREP_FILTERING_FILE=/path/to/scorep.filt |
... | @@ -233,12 +233,13 @@ export SCOREP_FILTERING_FILE=/path/to/scorep.filt |
|
|
export SCOREP_WRAPPER_INSTRUMENTER_FLAGS="--instrument-filter=scorep.filt"
|
|
export SCOREP_WRAPPER_INSTRUMENTER_FLAGS="--instrument-filter=scorep.filt"
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
With this variable defined, the user can recompile the code.
|
|
With these variables defined, the user can recompile the code using the `scorep` wrappers.
|
|
|
|
|
|
|
|
The next step is to run your code:
|
|
The next step is to run your code:
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
./test.exe
|
|
./test.exe
|
|
|
|
mpirun -n 4 ./test.exe
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
A `scorep-` folder will appear containing all the profiling informations. It can be opened by using the `paraprof` tool as follows:
|
|
A `scorep-` folder will appear containing all the profiling informations. It can be opened by using the `paraprof` tool as follows:
|
| ... | @@ -253,12 +254,11 @@ paraprof scorep-20250310_1624_81500554863145/profile.cubex & |
... | @@ -253,12 +254,11 @@ paraprof scorep-20250310_1624_81500554863145/profile.cubex & |
|
|
|
|
|
|
|
You can add manual instrumentation within a code. For instance:
|
|
You can add manual instrumentation within a code. For instance:
|
|
|
|
|
|
|
|
```
|
|
```c++
|
|
|
#ifdef SCOREP
|
|
#ifdef SCOREP
|
|
|
#include <scorep/SCOREP_User.h>
|
|
#include <scorep/SCOREP_User.h>
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
using namespace std;
|
|
|
|
|
|
|
|
void toto() {
|
|
void toto() {
|
| ... | @@ -313,7 +313,7 @@ export PATH=$PROFILER_PATH_TAU/bin:$PATH |
... | @@ -313,7 +313,7 @@ export PATH=$PROFILER_PATH_TAU/bin:$PATH |
|
|
export PATH=$PROFILER_PATH_TAU/x86_64/bin/:$PATH
|
|
export PATH=$PROFILER_PATH_TAU/x86_64/bin/:$PATH
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
#### Profiling with compiler instrumentation
|
|
#### Compiler instrumentation
|
|
|
|
|
|
|
|
To profile with compiler instrumentation, you first need to define the `Makefile` that you will use and which has been generated by the compilation of TAU. For example:
|
|
To profile with compiler instrumentation, you first need to define the `Makefile` that you will use and which has been generated by the compilation of TAU. For example:
|
|
|
|
|
|
| ... | @@ -327,9 +327,16 @@ You also need to define a set of options to insure that compiler instrumentation |
... | @@ -327,9 +327,16 @@ You also need to define a set of options to insure that compiler instrumentation |
|
|
export TAU_OPTIONS='-optKeepFiles -optVerbose -optCompInst'
|
|
export TAU_OPTIONS='-optKeepFiles -optVerbose -optCompInst'
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
Now, to compile the program, replace the standard compile commands as follows:
|
|
|
|
|
|
|
|
- `gcc` and `mpicc`-\> `tau_cc.sh`
|
|
|
|
- `g++` and `mpic++`-\> `tau_cxx.sh`
|
|
|
|
- `gfortran` and `mpifort`-\> `tau_f90.sh`
|
|
|
|
- `f77` and `mpif77`-\> `tau_f70.sh`
|
|
|
|
|
|
|
#### Profiling with source instrumentation
|
|
#### Profiling with source instrumentation
|
|
|
|
|
|
|
|
To profile using source instrumentation with Tau, you need to specify the `Makefile` that you will use and which has been generated by the# compilation of TAU. For example:
|
|
To profile using source instrumentation with Tau, you need to specify the `Makefile` that you will use and which has been generated by the compilation of TAU. For example:
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
export TAU_MAKEFILE=$PROFILER_PATH/x86_64/lib/Makefile.tau-clang-mpi
|
|
export TAU_MAKEFILE=$PROFILER_PATH/x86_64/lib/Makefile.tau-clang-mpi
|
| ... | @@ -343,7 +350,7 @@ To compile a code by using the Salt parser, you also need to provide the followi |
... | @@ -343,7 +350,7 @@ To compile a code by using the Salt parser, you also need to provide the followi |
|
|
export TAU_OPTIONS='-optKeepFiles -optVerbose -optTauSelectFile="select.tau" -optSaltParser="saltfm" -optSaltInst'
|
|
export TAU_OPTIONS='-optKeepFiles -optVerbose -optTauSelectFile="select.tau" -optSaltParser="saltfm" -optSaltInst'
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
In the above, the `-optKeepFiles` allows to keep intermediate files. The `-optTauSelectFile` specifies the file where additional profiling options are provided. These options are provided in a `select.tau` file (see below)
|
|
In the above, the `-optKeepFiles` allows to keep intermediate files. The `-optTauSelectFile` specifies the file where additional profiling options are provided. These options are provided in a `select.tau` file (see below). **Note that Salt does not allow loop profiling.**
|
|
|
|
|
|
|
|
##### Using PDT parser
|
|
##### Using PDT parser
|
|
|
|
|
|
| ... | @@ -351,7 +358,7 @@ To compile a code by using the PDT parser, you simply need to specify a Tau make |
... | @@ -351,7 +358,7 @@ To compile a code by using the PDT parser, you simply need to specify a Tau make |
|
|
|
|
|
|
|
```
|
|
```
|
|
|
export TAU_MAKEFILE=$PROFILER_PATH/x86_64/lib/Makefile.tau-clang-pdt
|
|
export TAU_MAKEFILE=$PROFILER_PATH/x86_64/lib/Makefile.tau-clang-pdt
|
|
|
export TAU_OPTIONS='-optKeepFiles -optVerbose -optTauSelectFile="select.tau" -optSaltParser="saltfm" -optSaltInst'
|
|
export TAU_OPTIONS='-optKeepFiles -optVerbose -optTauSelectFile="select.tau"'
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
In the above, the `-optKeepFiles` allows to keep intermediate files. The `-optTauSelectFile` specifies the file where additional profiling options are provided. These options are provided in a `select.tau` file (see below)
|
|
In the above, the `-optKeepFiles` allows to keep intermediate files. The `-optTauSelectFile` specifies the file where additional profiling options are provided. These options are provided in a `select.tau` file (see below)
|
| ... | @@ -365,7 +372,6 @@ To select the parts of the code that will be profiled, you need to define a `sel |
... | @@ -365,7 +372,6 @@ To select the parts of the code that will be profiled, you need to define a `sel |
|
|
```
|
|
```
|
|
|
#Tell tau to not profile these functions
|
|
#Tell tau to not profile these functions
|
|
|
BEGIN_EXCLUDE_LIST
|
|
BEGIN_EXCLUDE_LIST
|
|
|
|
|
|
|
|
# You need to add void as argument!
|
|
# You need to add void as argument!
|
|
|
void toto(void)
|
|
void toto(void)
|
|
|
void quicksort(int *, int, int)
|
|
void quicksort(int *, int, int)
|
| ... | @@ -373,18 +379,15 @@ BEGIN_EXCLUDE_LIST |
... | @@ -373,18 +379,15 @@ BEGIN_EXCLUDE_LIST |
|
|
# arguments "int *"
|
|
# arguments "int *"
|
|
|
void sort_#(int *)
|
|
void sort_#(int *)
|
|
|
void interchange(int *, int *)
|
|
void interchange(int *, int *)
|
|
|
|
|
|
|
|
END_EXCLUDE_LIST
|
|
END_EXCLUDE_LIST
|
|
|
|
|
|
|
|
#Exclude these files from profiling
|
|
#Exclude these files from profiling
|
|
|
BEGIN_FILE_EXCLUDE_LIST
|
|
BEGIN_FILE_EXCLUDE_LIST
|
|
|
|
|
|
|
|
*.so
|
|
*.so
|
|
|
|
|
|
|
|
END_FILE_EXCLUDE_LIST
|
|
END_FILE_EXCLUDE_LIST
|
|
|
|
|
|
|
|
BEGIN_INSTRUMENT_SECTION
|
|
BEGIN_INSTRUMENT_SECTION
|
|
|
|
|
# These section does not work with Salt!!!
|
|
|
# A dynamic phase will break up the profile into phase where
|
|
# A dynamic phase will break up the profile into phase where
|
|
|
# each events is recorded according to what phase of the application
|
|
# each events is recorded according to what phase of the application
|
|
|
# in which it occured.
|
|
# in which it occured.
|
| ... | @@ -406,12 +409,12 @@ Here, we specify that loops will be instrumented in all the functions of the pro |
... | @@ -406,12 +409,12 @@ 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:
|
|
Now, to compile the program, replace the standard compile commands as follows:
|
|
|
|
|
|
|
|
- `gcc` -\> `tau_cc.sh`
|
|
- `gcc` and `mpicc`-\> `tau_cc.sh`
|
|
|
- `g++` -\> `tau_cxx.sh`
|
|
- `g++` and `mpic++`-\> `tau_cxx.sh`
|
|
|
- `gfortran` -\> `tau_f90.sh`
|
|
- `gfortran` and `mpifort`-\> `tau_f90.sh`
|
|
|
- `f77` -\> `tau_f70.sh`
|
|
- `f77` and `mpif77`-\> `tau_f70.sh`
|
|
|
|
|
|
|
|
For example:
|
|
r example:
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
tau_cxx.sh test_cpp.cpp -o test.exe
|
|
tau_cxx.sh test_cpp.cpp -o test.exe
|
| ... | @@ -461,3 +464,8 @@ Resources: |
... | @@ -461,3 +464,8 @@ Resources: |
|
|
|
|
|
|
|
- https://hpc.cea.fr/tgcc-public/en/html/toc/fulldoc/Profiling.html#
|
|
- https://hpc.cea.fr/tgcc-public/en/html/toc/fulldoc/Profiling.html#
|
|
|
- https://www.vi-hps.org/projects/score-p/
|
|
- https://www.vi-hps.org/projects/score-p/
|
|
|
|
|
|
|
|
Acknowledgements:
|
|
|
|
|
|
|
|
* Score-P support: Marc, Christian, Bill, Bert
|
|
|
|
* Tau support: Sameer, Nicholas |
|
|
|
\ No newline at end of file |