Greg, Beth, thanks for your answers that helped me to clarify
some Eclipse behaviors : it seems this problem is actually related to gdb but
not to Eclipse.
My version of gdb is the following :
~ > gdb
--version
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
It seems
this version of gdb does not enable to debug thread as I get same kind of
problems in an xterm (outside of Eclipse) :
(gdb) info threads
Id Target Id Frame
4 Thread 0x7ffff5c66700 (LWP 4695)
"OpenMPCpp.exe" 0x00007ffff78d039e in ?? () from
/usr/lib/x86_64-linux-gnu/libgomp.so.1
3 Thread
0x7ffff6467700 (LWP 4694) "OpenMPCpp.exe" 0x00007ffff78d039c in ?? () from
/usr/lib/x86_64-linux-gnu/libgomp.so.1
2 Thread
0x7ffff6c68700 (LWP 4693) "OpenMPCpp.exe" 0x00007ffff78d039c in ?? () from
/usr/lib/x86_64-linux-gnu/libgomp.so.1
* 1 Thread
0x7ffff7fe17a0 (LWP 4690) "OpenMPCpp.exe" main () at
OpenMPCpp.cpp:10
Accessing the stack of thread 2 seems to be impossible
:
(gdb) thread 2
[Switching to thread 2 (Thread 0x7ffff6c68700 (LWP
4693))]
#0 0x00007ffff78d039c in ?? () from
/usr/lib/x86_64-linux-gnu/libgomp.so.1
(gdb) n
Cannot find bounds of
current function
But, accessing the stack of thread 1 is possible
:
(gdb) thread 1
[Switching to thread 1 (Thread 0x7ffff7fe17a0 (LWP
4690))]
#0 main () at
OpenMPCpp.cpp:10
10 cout <<
"Good night from thread " << omp_get_thread_num() << "
/ " << omp_get_num_threads() << endl;
(gdb) n
Good
night from thread 0 /
1
11 return 0;
I guess I
will have to ask for advice to the CDT mailing list/forum... Unless somebody
can tell me what I missed.
Regards,
FH
From: g.watson@xxxxxxxxxxxx
Date: Mon, 16 Jan 2012 10:04:01 -0500
To:
ptp-user@xxxxxxxxxxx
Subject: Re: [ptp-user] Eclipse PTP : debugging with
OpenMP and switching between threads
Hi,
For running/debugging an OpenMP program on your local machine (the one
running Eclipse), using the C/C+ Application launch configuration (which is
provided by the CDT project) like you are doing is probably the best way. Note
that when you set a breakpoint using the CDT debugger, make sure you use a
C/C++ Breakpoint, not a Parallel Breakpoint (which have different icons). You
can change this by right clicking on the left-hand marker bar in the editor
(the one where breakpoints are shown) and selecting Breakpoint Type>C/C++
Breakpoint.
I believe you should be able to see the thread stack and control a thread
like a process. However, thread support is entirely dependent on the
version of gdb you have installed. Later versions of gdb provide better thread
support than earlier versions. If you have questions about debugging
using the CDT debugger, you should direct these to the CDT mailing
list/forum.
For running/debugging a mixed MPI + OpenMP application, you should use
one of the PTP resource managers that matches your system configuration. Your
debugging capability will vary depending on the type of runtime system and
resource manager you have on the machine.
Regards,
Greg
On Jan 16, 2012, at 7:00 AM, Franck Houssen wrote:
Hello,
I use Ubuntu 11.10 and my version of Eclipse is :
Eclipse IDE for Parallel Application Developers, Version: Indigo Service
Release 1, Build id: 20110916-0149.
I am new to Eclipse. I created a
makefile project (with debug flag : g++ -g -openmp) to compile an OpenMP
program : compiling is OK (and run outside eclipse in an xterm is OK).
I
have 2 questions about running / debugging OpenMP in Eclipse :
- To run a simple OpenMP project, am I supposed to create a "local" or a
"parallel" application configuration ? My understanding is that when using
only OpenMP (as I do here) local configuration are the one to use, but,
when using both OpenMPI + OpenMP parallel configuration are the one to use
(because of MPI). Am I right ? If not, which kind of resource manager
should be created to handle OpenMP (I have no OpenMP resource manager
available) ?
- When debugging a simple OpenMP project, is possible to switch between
threads (at the same time, current line code may not be the same for each
thread) ? I believed it could be possible to follow OpenMP threads in the
same way that it is possible to follow OpenMPI processus : is this
possible ? As point 1 mentions it, I use a local configuration and -g when
compiling to enable accessing thread stack : when debugging I see the 4
threads of my PC but I can only access the main thread (see attached
pictures - threads 2 and 3 behave like thread 4 : impossible to access any
level of the thread
stack)
Regards,
FH
<DebugThread1.png><DebugThread4.png>_______________________________________________
ptp-user
mailing list
ptp-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-user
_______________________________________________
ptp-user mailing list ptp-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-user