[Qt-creator] MPI debugger plugin

Mohammad Mirzadeh mirzadeh at gmail.com
Wed Aug 14 20:18:55 CEST 2013

Thanks Poenitz.

On Wed, Aug 14, 2013 at 3:26 AM, Poenitz Andre <Andre.Poenitz at digia.com> wrote:
> Hi Mohammad.
> You wrote:
>> My experience with parallel MPI debugging in QtCreator has always been
>> opening multiple sessions, attaching to running processors, and go
>> back and forth between processes manually ... which kinda works but
>> can easily get out of hand for more than 2-3 processes!
> Right. The setup I usually use for "reality checks" is four processes on
> an embedded target and another one on the host system, and the ugly
> part is indeed the startup of the "system". It's doable with a few lines of
> external script by using the -debug <executable>,server=<server:port>
> [,kit=<kit>] command line options for starting up the individual creator
> instances, but that is not really "integrated", so I wouldn't call that a
> proper solution.
>> Indeed there are not that many parallel MPI debuggers available and
>> the one I know are all really expensive (in the $500-700 price range
>> and more). But the thing is most MPI debuggers are really just
>> wrappers around serial ones like gdb ... its just that they show the
>> result in one window and make it really easy to switch between
>> processes.

I'm not sure this is useful in my case as I have to initiate the
parallel run using mpirun. Although, I should mention, I have done
things like mpirun -n 4 xterm -e gdb -tui ./executable. This will
launch 4 separate xterm windows and runs the executable inside gdn in
each one of them. I assume I could do the same trick with qtcreator

>> So after thing lengthy introduction, here is my question: For someone
>> like me, who is considerably comfortable with C++ but with no Qt
>> background, how hard is it to change the current debugger plugin so
>> that I could easily debug MPI programs in one window and confortably
>> switch between different processes? If this is doable, where should I
>> start?
> We already have the ability to run multiple "debugger engines" in
> parallel. There are, however, currently only two features that take
> advantage of that. The first is the "Snapshots" feature, which allows
> you to take "Snapshots" of a running process (essentially core file that
> are owned by seperate engines) and switch between those snapshots
> and the live process using the Snapshots view.The second
> mulit-engine feature is the mixed qml/c++ debugging consisting
> of three engines running in parallel - one "master engine" essentially
> multiplexes between a qml/js debugger engine and a c++ debugger
> engine talking to gdb or cdb. Going from the Snapshot feature to
> proper MPI support should be possible.

Yeah I remember snapshot was suggested to me before, and while its
better than separate sessions, I have couple of issues with it. One
is, I'd rather have something that will launch and debug the
executable from inside QtCreator rather than running it in terminal,
pausing it, and then attach the debugger. The other one is I remember
when putting breakpoints (after attaching) it would only work on the
current snapshot and not the rest. I'm not sure if this is still the
default behavior. Unfortunately, I'm not sure I understand the second
qml/c++ approach!

How would you suggest I go about changing snapshot feature. I'd like
to have something like this:
1) A simple pop up window where I can set the number of processes that
code should be run on.
2) Given the number, QtCreator should invoke mpirun to run the
executable, and possibly pass all command-line options.
3) Then It should attach gdb to each separate process and show that in
window like snapshot where it would be easy to switch back and forth
between processes
4) Finally It should be possible that a breakpoint be applied to all
running processes

There are extra criteria I could think of but they wont be primary.

> Andre'

More information about the Qt-creator mailing list