This is an introduction to valgrind as a performance tool for caching, etc..
The following guid describes how to execute ATELES with valgrind/callgrind/cachegrind to get a performance analyses. Before executing ATELES with valgrind read the following instructions carefully. 

The following steps have to be done before executing ATELES:

Step 1: 
Go to the ATELES directory, 
           cd ./your_folders/ateles
Compile ATELES with simple debug options by:
           ./waf clean configure debug
Debug options are necessary since we want to see all the function names for analyzing the performanc. With a GNU compiler it is possible to have optimization and debug options at the same time. In order to get this you should compile the code with the compiler options '-O2 -g'. 

Step 2: 
Execute ATELES under observation of valgrind and its performance tools. The following file is an example file for the Juropa system in Juelich which executes ATELES there:
           test/performance/valgrind_ateles.msub
Before submitting this job to the queue of the Juropa system please check if the directory given in this file are the correct ones on your account.
The job is then submitted to the queue of the system by:
           msub test/performance/valgrind_ateles.msub

Step 3:
Now, analyse the files written by valgrind. This can be done by qcachegrind (where ++++ represents a number):
           qcachegrind callgrind.out.++++
Since each rank creates its own file the command the command above will open just one file and visualizes it.
The whole dataset can be visualized by:
           qcachegrind callgrind.out
