Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
outils_analyse:tau [2015/02/27 13:27] – créée adminoutils_analyse:tau [2016/04/22 09:04] (Version actuelle) – admin
Ligne 1: Ligne 1:
-====== Intel® Trace Analyzer and Collector =====+====== TAU ====== 
 +TAU is an MPI program analyzer. It generates all necessary information during the program 
 +execution, so that it can be read after it and displayed by a specialized program.
  
-**Problème **: Comment déboguer une application parallèle MPI (Intel MPI) ? 
  
-**Solution **: Intel fournit un outil, ITAC, puissant et facile à utiliser.  
  
-<note tip>Pour OpenMPI utiliser [[Scalasca|Scalasca]]</note>+===== Installed version =====
  
-** Pré-requis **+  * 2.25 compiled with GCC and Open MPI 
 +  * 2.25 compiled with ICC and Open MPI
  
-Besoin d'une application MPI à compiler avec Intel MPI+use  ''module avail tau'' to view installed versions.
  
-<note>L'environnement Intel est chargé par défaut dans votre session. Vous n'avez pas besoin d'utiliser : **module**</note>+example :
  
  
-**Exemple de programme** : send/receive avec MPI 
  
 +<code bash>
  
-<file c sendreceive.c>+$ module avail perf/tau
  
 +</code>
 + 
 +===== TAU usage and displaying tools =====
  
-#include "mpi.h"+    - **Dynamic Instrumentation**: No change to your application's source or binary code is necessary. Using the tau_exec command before your executable generates both profile and trace data. 
 +    - **Compiler-Based Instrumentation**: TAU can also be used to compile your application using wrapper scripts for ''mpicc'', ''mpicxx'', and ''mpif90''. Tau instruments the binary code without changing the source. Using the ''tau_exec'' command before the TAU-compiled executable generates profile and trace data. Data is collected on both ''MPI'' calls and your application's function calls.
  
-#include <stdio.h>+==== Dynamic Instrumentation ====
  
-int main(argc,argv)  
-int argc; 
-char *argv[];  { 
-int numtasks, rank, dest, source, rc, count, tag=1;   
-char inmsg, outmsg='x'; 
-MPI_Status Stat; 
  
-MPI_Init(&argc,&argv); +<note tip>   
-MPI_Comm_size(MPI_COMM_WORLD, &numtasks); + Usefull env variables: 
-MPI_Comm_rank(MPI_COMM_WORLD, &rank);+  * TAU_TRACE=1 (defaul 0) to view traces  
 +  * TAU_PROFILE=1 (default)  
 +  * TAU_COMM_MATRIX=1 default 0) to view 3D communication matrix
  
-if (rank == 0) { +</note>
-  dest = 1; +
-  source = 1; +
-  rc = MPI_Send(&outmsg, 1, MPI_CHAR, dest, tag, MPI_COMM_WORLD); +
-  rc = MPI_Recv(&inmsg, 1, MPI_CHAR, source, tag, MPI_COMM_WORLD, &Stat); +
-  } +
  
-else if (rank == 1) { +  - Load the needed tau <code bash>$ module load perf/tau/icc</code> 
-  dest = 0; +  - Compile <code bash>$ mpicc hello.c -o hello</code> 
-  source = 0; +  - Dynamic instrumentation <code bash>$ mpirun -np $NSLOTS tau_exec ./hello</code>  
-  rc = MPI_Recv(&inmsg, 1, MPI_CHAR, source, tag, MPI_COMM_WORLD, &Stat); +  - Run TAU's recompiling tool <code>$ tau_treemerge.pl</code> 
-  rc = MPI_Send(&outmsg, 1, MPI_CHAR, dest, tag, MPI_COMM_WORLD); +  - After this it will have generated some output files, merge them with the next command <code bash>$ tau2slog2 tau.trc tau.edf -o tau.slog2</code> 
-  }+  - Now just open the new merged file with the default displaying tool <code bash>$ jumpshot tau.slog2</code> 
 +  - For profiling just call ''pprof'' and ''paraprof'' programs to view profilers results
  
-rc = MPI_Get_count(&Stat, MPI_CHAR, &count); 
-printf("Task %d: Received %d char(s) from task %d with tag %d \n", 
-       rank, count, Stat.MPI_SOURCE, Stat.MPI_TAG); 
  
 +==== Compiler-Based Instrumentation====
 + 
 +For each compiler type there is TAU wrapper, for example: 
  
 +  * ''tau_cxx.sh'' for ''C++'' compiler
 +  * ''tau_f90.sh'' for Fortarn 90 compiler
 +  * ''tau_cc.sh'' fot C compiler
  
-MPI_Finalize(); +Tau warapper uses ''$TAU_MAKEFILE'' to compile programs.  
-}+
  
-</file>+  - Compile programs <code bash>tau_cc.sh hello.c -o hello</code> 
 +  - Run program as usual <code bash>mpirun -np $NSLOTS ./hello</code> 
 +  - Follow steps 4, 5, 6 like for dynamic instrumentation
  
-**Compilation**:  pour générer les traces on utilise l'option **-trace**+You can also view profilers information with: ''pprof'' or ''paraprof''
  
-<code bash>+==== Example ====
  
-$ mpiicc sendreceive.c -trace -o sendreceive +Let's profile/trace program (simple Jacobi iteration)
-</code>+
  
  
-**Exécution du programme**+**Tracing**\\
  
 <code bash> <code bash>
-$ mpirun -np 2 ./sendreceive+ 
 +$ module load perf/tau/icc 
 + 
 +$ mpicc jacobi.c -o jacobi 
 + 
 +$ mpirun -np 4 tau_exec ./jacobi 
 + 
 +$ tau_treemerge.pl 
 + 
 +$ tau2slog2 tau.trc tau.edf -o tau.slog2 
 + 
 +$ jumpshot tau.slog2 
 </code> </code>
  
 +{{:tau1.png?300|}} {{:tau2.png?300 |}}
  
-<note tip>A la fin de l'exécution on devrait avoir un fichier de trace : **sendreceive.stf** généré par Intel MPI</note> 
  
-** Lancement de l'analyseur de trace**+---- 
 + 
 + 
 +**Profiling**\\ 
 +We need to pack all the profiles.* files in a 
 +unique one:
  
 <code bash> <code bash>
  
-$ traceanalyzer sendreceive.stf+$ paraprof --pack tau.ppk 
 + 
 +</code> 
 +Now, we can visualize the tau.ppk file by using 
 +Paraprof 
 +<code bash> 
 +$ paraprof
 </code> </code>
  
-**Exemple d'un écran graphique de l'analyseur** +<note tip>click to enlarge</note>
  
-{{:capture-intel_trace_analyzer.png?800*200|}}+{{:profile.png?300|}} {{:profile2.png?300 |}}
  
-  * http://www.calmip.univ-toulouse.fr/spip/IMG/pdf/ITA-ReferenceGuide.pdf 
  • outils_analyse/tau.1425043638.txt.gz
  • Dernière modification : 2015/02/27 13:27
  • de admin