Running

On Fionn ICHEC provides a module file for Valgrind which you should load first. When you are ready to begin, just run your application as you would normally, but place valgrind --tool=memcheck in front of your usual command-line invocation.

Load the Valgrind module and call nameprog.x using Valgrind:

For GCC:

$module load dev valgrind/gcc/3.10.1
$valgrind [--tool=memcheck] ./nameprog.x [prog-options]

For Intel:

$module load dev valgrind/intel/3.10.1
$valgrind [--tool=memcheck] ./nameprog.x [prog-options]

Memcheck is the default, so if you want to use it you can omit the --tool flag. Valgrind executes the memcheck of the UNIX system call ls and prints to the standard output memory check information and some suggestions about how to get more information. This output can be redirect to a file with the option --log-file=filename.

Sample output for the ls command:

$valgrind ls -ltr
==4883== Memcheck, a memory error detector
==4883== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==4883== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==4883== Command: ls -ltr
==4883==
total 20
drwxr-xr-x 2 bgursoy ichec 4096 Apr 24 2014 SGEMM
drwxr-xr-x 2 bgursoy ichec 4096 May 1 2014 DGEMM_scatter
drwxr-xr-x 2 bgursoy ichec 4096 May 1 2014 DGEMM_compact
drwxr-xr-x 2 bgursoy ichec 4096 May 9 2014 MAGMA
drwxr-xr-x 3 bgursoy ichec 4096 May 9 2014 DGEMM
==4883==
==4883== HEAP SUMMARY:
==4883== in use at exit: 19,524 bytes in 11 blocks
==4883== total heap usage: 560 allocs, 549 frees, 88,566 bytes allocated
==4883==
==4883== LEAK SUMMARY:
==4883== definitely lost: 0 bytes in 0 blocks
==4883== indirectly lost: 0 bytes in 0 blocks
==4883== possibly lost: 0 bytes in 0 blocks
==4883== still reachable: 19,524 bytes in 11 blocks
==4883== suppressed: 0 bytes in 0 blocks
==4883== Rerun with --leak-check=full to see details of leaked memory
==4883==
==4883== For counts of detected and suppressed errors, rerun with: -v
==4883== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 3 from 3)

Supported By

File Browser Reference
Department FHERIS
University of Galway
HEA Logo