| ... | ... | @@ -318,6 +318,8 @@ paraprof profile.0.0.0 & |
|
|
|
|
|
|
|
### Profile with Score-P
|
|
|
|
|
|
|
|
#### Compiler instrumentation
|
|
|
|
|
|
|
|
To profile a code with Score-P, you first need to define some environment variables:
|
|
|
|
|
|
|
|
```
|
| ... | ... | @@ -385,6 +387,49 @@ 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
|
|
|
|
```
|
|
|
|
|
|
|
|
### Profile with Scalasca
|
|
|
|
|
|
|
|
To profile a code with Scalasca, you need to compile the code by replacing:
|
| ... | ... | |
| ... | ... | |