1

I'm using gdb to debug a parallel mpi-code 'prog'. For that I use a small number of processes, say 'M' and do something like

mpiexec -n M xterm -e gdb ./prog

This pops up M xterms with each of them running one gdb process on one of the files prog.
The resulting cluttering of the screen by individual windows can be rather cumbersome.
Is there any way, using any known split-window terminal emulator (say, terminator), such as to have the M gdb processes starting up in only one window, however split into M parts from start?

Mark
  • 439
  • 1
  • 5
  • 18

2 Answers2

1

I faced a similar problem and have found tmpi which does exactly what you want: launch mpi debugging processes in M tmux terminal windows.

Clone the repository:

git clone https://github.com/Azrael3000/tmpi.git

then install with:

sudo ./tmpi/install.sh

which places the tmpi executable in /usr/local/bin

The tmpi executable and tmux must be in the path on all your servers.

Run a job with:

tmpi M gdb my_executable

where M is the number of processes that you want.

0

What you want is called a 'terminal multiplexer'; look into screen or tmux

EDIT: this is probably what you want; issue the following commands in your shell

tmux new-session -d bash     # start a bash shell
tmux split-window -v python  # start a python shell below it
tmux attach-session -d       # enter the tmux session
JRG
  • 2,065
  • 2
  • 14
  • 29
  • So how would using tmux/screen answer my question? Once again, and even more simplified, starting several parallel jobs with mpi, say just a 'top' process like: 'mpiexec -n 2 xterm -e top' will pop up 2 xterms with one top processes running in each. What should I do with tmux/screen to have the 2 processes running side-by-side in 2 panes of a single split screen? – Mark Jun 01 '13 at 09:59
  • http://stackoverflow.com/questions/1236376/how-to-start-a-new-process-in-a-new-window-in-an-existing-gnu-screen-session-fr – JRG Jun 01 '13 at 10:54
  • I don't see the relation between this link and my question. I don't want to start 'a' new process in 'a' new window ... I want to start *several* new processes with one mpi command in *one* window, split into as many panes as there are processes started. – Mark Jun 01 '13 at 11:50
  • Btw.: if you don't have MPI running, I can ask a similar question without it. Just do: 'xterm top & xterm top &' all at once on one command line. Again this will pop up *two* xterms running 'top'. Now what I'm looking for is a substitute for this command such as to produce only a *single* terminal(?) poping up, split however into two panes, each running one of the two 'top' processes. I don't care if tmux / screen / or whatever will do the job, as long as only a *single* additional terminal is generated. – Mark Jun 01 '13 at 12:09
  • @Mark, I'm pretty that what you ask is impossible. Why creating several terminals packed into one visible "screen" with `screen` or `tmux` doesn't fit your needs? – vadipp Aug 08 '13 at 13:12