Skip to content

Commit

Permalink
cleaning up devel section
Browse files Browse the repository at this point in the history
  • Loading branch information
bast committed Sep 26, 2015
1 parent d20e5cb commit 3e66c35
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 86 deletions.
7 changes: 7 additions & 0 deletions development/scripting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


Scripting languages
===================

A rich set of scripting tools and languages are available on Stallo, including
Python, Bash, Lua, R, Perl, Ruby.
10 changes: 10 additions & 0 deletions development/tools.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@


Useful development tools
========================

To efficiently manage, build and develop software on Stallo some excellent
tools and services are available. Source code management using ``git``,
including private hosting and project management tools, are available to users.
Building programs using ``CMake`` is easy and painless, and takes care of all
system dependencies.
56 changes: 28 additions & 28 deletions guides/developer/valgrind.rst → development/valgrind.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
Using Valgrind
================


Valgrind
========


What is Valgrind?
-------------------
-----------------

* A memory error detector
* A thread error detector
Expand All @@ -15,16 +18,18 @@ What is Valgrind?
Valgrind is the best thing for developers since the invention of pre-sliced
bread!


How does Valgrind work?
------------------------
-----------------------

Valgrind works by emulating one or more CPUs. Hence it can intercept and
inspect your unmodified, running program in ways which would not be otherwise
possible. It can for example check that all variables have actually been
assigned before use, that all memory references are within their allowed
space, even for static arrays and arrays on the stack.
assigned before use, that all memory references are within their allowed space,
even for static arrays and arrays on the stack.

What makes Valgrind so extremely powerful is that it will tell exactly where
in the program a problem, error or violation occurred. It will also give you
What makes Valgrind so extremely powerful is that it will tell exactly where in
the program a problem, error or violation occurred. It will also give you
information on how many allocates/deallocates the program performed, and
whether there is any unreleased memory or memory leaks at program exit. In
fact, it goes even further and will tell you on what line the
Expand All @@ -35,48 +40,43 @@ The biggest downside to Valgrind is that it will make your program run much
slower. How much slower depends on what kind of, and how much, information you
request. Typically the program will run 10-100 times slower under Valgrind.

Using Valgrind
---------------

Checking memory
.................
As stated earlier, Valgrind is very easy to use; Simply start Valgrind with
the path to the binary program to be tested:
---------------

.. code-block:: console
As stated earlier, Valgrind is very easy to use; Simply start Valgrind with
the path to the binary program to be tested::

$ module load valgrind
$ valgrind /path/to/prog
$ module load valgrind
$ valgrind /path/to/prog

This runs Valgrind with the default "tool" which is called memcheck, which
checks memory consistency. When run without any extra flags, Valgrind will
produce a balanced, not overly detailed and informative output. If you need a
more detailed (but slower) report, run Valgrind with:
more detailed (but slower) report, run Valgrind with::

.. code-block:: console
$ valgrind --leak-check=full --track-origins=yes --show-reachable=yes /path/to/prog
$ valgrind --leak-check=full --track-origins=yes --show-reachable=yes /path/to/prog

Of course, if you want to get all possible information about where in the
program something was inconsistent you must compile the program with debugging
flags switched on.


Checking threads
...................
----------------

If you have a multi-threaded program (e.g. OpenMP, pthreads), and you are
unsure if there might be possible deadlocks or data races lurking in your
program, the Valgrind thread checker is your best friend. The thread checking
tool is called helgrind:
tool is called helgrind::

.. code-block:: console
$ export OMP_NUM_THREADS=2
$ valgrind --tool=helgrind /path/to/prog

$ export OMP_NUM_THREADS=2
$ valgrind --tool=helgrind /path/to/prog

Further information
----------------------
-------------------

For more information on using Valgrind please refer to the man pages and the
Valgrind manual which can be found on the Valgrind website:

http://www.valgrind.org
19 changes: 0 additions & 19 deletions guides/developer/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,3 @@ run efficiently in parallel, even when substantial amounts of communication is
required.

*For more information, see the :doc:`parallel programming page <parallel>`.*

:doc:`Useful tools and software <tools>`
----------------------------------------

To efficiently manage, build and develop software on stallo some excellent
tools and services are available. Source code management using ``git``,
including private hosting and project management tools, are available to
users. Building programs using ``CMake`` is easy and painless, and takes care
of all system dependencies.

*For more information, see the :doc:`tools page <tools>`.*

:doc:`Scripting <scripting>`
----------------------------

A rich set of scripting tools and languages are available on stallo, including
Python, Bash, Lua, R, Perl, Ruby.

*For more information, see the :doc:`scripting page <scripting>`.*
24 changes: 0 additions & 24 deletions guides/developer/scripting.rst

This file was deleted.

15 changes: 0 additions & 15 deletions guides/developer/tools.rst

This file was deleted.

3 changes: 3 additions & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Application development on Stallo
:maxdepth: 2

development/environment.rst
development/scripting.rst
development/tools.rst
development/valgrind.rst


Applications
Expand Down

0 comments on commit 3e66c35

Please sign in to comment.