| ... | ... | @@ -8,13 +8,14 @@ The tools that were tested are proposed: |
|
|
|
- [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 profile `for` loops, the [Salt](https://github.com/ParaToolsInc/salt) source instrumentation tool must be installed.
|
|
|
|
In order to be able to perform source instrumentation using Tau, the [PDT]() [Salt](https://github.com/ParaToolsInc/salt) source instrumentation tool must be installed.
|
|
|
|
|
|
|
|
## Preparing the install
|
|
|
|
|
|
|
|
### 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)
|
| ... | ... | @@ -114,6 +115,17 @@ export PATH=$PROFILER_PATH_TAU/bin:$PATH |
|
|
|
export PATH=$PROFILER_PATH_TAU/x86_64/bin/:$PATH
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Compilation PDT
|
|
|
|
|
|
|
|
In order to install the PDT source instrumentation tool, go to the PDT folder and type the following:
|
|
|
|
|
|
|
|
```
|
|
|
|
./configure -prefix=$PROFILER_PATH_TAU/ -clang
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### Compilation Salt
|
|
|
|
|
|
|
|
In order to install the Salt source instrumentation tool, go to the Salt folder and type the following:
|
| ... | ... | @@ -131,11 +143,22 @@ When the variables are defined, go to the Tau folder and type: |
|
|
|
```
|
|
|
|
./configure -prefix=$PROFILER_PATH_TAU/ -c++=clang++ -cc=clang -fortran=gfortran -bfd=download -unwind=download -zlib=download
|
|
|
|
make install
|
|
|
|
```
|
|
|
|
|
|
|
|
To compile a MPI code, add a `-mpi` flag:
|
|
|
|
|
|
|
|
```
|
|
|
|
./configure -prefix=$PROFILER_PATH_TAU/ -c++=clang++ -cc=clang -fortran=gfortran -bfd=download -unwind=download -zlib=download -mpi
|
|
|
|
make install
|
|
|
|
```
|
|
|
|
|
|
|
|
To compile a MPI code with PDT instrumentation, add a `-mpi` and `-pdt` flag as follows: flag:
|
|
|
|
|
|
|
|
```
|
|
|
|
./configure -prefix=$PROFILER_PATH_TAU/ -c++=clang++ -cc=clang -fortran=gfortran -bfd=download -unwind=download -zlib=download -mpi -pdt=$PROFILER_PATH_TAU
|
|
|
|
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
|
|
|
|
|
|
|
|
|
| ... | ... | @@ -159,24 +182,77 @@ Once everything is installed, you will be able to compile your code using the pr |
|
|
|
To profile with TAU, you first need to manually define the `LD_LIBRARY_PATH`:
|
|
|
|
|
|
|
|
```
|
|
|
|
export MPICH_CXX=clang++
|
|
|
|
export MPICH_CC=clang
|
|
|
|
export MPICH_FC=gfortran
|
|
|
|
export MPICH_F77=gfortran
|
|
|
|
|
|
|
|
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$PROFILER_PATH_TAU/x86_64/zlib-1.3.1/lib:$PROFILER_PATH_TAU/x86_64/binutils-2.40/lib:PROFILER_PATH_TAU/x86_64/libunwind-1.6.2-clang/lib:$PROFILER_PATH_TAU/lib
|
|
|
|
export PATH=$PROFILER_PATH_TAU/bin:$PATH
|
|
|
|
export PATH=$PROFILER_PATH_TAU/x86_64/bin/:$PATH
|
|
|
|
```
|
|
|
|
|
|
|
|
Next, you need to define the Tau Makefile that you will use and also
|
|
|
|
#### 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:
|
|
|
|
|
|
|
|
```
|
|
|
|
export TAU_MAKEFILE=$PROFILER_PATH/x86_64/lib/Makefile.tau-clang-mpi
|
|
|
|
```
|
|
|
|
|
|
|
|
You also need to define a set of options to insure that compiler instrumentation will be used:
|
|
|
|
|
|
|
|
```
|
|
|
|
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:
|
|
|
|
|
|
|
|
```
|
|
|
|
export TAU_MAKEFILE=$PROFILER_PATH/x86_64/lib/Makefile.tau-clang-mpi
|
|
|
|
```
|
|
|
|
|
|
|
|
##### Using Salt parser
|
|
|
|
|
|
|
|
To compile a code by using the Salt parser, you also need to provide the following environment variable:
|
|
|
|
|
|
|
|
```
|
|
|
|
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:
|
|
|
|
|
|
|
|
```
|
|
|
|
export TAU_MAKEFILE=$PROFILER_PATH/x86_64/lib/Makefile.tau-clang-pdt
|
|
|
|
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, which may be as follows:
|
|
|
|
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
|
|
|
|
|
|
|
|
##### Selecting profiled code
|
|
|
|
|
|
|
|
To select the parts of the code that will be profiled, you need to define a `select.tau` file, which is as follows:
|
|
|
|
|
|
|
|
```
|
|
|
|
#Tell tau to not profile these functions
|
|
|
|
BEGIN_EXCLUDE_LIST
|
|
|
|
|
|
|
|
# You need to add void as argument!
|
|
|
|
void toto(void)
|
|
|
|
void quicksort(int *, int, int)
|
|
|
|
# The next line excludes all functions beginning with "sort_" and having
|
|
|
|
# arguments "int *"
|
| ... | ... | |
| ... | ... | |