Hi Darius,<br> Thanks a lot for the clarification. It did help :).<br>Krishna Chaitanya K <br><br><div class="gmail_quote">On Jan 3, 2008 11:39 AM, Darius Buntinas <<a href="mailto:buntinas@mcs.anl.gov">buntinas@mcs.anl.gov
</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>It's easiest if you run both processes on the same machine, then the
<br>DISPLAY values will be correct.<br><br>But if you need to use two machines, there are some tricks.<br><br>Using ssh (this is secure and the way I do it). First some background<br>info. Ssh can be configured to forward X traffic from a remote machine
<br>back to your display. When you ssh into another machine you'll see that<br>DISPLAY is set to something like "localhost:10.0". Now any process<br>(that's owned by you) on the remote machine can display an xwindow on
<br>your local display by sending it to "localhost:10.0". Another thing to<br>notice is that every new ssh session (whether it's your ssh session or<br>someone else's) to that node gets a different value for DISPLAY (
e.g.,<br>"localhost:11.0").<br><br>So what I do is open one ssh session to each of the remote machines my<br>jobs will run on. This sets up the X forwarding, and you need to keep<br>these open as long as you want X to be forwarded. Now, read the values
<br>of DISPLAY from each ssh session. If they're the same, say<br>localhost:10.0, it's easy:<br><br> mpiexec -n 2 -env DISPLAY localhost:10.0 xterm -e gdb ./cpi<br><br>You should see two xterms open up, one from each remote machine, with
<br>gdb running.<br><br>Now, if DISPLAY is not the same on both, then you'll have to set DISPLAY<br>differently for each process:<br><br> mpiexec -n 1 -env DISPLAY localhost:10.0 xterm -e gdb ./cpi : \<br> n 1 -env DISPLAY localhost:
11.0 xterm -e gdb ./cpi<br><br>(Notice the colon (:) and the escaped linebreak). The trick is to<br>figure out which rank runs on which machine, so you use the right<br>DISPLAY value on the right machine. Of course with two processes, you
<br>can try it one way, and if it doesn't work flip the DISPLAY values and<br>try again. (alternatively you can check which rank is run on which<br>machine like this: "mpiexec -l -n 2 hostname").<br><br>Note that you can run any X program this way. I generally use ddd as
<br>the debugger instead of "xterm -e gdb"<br><br>I hope this clarified more thatn it confused.<br><font color="#888888"><br>-d<br></font><div class="Ih2E3d"><br>On 01/03/2008 04:03 AM, Krishna Chaitanya wrote:<br>
> Hi,<br></div><div class="Ih2E3d">> Thanks for the help, guess I complicated my question un-necessarily.<br>> I wish to run a program on two machines and have two debug<br>> windows on my local machine, so that i can trace through the pt2pt code.
<br>> This must concern xterm and setting the display variable correctly. At<br>> this stage, I have the DISPLAY set to 0.0 on both the machines and I am<br>> ssh-ing into the remote machine by using the -X switch. The debug window
<br>> for the remote machine is getting launched at the remote terminal but is<br>> not getting displayed on mine. Please let me know what needs to be done<br>> to have the window displayed on my machine.<br>>
<br>> Thanks,<br>> Krishna Chaitanya K<br>><br>><br>><br>><br>> On 1/2/08, *Darius Buntinas* <<a href="mailto:buntinas@mcs.anl.gov">buntinas@mcs.anl.gov</a><br></div><div><div></div><div class="Wj3C7c">
> <mailto:<a href="mailto:buntinas@mcs.anl.gov">buntinas@mcs.anl.gov</a>>> wrote:<br>><br>><br>> I'm not sure exactly what you want to do, so here are a few ideas.<br>><br>> If you want to start rank 0 before rank 1, you can change your test
<br>> program so it calls mpi_commrank right after mpi_init. Then set a<br>> breakpoint just after mpi_commrank, and when you hit the breakpoint, you<br>> can look at the rank and decide which one to continue running.
<br>><br>> If you can't modify the test program, you can set the breakpoint just<br>> after mpi_init, then read MPIDI_Process.my_pg_rank. You'll have to<br>> configure MPICH2 with --enable-g=dbg to get debugging symbols added (you
<br>> might also want to configure with --disable-compiler-optimizations to<br>> remove the -O2 flag and make it easier to step through the code).<br>><br>> If you really need to know the rank of a process before mpi_init is
<br>> called, you can read the PMI_RANK environment variable. Note that<br>> mpi_init performs an implicit barrier, so if one process calls<br>> mpi_init,<br>> it won't exit until all other processes have called mpi_init, so even if
<br>> you start one process before the others, it won't get past mpi_init.<br>><br>> Hope that helps,<br>> -d<br>><br>> On 12/31/2007 04:07 AM, Krishna Chaitanya wrote:<br>> > Hi,
<br>> > I have been tracing the flow of the mpich code by<br>> > executing a simple program having MPI_Send() and MPI_Recv(),on one<br>> > machine. I have been using gdb along with xtern to have two windows
<br>> > open at the same time as I step through the code. I wish to get a<br>> better<br>> > glimpse of the working of the point to point calls, by launching<br>> the job<br>> > on two machines and by tracing the flow in a similar manner.
<br>> Could you<br>> > please tell me how I can go about it? I have a feeling that this<br>> can be<br>> > done by hard-coding the macros and telling the daemons directly<br>> that one
<br>> > machine is rank1 and the other is rank2. That way, i can start rank1<br>> > process first and the rank2 process a little later and trace<br>> through the<br>> > code.<br>> >
<br>> > Thanks,<br>> > Krishna Chaitanya,<br>> > Dept of Information Technology,<br>> > National Institute of Technology, Karnataka ( NITK )<br>> > India<br>> >
<br>> > --<br>> > In the middle of difficulty, lies opportunity<br>><br>><br>><br>><br>> --<br>> In the middle of difficulty, lies opportunity<br></div></div></blockquote></div><br>
<br clear="all"><br>-- <br>In the middle of difficulty, lies opportunity