Download Allinea DDT and MAP User Guide

Transcript
Allinea DDT/MAP v4.2.2-39977
#pragma. Instead they will appear under a different top-level item. The top-level item is often in
the OpenMP runtime code, and the parallel region appears several levels down in the tree.
2. Some OpenMP libraries only create the threads when the first parallel region is reached. Don't
worry if you can only see one thread at the start of the program.
3. You cannot step into a parallel region. Instead, tick the Step threads together box and use the Run to
here command to synchronise the threads at a point inside the region – these controls are discussed
in more detail in their own sections of this document.
4. You cannot step out of a parallel region. Instead, use Run to here to leave it. Most OpenMP libraries
work best if you keep the Step threads together box ticked until you have left the parallel region.
With the Intel OpenMP library, this means you will see the Stepping Threads window and will have
to click Skip All once.
5. Leave Step threads together off when you are outside a parallel region (as OpenMP worker threads
usually do not follow the same program flow as the main thread).
6. To control threads individually, use the Focus on Thread control. This allows you to step and play
one thread without affecting the rest. This is helpful when you want to work through a locking
situation or to bring a stray thread back to a common point. The Focus controls are discussed in
more detail in their own section of this document.
7. Shared OpenMP variables may appear twice in the Locals window. This is one of the many unfortunate side-effects of the complex way OpenMP libraries interfere with your code to produce
parallelism. One copy of the variable may have a nonsense value – this is usually easy to recognise.
The correct values are shown in the Evaluate and Current Line windows.
8. Parallel regions may be displayed as a new function in the stack views. Many OpenMP libraries
implement parallel regions as automatically-generated “outline” functions, and DDT shows you
this. To view the value of variables that are not used in the parallel region, you may need to switch
to thread 0 and change the stack frame to the function you wrote, rather than the outline function.
9. Stepping often behaves unexpectedly inside parallel regions. Reduction variables usually require
some sort of locking between threads, and may even appear to make the current line jump back
to the start of the parallel region! Don't worry about this – step over another couple of times and
you'll see it comes back to where it belongs.
10. Some compilers optimise parallel loops regardless of the options you specified on the command
line. This has many strange effects, including code that appears to move backwards as well as
forwards, and variables that have nonsense values because they have been optimised out by the
compiler.
If you are using DDT with OpenMP and would like to tell us about experiences, we would appreciate
your feedback. Please email [email protected] with the subject title OpenMP feedback.
4.5 Manual Launching of Multi-Process Non-MPI programs
DDT can only launch MPI programs and scalar (single process) programs itself. The Manual Launch
(Advanced) button on the Welcome Page allows you to debug multi-process and multi-executable programs. These programs don't necessarily need to be MPI programs. You can debug programs that use
other parallel frameworks, or both the client and the server from a client/server application in the same
DDT session, for example.
You must run each program you want to debug manually using the ddt-client command, similar to
debugging with a scalar debugger like the GNU debugger (gdb). However, unlike a scalar debugger, you
c 2015 Allinea Software Ltd.
27