| ... | ... | @@ -4,9 +4,9 @@ In this Wiki, we will provide a methodology to install and run some code profile |
|
|
|
|
|
|
|
The tools that were tested are proposed:
|
|
|
|
|
|
|
|
- [Score-P](https://www.vi-hps.org/projects/score-p/)
|
|
|
|
- [TAU](https://www.cs.uoregon.edu/research/tau/home.php), which allows the profiling of `for` loops
|
|
|
|
- [Scalasca](https://www.scalasca.org/)
|
|
|
|
- [Score-P](https://www.vi-hps.org/projects/score-p/)
|
|
|
|
- [TAU](https://www.cs.uoregon.edu/research/tau/home.php), which allows the profiling of `for` loops
|
|
|
|
- [Scalasca](https://www.scalasca.org/)
|
|
|
|
|
|
|
|
In order to be able to perform source instrumentation using Tau, the [PDT](https://www.cs.uoregon.edu/research/pdt/home.php) and [Salt](https://github.com/ParaToolsInc/salt) source instrumentation tool must be installed.
|
|
|
|
|
| ... | ... | @@ -14,11 +14,11 @@ In order to be able to perform source instrumentation using Tau, the [PDT](https |
|
|
|
|
|
|
|
### Download:
|
|
|
|
|
|
|
|
- Salt: `git clone --recursive https://github.com/ParaToolsInc/salt.git`
|
|
|
|
- PDT: [http://tau.uoregon.edu/pdt.tgz ](http://tau.uoregon.edu/pdt.tgz)
|
|
|
|
- Score-P: [https://perftools.pages.jsc.fz-juelich.de/cicd/scorep/tags/scorep-8.4/scorep-8.4.tar.gz](https://perftools.pages.jsc.fz-juelich.de/cicd/scorep/tags/scorep-8.4/scorep-8.4.tar.gz)
|
|
|
|
- Tau: `gh repo clone barriern/tau2`
|
|
|
|
- Scalasca: [https://apps.fz-juelich.de/scalasca/releases/scalasca/2.6/dist/scalasca-2.6.1.tar.gz](https://apps.fz-juelich.de/scalasca/releases/scalasca/2.6/dist/scalasca-2.6.1.tar.gz)
|
|
|
|
- Salt: `git clone --recursive https://github.com/ParaToolsInc/salt.git`
|
|
|
|
- PDT: http://tau.uoregon.edu/pdt.tgz
|
|
|
|
- Score-P: https://perftools.pages.jsc.fz-juelich.de/cicd/scorep/tags/scorep-8.4/scorep-8.4.tar.gz
|
|
|
|
- Tau: `gh repo clone barriern/tau2`
|
|
|
|
- Scalasca: https://apps.fz-juelich.de/scalasca/releases/scalasca/2.6/dist/scalasca-2.6.1.tar.gz
|
|
|
|
|
|
|
|
### Conda Environment
|
|
|
|
|
| ... | ... | @@ -125,7 +125,6 @@ make |
|
|
|
make install
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### Compilation Salt
|
|
|
|
|
|
|
|
In order to install the Salt source instrumentation tool, go to the Salt folder and type the following:
|
| ... | ... | @@ -161,8 +160,6 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Compilation Scalasca
|
|
|
|
|
|
|
|
Go to your Scalasca folder and type:
|
| ... | ... | @@ -194,8 +191,7 @@ export PATH=$PROFILER_PATH_TAU/x86_64/bin/:$PATH |
|
|
|
|
|
|
|
#### Profiling with 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:
|
|
|
|
|
|
|
|
```
|
|
|
|
export TAU_MAKEFILE=$PROFILER_PATH/x86_64/lib/Makefile.tau-clang-mpi
|
| ... | ... | @@ -209,8 +205,7 @@ export TAU_OPTIONS='-optKeepFiles -optVerbose -optCompInst' |
|
|
|
|
|
|
|
#### 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
|
| ... | ... | @@ -224,13 +219,11 @@ 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'
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
##### Using PDT parser
|
|
|
|
|
|
|
|
To compile a code by using the PDT parser, you simply need to specify a Tau makefile that includes `pdt` and
|
|
|
|
remove the `-optSaltParser` and `-optSaltInst` from the TAU_OPTIONS. For instance:
|
|
|
|
To compile a code by using the PDT parser, you simply need to specify a Tau makefile that includes `pdt` and remove the `-optSaltParser` and `-optSaltInst` from the TAU_OPTIONS. For instance:
|
|
|
|
|
|
|
|
```
|
|
|
|
export TAU_MAKEFILE=$PROFILER_PATH/x86_64/lib/Makefile.tau-clang-pdt
|
| ... | ... | @@ -239,9 +232,7 @@ export TAU_OPTIONS='-optKeepFiles -optVerbose -optTauSelectFile="select.tau" -op |
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
> [!important]
|
|
|
|
> The PDT parser will not work with resent C++ code. For example, it will fail with includes
|
|
|
|
statements of the Boost library. You need to use Salt instead
|
|
|
|
> \[!important\] The PDT parser will not work with resent C++ code. For example, it will fail with includes statements of the Boost library. You need to use Salt instead
|
|
|
|
|
|
|
|
##### Selecting profiled code
|
|
|
|
|
| ... | ... | @@ -291,10 +282,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:
|
|
|
|
|
| ... | ... | @@ -335,13 +326,13 @@ 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`
|
|
|
|
- `g++` -\> `scorep g++`
|
|
|
|
- `gfortran` -\> `scorep gfortran`
|
|
|
|
- `mpicxx` -\> `scorep mpicxx`
|
|
|
|
- `mpif90` -\> `scorep mpif90`
|
|
|
|
- `gcc` -\> `scorep gcc`
|
|
|
|
- `mpicc` -\> `scorep mpicc`
|
|
|
|
- `mpif77` -\> `scorep mpif77`
|
|
|
|
|
|
|
|
For example
|
|
|
|
|
| ... | ... | @@ -425,7 +416,6 @@ void toto() { |
|
|
|
|
|
|
|
cout << "Sum = " << sum << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
To compile this instrumented code, you need to use the `--user` argument as follows:
|
| ... | ... | @@ -445,13 +435,13 @@ scorep-g++ -DSCOREP -I$BOOST_ROOT test_cpp.cpp |
|
|
|
|
|
|
|
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:
|
|
|
|
|
| ... | ... | @@ -465,9 +455,9 @@ scan test.exe |
|
|
|
scan -t test.exe
|
|
|
|
```
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
---
|
|
|
|
|
|
|
|
Resources:
|
|
|
|
|
|
|
|
- https://hpc.cea.fr/tgcc-public/en/html/toc/fulldoc/Profiling.html#
|
|
|
|
- https://www.vi-hps.org/projects/score-p/ |
|
|
\ No newline at end of file |
|
|
|
- https://hpc.cea.fr/tgcc-public/en/html/toc/fulldoc/Profiling.html#
|
|
|
|
- https://www.vi-hps.org/projects/score-p/ |
|
|
\ No newline at end of file |