| ... | @@ -174,6 +174,130 @@ make install |
... | @@ -174,6 +174,130 @@ make install |
|
|
|
|
|
|
|
Once everything is installed, you will be able to compile your code using the profiler tools.
|
|
Once everything is installed, you will be able to compile your code using the profiler tools.
|
|
|
|
|
|
|
|
|
### Profile with Score-P
|
|
|
|
|
|
|
|
#### Compiler instrumentation
|
|
|
|
|
|
|
|
To profile a code with Score-P, you first need to define some environment variables:
|
|
|
|
|
|
|
|
```
|
|
|
|
export MPICH_CXX=g++
|
|
|
|
export MPICH_CC=gcc
|
|
|
|
export MPICH_FC=gfortran
|
|
|
|
export MPICH_F77=gfortran
|
|
|
|
|
|
|
|
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$PROFILER_PATH_SCOREP/lib
|
|
|
|
export PATH=$PROFILER_PATH_SCOREP/bin:$PATH
|
|
|
|
export PATH=$PROFILER_PATH_SCOREP/x86_64/bin/:$PATH
|
|
|
|
```
|
|
|
|
|
|
|
|
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`
|
|
|
|
|
|
|
|
For example
|
|
|
|
|
|
|
|
```
|
|
|
|
scorep-g++ test_cpp.cpp -o test.exe
|
|
|
|
```
|
|
|
|
|
|
|
|
As with TAU, the user can also control which part of the code will be profiled. This is done by creating a `scorep.filt` file as follows:
|
|
|
|
|
|
|
|
```
|
|
|
|
SCOREP_FILE_NAMES_BEGIN # This is a comment
|
|
|
|
EXCLUDE */filtering/filter*
|
|
|
|
INCLUDE */filter_test.c
|
|
|
|
SCOREP_FILE_NAMES_END
|
|
|
|
|
|
|
|
SCOREP_REGION_NAMES_BEGIN
|
|
|
|
EXCLUDE *
|
|
|
|
INCLUDE bar foo
|
|
|
|
baz
|
|
|
|
main
|
|
|
|
SCOREP_REGION_NAMES_END
|
|
|
|
```
|
|
|
|
|
|
|
|
The next step is to export the `SCOREP_FILTERING_FILE` environment variable and point to the `scorep.filt` file:
|
|
|
|
|
|
|
|
```
|
|
|
|
# For runtime filtering
|
|
|
|
export SCOREP_FILTERING_FILE=/path/to/scorep.filt
|
|
|
|
|
|
|
|
# For compile time-filtering
|
|
|
|
export SCOREP_WRAPPER_INSTRUMENTER_FLAGS="--instrument-filter=scorep.filt"
|
|
|
|
```
|
|
|
|
|
|
|
|
With this variable defined, the user can recompile the code.
|
|
|
|
|
|
|
|
The next step is to run your code:
|
|
|
|
|
|
|
|
```
|
|
|
|
./test.exe
|
|
|
|
```
|
|
|
|
|
|
|
|
A `scorep-` folder will appear containing all the profiling informations. It can be opened by using the `paraprof` tool as follows:
|
|
|
|
|
|
|
|
```
|
|
|
|
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 &`
|
|
|
|
|
|
|
|
#### Manual instrumentation
|
|
|
|
|
|
|
|
You can add manual instrumentation within a code. For instance:
|
|
|
|
|
|
|
|
```
|
|
|
|
#ifdef SCOREP
|
|
|
|
#include <scorep/SCOREP_User.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
void toto() {
|
|
|
|
|
|
|
|
int num, sum;
|
|
|
|
sum = 0;
|
|
|
|
|
|
|
|
num = 100000;
|
|
|
|
|
|
|
|
#ifdef SCOREP
|
|
|
|
SCOREP_USER_REGION_DEFINE( my_region_handle )
|
|
|
|
SCOREP_USER_REGION_BEGIN(my_region_handle, "loop_1", SCOREP_USER_REGION_TYPE_LOOP)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
for (int i = 1; i <= num; ++i) {
|
|
|
|
sum += i;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef SCOREP
|
|
|
|
SCOREP_USER_REGION_END( my_region_handle )
|
|
|
|
#endif
|
|
|
|
|
|
|
|
cout << "Sum = " << sum << endl;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
To compile this instrumented code, you need to use the `--user` argument as follows:
|
|
|
|
|
|
|
|
```
|
|
|
|
scorep --user g++ -DSCOREP -I$BOOST_ROOT test_cpp.cpp
|
|
|
|
```
|
|
|
|
|
|
|
|
Alternatively, you can proceed as follows:
|
|
|
|
|
|
|
|
```
|
|
|
|
export SCOREP_WRAPPER_INSTRUMENTER_FLAGS="--instrument-filter=scorep.filt --user"
|
|
|
|
scorep-g++ -DSCOREP -I$BOOST_ROOT test_cpp.cpp
|
|
|
|
```
|
|
|
|
|
|
|
### Profile with TAU
|
|
### Profile with TAU
|
|
|
|
|
|
|
|
To profile with TAU, you first need to manually define the `LD_LIBRARY_PATH`:
|
|
To profile with TAU, you first need to manually define the `LD_LIBRARY_PATH`:
|
| ... | @@ -307,130 +431,6 @@ paraprof profile.0.0.0 & |
... | @@ -307,130 +431,6 @@ paraprof profile.0.0.0 & |
|
|
|
|
|
|
|
> **Note**: `.cubex` files can also be analysed using the Cube software, available as an App Image [here](https://www.scalasca.org/software/cube-4.x/download.html): `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://www.scalasca.org/software/cube-4.x/download.html): `CubeGUI-4.8.2.AppImage scorep-20250310_1624_81500554863145/profile.cubex &`
|
|
|
|
|
|
|
|
### Profile with Score-P
|
|
|
|
|
|
|
|
|
|
#### Compiler instrumentation
|
|
|
|
|
|
|
|
|
|
To profile a code with Score-P, you first need to define some environment variables:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
export MPICH_CXX=g++
|
|
|
|
|
export MPICH_CC=gcc
|
|
|
|
|
export MPICH_FC=gfortran
|
|
|
|
|
export MPICH_F77=gfortran
|
|
|
|
|
|
|
|
|
|
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$PROFILER_PATH_SCOREP/lib
|
|
|
|
|
export PATH=$PROFILER_PATH_SCOREP/bin:$PATH
|
|
|
|
|
export PATH=$PROFILER_PATH_SCOREP/x86_64/bin/:$PATH
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
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`
|
|
|
|
|
|
|
|
|
|
For example
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
scorep-g++ test_cpp.cpp -o test.exe
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
As with TAU, the user can also control which part of the code will be profiled. This is done by creating a `scorep.filt` file as follows:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
SCOREP_FILE_NAMES_BEGIN # This is a comment
|
|
|
|
|
EXCLUDE */filtering/filter*
|
|
|
|
|
INCLUDE */filter_test.c
|
|
|
|
|
SCOREP_FILE_NAMES_END
|
|
|
|
|
|
|
|
|
|
SCOREP_REGION_NAMES_BEGIN
|
|
|
|
|
EXCLUDE *
|
|
|
|
|
INCLUDE bar foo
|
|
|
|
|
baz
|
|
|
|
|
main
|
|
|
|
|
SCOREP_REGION_NAMES_END
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The next step is to export the `SCOREP_FILTERING_FILE` environment variable and point to the `scorep.filt` file:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
# For runtime filtering
|
|
|
|
|
export SCOREP_FILTERING_FILE=/path/to/scorep.filt
|
|
|
|
|
|
|
|
|
|
# For compile time-filtering
|
|
|
|
|
export SCOREP_WRAPPER_INSTRUMENTER_FLAGS="--instrument-filter=scorep.filt"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
With this variable defined, the user can recompile the code.
|
|
|
|
|
|
|
|
|
|
The next step is to run your code:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
./test.exe
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
A `scorep-` folder will appear containing all the profiling informations. It can be opened by using the `paraprof` tool as follows:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
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 &`
|
|
|
|
|
|
|
|
|
|
#### Manual instrumentation
|
|
|
|
|
|
|
|
|
|
You can add manual instrumentation within a code. For instance:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
#ifdef SCOREP
|
|
|
|
|
#include <scorep/SCOREP_User.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
void toto() {
|
|
|
|
|
|
|
|
|
|
int num, sum;
|
|
|
|
|
sum = 0;
|
|
|
|
|
|
|
|
|
|
num = 100000;
|
|
|
|
|
|
|
|
|
|
#ifdef SCOREP
|
|
|
|
|
SCOREP_USER_REGION_DEFINE( my_region_handle )
|
|
|
|
|
SCOREP_USER_REGION_BEGIN(my_region_handle, "loop_1", SCOREP_USER_REGION_TYPE_LOOP)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= num; ++i) {
|
|
|
|
|
sum += i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef SCOREP
|
|
|
|
|
SCOREP_USER_REGION_END( my_region_handle )
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
cout << "Sum = " << sum << endl;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
To compile this instrumented code, you need to use the `--user` argument as follows:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
scorep --user g++ -DSCOREP -I$BOOST_ROOT test_cpp.cpp
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Alternatively, you can proceed as follows:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
export SCOREP_WRAPPER_INSTRUMENTER_FLAGS="--instrument-filter=scorep.filt --user"
|
|
|
|
|
scorep-g++ -DSCOREP -I$BOOST_ROOT test_cpp.cpp
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Profile with Scalasca
|
|
### Profile with Scalasca
|
|
|
|
|
|
|
|
To profile a code with Scalasca, you need to compile the code by replacing:
|
|
To profile a code with Scalasca, you need to compile the code by replacing:
|
| ... | |
... | |
| ... | | ... | |