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