- Infos im HLRS Wiki sind nicht rechtsverbindlich und ohne Gewähr -
- Information contained in the HLRS Wiki is not legally binding and HLRS is not responsible for any damages that might result from its use -
Valgrind: Difference between revisions
(Added logo.) |
No edit summary |
||
Line 8: | Line 8: | ||
| website = [http://valgrind.org/ Valgrind homepage] | | website = [http://valgrind.org/ Valgrind homepage] | ||
}} | }} | ||
==Usage== | |||
In order to user Valgrind, you need to first load it: | |||
{{Command|command= | |||
module load tools/valgrind/3.6.1 | |||
}} | |||
To check your application with Valgrind, please use following command format (take ''ls'' command as an example): | |||
{{Command|command= | |||
valgrind ls | |||
}} | |||
Please note, the default checking tool is Memcheck. If you want to use other tools in Valgrind, you have to specify it via --tool=<name> option. | |||
Valgrind can also be used to check parallel application. For example, in order to check an MPI application, please follow the steps: | |||
* First reserve compute nodes: | |||
{{Command|command= | |||
qsub -I -lnodes=16:nehalem:ppn=8,walltime=1:0:0 | |||
}} | |||
* Load all necessary tools: | |||
{{Command|command= | |||
module load tools/valgrind/3.6.1 mpi/openmpi/1.5.4-gnu-4.6.1 | |||
}} | |||
* Run your MPI application with Valgrind: | |||
{{Command|command= | |||
mpirun -np 4 valgrind ./your_app | |||
}} | |||
If you want to run Callgrind and later visualize the output in Kcachegrind, you have to do following steps: | |||
* Run your application with Callgrind: | |||
{{Command|command= | |||
valgrind --tool=callgrind ls | |||
}} | |||
The above command will generate an output file with name callgrind.out.xxxx, where xxxx is the pid of the checked application. | |||
* Load Kcachegrind | |||
{{Command|command= | |||
module load tools/kcachegrind/0.7.0 | |||
}} | |||
* Open Kcachegrind with the generated Callgrind output file. Or open Kcachegrind and load the callgrind file in the GUI. | |||
{{Command|command= | |||
kcachegrind callgrind.out.4076 | |||
}} | |||
You will see the Kcachegrind window similar to this: | |||
[[Image:kcachegrind.jpg|center|Example of using Kcachegrind with Callgrind.]] | |||
== See also == | == See also == |
Revision as of 09:29, 16 January 2012
Valgrind is an award-winning instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail. You can also use Valgrind to build new tools. |
|
Usage
In order to user Valgrind, you need to first load it:
To check your application with Valgrind, please use following command format (take ls command as an example):
Please note, the default checking tool is Memcheck. If you want to use other tools in Valgrind, you have to specify it via --tool=<name> option.
Valgrind can also be used to check parallel application. For example, in order to check an MPI application, please follow the steps:
- First reserve compute nodes:
- Load all necessary tools:
- Run your MPI application with Valgrind:
If you want to run Callgrind and later visualize the output in Kcachegrind, you have to do following steps:
- Run your application with Callgrind:
The above command will generate an output file with name callgrind.out.xxxx, where xxxx is the pid of the checked application.
- Load Kcachegrind
- Open Kcachegrind with the generated Callgrind output file. Or open Kcachegrind and load the callgrind file in the GUI.
You will see the Kcachegrind window similar to this: